diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ad2df5a5..cb398c7ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## Unreleased +- [Minor] Add support for 2023-01 API version [#659](https://github.com/Shopify/shopify-api-js/pull/659) - [Patch] Force `/` path on session cookie [#658](https://github.com/Shopify/shopify-api-js/pull/658) - [Patch] Don't ignore previous headers when beginning OAuth [#652](https://github.com/Shopify/shopify-api-js/pull/652) - [Patch] Export missing client types from package [#648](https://github.com/Shopify/shopify-api-js/pull/648) diff --git a/lib/types.ts b/lib/types.ts index 2adf351f8..b1c9b1ab1 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -10,11 +10,12 @@ export enum ApiVersion { April22 = '2022-04', July22 = '2022-07', October22 = '2022-10', + January23 = '2023-01', Unstable = 'unstable', } export const LIBRARY_NAME = 'Shopify API Library'; -export const LATEST_API_VERSION = ApiVersion.October22; +export const LATEST_API_VERSION = ApiVersion.January23; /* eslint-disable @shopify/typescript/prefer-pascal-case-enums */ export enum ShopifyHeader { diff --git a/rest/admin/2022-04/metafield.ts b/rest/admin/2022-04/metafield.ts index f8ed277ca..6bca32007 100644 --- a/rest/admin/2022-04/metafield.ts +++ b/rest/admin/2022-04/metafield.ts @@ -86,6 +86,7 @@ export class Metafield extends Base { protected static PATHS: ResourcePath[] = [ {"http_method": "delete", "operation": "delete", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, @@ -93,18 +94,17 @@ export class Metafield extends Base { {"http_method": "delete", "operation": "delete", "ids": ["order_id", "id"], "path": "orders//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["page_id", "id"], "path": "pages//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, - {"http_method": "delete", "operation": "delete", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, {"http_method": "get", "operation": "count", "ids": ["article_id"], "path": "articles//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["collection_id"], "path": "collections//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["customer_id"], "path": "customers//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["draft_order_id"], "path": "draft_orders//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": [], "path": "metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["order_id"], "path": "orders//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["page_id"], "path": "pages//metafields/count.json"}, - {"http_method": "get", "operation": "count", "ids": ["page_id"], "path": "pages//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["product_image_id"], "path": "product_images//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["product_id"], "path": "products//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["variant_id"], "path": "variants//metafields/count.json"}, @@ -113,6 +113,7 @@ export class Metafield extends Base { {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, {"http_method": "get", "operation": "get", "ids": ["collection_id"], "path": "collections//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, {"http_method": "get", "operation": "get", "ids": ["customer_id"], "path": "customers//metafields.json"}, @@ -131,9 +132,9 @@ export class Metafield extends Base { {"http_method": "get", "operation": "get", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, {"http_method": "get", "operation": "get", "ids": ["variant_id"], "path": "variants//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, - {"http_method": "get", "operation": "get", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, {"http_method": "post", "operation": "post", "ids": ["article_id"], "path": "articles//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["collection_id"], "path": "collections//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["customer_id"], "path": "customers//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["draft_order_id"], "path": "draft_orders//metafields.json"}, @@ -145,6 +146,7 @@ export class Metafield extends Base { {"http_method": "post", "operation": "post", "ids": ["variant_id"], "path": "variants//metafields.json"}, {"http_method": "put", "operation": "put", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, diff --git a/rest/admin/2022-07/metafield.ts b/rest/admin/2022-07/metafield.ts index b3aaaeccf..a05c987d0 100644 --- a/rest/admin/2022-07/metafield.ts +++ b/rest/admin/2022-07/metafield.ts @@ -86,6 +86,7 @@ export class Metafield extends Base { protected static PATHS: ResourcePath[] = [ {"http_method": "delete", "operation": "delete", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, @@ -93,18 +94,17 @@ export class Metafield extends Base { {"http_method": "delete", "operation": "delete", "ids": ["order_id", "id"], "path": "orders//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["page_id", "id"], "path": "pages//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, - {"http_method": "delete", "operation": "delete", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, {"http_method": "get", "operation": "count", "ids": ["article_id"], "path": "articles//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["collection_id"], "path": "collections//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["customer_id"], "path": "customers//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["draft_order_id"], "path": "draft_orders//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": [], "path": "metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["order_id"], "path": "orders//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["page_id"], "path": "pages//metafields/count.json"}, - {"http_method": "get", "operation": "count", "ids": ["page_id"], "path": "pages//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["product_image_id"], "path": "product_images//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["product_id"], "path": "products//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["variant_id"], "path": "variants//metafields/count.json"}, @@ -113,6 +113,7 @@ export class Metafield extends Base { {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, {"http_method": "get", "operation": "get", "ids": ["collection_id"], "path": "collections//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, {"http_method": "get", "operation": "get", "ids": ["customer_id"], "path": "customers//metafields.json"}, @@ -131,9 +132,9 @@ export class Metafield extends Base { {"http_method": "get", "operation": "get", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, {"http_method": "get", "operation": "get", "ids": ["variant_id"], "path": "variants//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, - {"http_method": "get", "operation": "get", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, {"http_method": "post", "operation": "post", "ids": ["article_id"], "path": "articles//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["collection_id"], "path": "collections//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["customer_id"], "path": "customers//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["draft_order_id"], "path": "draft_orders//metafields.json"}, @@ -145,6 +146,7 @@ export class Metafield extends Base { {"http_method": "post", "operation": "post", "ids": ["variant_id"], "path": "variants//metafields.json"}, {"http_method": "put", "operation": "put", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, diff --git a/rest/admin/2022-10/metafield.ts b/rest/admin/2022-10/metafield.ts index 0a970e25c..5e04975ff 100644 --- a/rest/admin/2022-10/metafield.ts +++ b/rest/admin/2022-10/metafield.ts @@ -86,6 +86,7 @@ export class Metafield extends Base { protected static PATHS: ResourcePath[] = [ {"http_method": "delete", "operation": "delete", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, @@ -93,18 +94,17 @@ export class Metafield extends Base { {"http_method": "delete", "operation": "delete", "ids": ["order_id", "id"], "path": "orders//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["page_id", "id"], "path": "pages//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, - {"http_method": "delete", "operation": "delete", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, {"http_method": "delete", "operation": "delete", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, {"http_method": "get", "operation": "count", "ids": ["article_id"], "path": "articles//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["collection_id"], "path": "collections//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["customer_id"], "path": "customers//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["draft_order_id"], "path": "draft_orders//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": [], "path": "metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["order_id"], "path": "orders//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["page_id"], "path": "pages//metafields/count.json"}, - {"http_method": "get", "operation": "count", "ids": ["page_id"], "path": "pages//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["product_image_id"], "path": "product_images//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["product_id"], "path": "products//metafields/count.json"}, {"http_method": "get", "operation": "count", "ids": ["variant_id"], "path": "variants//metafields/count.json"}, @@ -113,6 +113,7 @@ export class Metafield extends Base { {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, {"http_method": "get", "operation": "get", "ids": ["collection_id"], "path": "collections//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, {"http_method": "get", "operation": "get", "ids": ["customer_id"], "path": "customers//metafields.json"}, @@ -131,9 +132,9 @@ export class Metafield extends Base { {"http_method": "get", "operation": "get", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, {"http_method": "get", "operation": "get", "ids": ["variant_id"], "path": "variants//metafields.json"}, {"http_method": "get", "operation": "get", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, - {"http_method": "get", "operation": "get", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, {"http_method": "post", "operation": "post", "ids": ["article_id"], "path": "articles//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["collection_id"], "path": "collections//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["customer_id"], "path": "customers//metafields.json"}, {"http_method": "post", "operation": "post", "ids": ["draft_order_id"], "path": "draft_orders//metafields.json"}, @@ -145,6 +146,7 @@ export class Metafield extends Base { {"http_method": "post", "operation": "post", "ids": ["variant_id"], "path": "variants//metafields.json"}, {"http_method": "put", "operation": "put", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, {"http_method": "put", "operation": "put", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, diff --git a/rest/admin/2023-01/abandoned_checkout.ts b/rest/admin/2023-01/abandoned_checkout.ts new file mode 100644 index 000000000..e19679fb8 --- /dev/null +++ b/rest/admin/2023-01/abandoned_checkout.ts @@ -0,0 +1,108 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Currency} from './currency'; +import {Customer} from './customer'; +import {DiscountCode} from './discount_code'; + +interface CheckoutsArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + status?: unknown; + limit?: unknown; +} + +export class AbandonedCheckout extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'abandoned_checkout'; + protected static PLURAL_NAME = 'abandoned_checkouts'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "currency": Currency, + "customer": Customer + }; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "discount_codes": DiscountCode + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "checkouts", "ids": [], "path": "checkouts.json"}, + {"http_method": "get", "operation": "checkouts", "ids": [], "path": "checkouts.json"} + ]; + + public static async checkouts( + { + session, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + status = null, + limit = null, + ...otherArgs + }: CheckoutsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "checkouts", + session: session, + urlIds: {}, + params: {"since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "status": status, "limit": limit, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public abandoned_checkout_url: string | null; + public billing_address: {[key: string]: unknown} | null; + public buyer_accepts_marketing: boolean | null; + public buyer_accepts_sms_marketing: boolean | null; + public cart_token: string | null; + public closed_at: string | null; + public completed_at: string | null; + public created_at: string | null; + public currency: Currency | null | {[key: string]: any}; + public customer: Customer | null | {[key: string]: any}; + public customer_locale: string | null; + public device_id: number | null; + public discount_codes: DiscountCode[] | null | {[key: string]: any}; + public email: string | null; + public gateway: string | null; + public id: number | null; + public landing_site: string | null; + public line_items: {[key: string]: unknown} | null; + public location_id: number | null; + public note: string | null; + public phone: string | null; + public presentment_currency: string | null; + public referring_site: string | null; + public shipping_address: {[key: string]: unknown} | null; + public shipping_lines: {[key: string]: unknown} | null; + public sms_marketing_phone: string | null; + public source_name: string | null; + public subtotal_price: string | null; + public tax_lines: {[key: string]: unknown} | null; + public taxes_included: boolean | null; + public token: string | null; + public total_discounts: string | null; + public total_duties: string | null; + public total_line_items_price: string | null; + public total_price: string | null; + public total_tax: string | null; + public total_weight: number | null; + public updated_at: string | null; + public user_id: number | null; +} diff --git a/rest/admin/2023-01/access_scope.ts b/rest/admin/2023-01/access_scope.ts new file mode 100644 index 000000000..0fa89e25a --- /dev/null +++ b/rest/admin/2023-01/access_scope.ts @@ -0,0 +1,44 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class AccessScope extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'access_scope'; + protected static PLURAL_NAME = 'access_scopes'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static CUSTOM_PREFIX: string | null = "/admin/oauth"; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "access_scopes.json"} + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public handle: string | null; + public access_scopes: {[key: string]: unknown}[] | null; +} diff --git a/rest/admin/2023-01/apple_pay_certificate.ts b/rest/admin/2023-01/apple_pay_certificate.ts new file mode 100644 index 000000000..0ef71ab3e --- /dev/null +++ b/rest/admin/2023-01/apple_pay_certificate.ts @@ -0,0 +1,93 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface CsrArgs { + [key: string]: unknown; + session: Session; + id: number | string; +} + +export class ApplePayCertificate extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'apple_pay_certificate'; + protected static PLURAL_NAME = 'apple_pay_certificates'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "apple_pay_certificates/.json"}, + {"http_method": "get", "operation": "csr", "ids": ["id"], "path": "apple_pay_certificates//csr.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "apple_pay_certificates/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "apple_pay_certificates.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "apple_pay_certificates/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async csr( + { + session, + id, + ...otherArgs + }: CsrArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "csr", + session: session, + urlIds: {"id": id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public id: number | null; + public merchant_id: string | null; + public status: string | null; +} diff --git a/rest/admin/2023-01/application_charge.ts b/rest/admin/2023-01/application_charge.ts new file mode 100644 index 000000000..da0b317d4 --- /dev/null +++ b/rest/admin/2023-01/application_charge.ts @@ -0,0 +1,76 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + fields?: unknown; +} + +export class ApplicationCharge extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'application_charge'; + protected static PLURAL_NAME = 'application_charges'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "application_charges.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "application_charges/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "application_charges.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public confirmation_url: string | null; + public created_at: string | null; + public id: number | null; + public name: string | null; + public price: string | number | null; + public return_url: string | null; + public status: string | null; + public test: boolean | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/application_credit.ts b/rest/admin/2023-01/application_credit.ts new file mode 100644 index 000000000..106c253af --- /dev/null +++ b/rest/admin/2023-01/application_credit.ts @@ -0,0 +1,69 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; +} + +export class ApplicationCredit extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'application_credit'; + protected static PLURAL_NAME = 'application_credits'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "application_credits.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "application_credits/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "application_credits.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public amount: number | null; + public description: string | null; + public id: number | null; + public test: boolean | null; +} diff --git a/rest/admin/2023-01/article.ts b/rest/admin/2023-01/article.ts new file mode 100644 index 000000000..833113c54 --- /dev/null +++ b/rest/admin/2023-01/article.ts @@ -0,0 +1,233 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Metafield} from './metafield'; + +interface FindArgs { + session: Session; + id: number | string; + blog_id?: number | string | null; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + blog_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + blog_id?: number | string | null; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + handle?: unknown; + tag?: unknown; + author?: unknown; + fields?: unknown; +} +interface AuthorsArgs { + [key: string]: unknown; + session: Session; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + blog_id?: number | string | null; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} +interface TagsArgs { + [key: string]: unknown; + session: Session; + blog_id?: number | string | null; + limit?: unknown; + popular?: unknown; +} + +export class Article extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'article'; + protected static PLURAL_NAME = 'articles'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "metafields": Metafield + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//articles/.json"}, + {"http_method": "get", "operation": "authors", "ids": [], "path": "articles/authors.json"}, + {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//articles/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//articles.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//articles/.json"}, + {"http_method": "get", "operation": "tags", "ids": [], "path": "articles/tags.json"}, + {"http_method": "get", "operation": "tags", "ids": ["blog_id"], "path": "blogs//articles/tags.json"}, + {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//articles.json"}, + {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//articles/.json"} + ]; + + public static async find( + { + session, + id, + blog_id = null, + fields = null + }: FindArgs + ): Promise
{ + const result = await this.baseFind
({ + session: session, + urlIds: {"id": id, "blog_id": blog_id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id, + blog_id = null + }: DeleteArgs + ): Promise { + const response = await this.request
({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "blog_id": blog_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + blog_id = null, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + handle = null, + tag = null, + author = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind
({ + session: session, + urlIds: {"blog_id": blog_id}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "handle": handle, "tag": tag, "author": author, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async authors( + { + session, + ...otherArgs + }: AuthorsArgs + ): Promise { + const response = await this.request
({ + http_method: "get", + operation: "authors", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async count( + { + session, + blog_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request
({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"blog_id": blog_id}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async tags( + { + session, + blog_id = null, + limit = null, + popular = null, + ...otherArgs + }: TagsArgs + ): Promise { + const response = await this.request
({ + http_method: "get", + operation: "tags", + session: session, + urlIds: {"blog_id": blog_id}, + params: {"limit": limit, "popular": popular, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public author: string | null; + public blog_id: number | null; + public body_html: string | null; + public created_at: string | null; + public handle: string | null; + public id: number | null; + public image: string | {[key: string]: unknown} | null; + public metafields: Metafield[] | null | {[key: string]: any}; + public published: boolean | null; + public published_at: string | null; + public summary_html: string | null; + public tags: string | null; + public template_suffix: string | null; + public title: string | null; + public updated_at: string | null; + public user_id: number | null; +} diff --git a/rest/admin/2023-01/asset.ts b/rest/admin/2023-01/asset.ts new file mode 100644 index 000000000..bea715096 --- /dev/null +++ b/rest/admin/2023-01/asset.ts @@ -0,0 +1,84 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface DeleteArgs { + session: Session; + theme_id?: number | string | null; + asset?: {[key: string]: unknown} | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + theme_id?: number | string | null; + fields?: unknown; + asset?: {[key: string]: unknown} | null; +} + +export class Asset extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'asset'; + protected static PLURAL_NAME = 'assets'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["theme_id"], "path": "themes//assets.json"}, + {"http_method": "get", "operation": "get", "ids": ["theme_id"], "path": "themes//assets.json"}, + {"http_method": "get", "operation": "get", "ids": ["theme_id"], "path": "themes//assets.json"}, + {"http_method": "put", "operation": "put", "ids": ["theme_id"], "path": "themes//assets.json"} + ]; + protected static PRIMARY_KEY: string = "key"; + + public static async delete( + { + session, + theme_id = null, + asset = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"theme_id": theme_id}, + params: {"asset": asset}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + theme_id = null, + fields = null, + asset = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"theme_id": theme_id}, + params: {"fields": fields, "asset": asset, ...otherArgs}, + }); + + return response; + } + + public attachment: string | null; + public checksum: string | null; + public content_type: string | null; + public created_at: string | null; + public key: string | null; + public public_url: string | null; + public size: number | null; + public theme_id: number | null; + public updated_at: string | null; + public value: string | null; +} diff --git a/rest/admin/2023-01/assigned_fulfillment_order.ts b/rest/admin/2023-01/assigned_fulfillment_order.ts new file mode 100644 index 000000000..fff0d500b --- /dev/null +++ b/rest/admin/2023-01/assigned_fulfillment_order.ts @@ -0,0 +1,53 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + assignment_status?: unknown; + location_ids?: unknown[] | number | string | null; +} + +export class AssignedFulfillmentOrder extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'fulfillment_order'; + protected static PLURAL_NAME = 'fulfillment_orders'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "assigned_fulfillment_orders.json"} + ]; + + public static async all( + { + session, + assignment_status = null, + location_ids = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"assignment_status": assignment_status, "location_ids": location_ids, ...otherArgs}, + }); + + return response; + } + + public assigned_location_id: number | null; + public destination: {[key: string]: unknown} | null; + public id: number | null; + public line_items: {[key: string]: unknown}[] | null; + public order_id: number | null; + public request_status: string | null; + public shop_id: number | null; + public status: string | null; +} diff --git a/rest/admin/2023-01/balance.ts b/rest/admin/2023-01/balance.ts new file mode 100644 index 000000000..5d3278631 --- /dev/null +++ b/rest/admin/2023-01/balance.ts @@ -0,0 +1,41 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class Balance extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'balance'; + protected static PLURAL_NAME = 'balances'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shopify_payments/balance.json"} + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + +} diff --git a/rest/admin/2023-01/blog.ts b/rest/admin/2023-01/blog.ts new file mode 100644 index 000000000..727896d23 --- /dev/null +++ b/rest/admin/2023-01/blog.ts @@ -0,0 +1,134 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Metafield} from './metafield'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + handle?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} + +export class Blog extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'blog'; + protected static PLURAL_NAME = 'blogs'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "metafields": Metafield + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "blogs/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "blogs/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "blogs.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "blogs/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "blogs.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "blogs/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + handle = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "handle": handle, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public admin_graphql_api_id: string | null; + public commentable: string | null; + public created_at: string | null; + public feedburner: string | null; + public feedburner_location: string | null; + public handle: string | null; + public id: number | null; + public metafields: Metafield[] | null | {[key: string]: any}; + public tags: string | null; + public template_suffix: string | null; + public title: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/cancellation_request.ts b/rest/admin/2023-01/cancellation_request.ts new file mode 100644 index 000000000..6060502f2 --- /dev/null +++ b/rest/admin/2023-01/cancellation_request.ts @@ -0,0 +1,74 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {ApiVersion} from '../../../lib/types'; + +interface AcceptArgs { + [key: string]: unknown; + message?: unknown; + body?: {[key: string]: unknown} | null; +} +interface RejectArgs { + [key: string]: unknown; + message?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class CancellationRequest extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'cancellation_request'; + protected static PLURAL_NAME = 'cancellation_requests'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "post", "operation": "accept", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//cancellation_request/accept.json"}, + {"http_method": "post", "operation": "post", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//cancellation_request.json"}, + {"http_method": "post", "operation": "reject", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//cancellation_request/reject.json"} + ]; + + public async accept( + { + message = null, + body = null, + ...otherArgs + }: AcceptArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "accept", + session: this.session, + urlIds: {"fulfillment_order_id": this.fulfillment_order_id}, + params: {"message": message, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async reject( + { + message = null, + body = null, + ...otherArgs + }: RejectArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "reject", + session: this.session, + urlIds: {"fulfillment_order_id": this.fulfillment_order_id}, + params: {"message": message, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public fulfillment_order_id: number | null; +} diff --git a/rest/admin/2023-01/carrier_service.ts b/rest/admin/2023-01/carrier_service.ts new file mode 100644 index 000000000..1ed1225a2 --- /dev/null +++ b/rest/admin/2023-01/carrier_service.ts @@ -0,0 +1,91 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class CarrierService extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'carrier_service'; + protected static PLURAL_NAME = 'carrier_services'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "carrier_services/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "carrier_services.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "carrier_services/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "carrier_services.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "carrier_services/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public active: boolean | null; + public admin_graphql_api_id: string | null; + public callback_url: string | null; + public carrier_service_type: string | null; + public id: number | null; + public name: string | null; + public service_discovery: boolean | null; +} diff --git a/rest/admin/2023-01/checkout.ts b/rest/admin/2023-01/checkout.ts new file mode 100644 index 000000000..8954d253c --- /dev/null +++ b/rest/admin/2023-01/checkout.ts @@ -0,0 +1,135 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {DiscountCode} from './discount_code'; +import {Order} from './order'; +import {GiftCard} from './gift_card'; + +interface FindArgs { + session: Session; + token: number | string; +} +interface ShippingRatesArgs { + [key: string]: unknown; + session: Session; + token: number | string; +} +interface CompleteArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Checkout extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'checkout'; + protected static PLURAL_NAME = 'checkouts'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "discount_code": DiscountCode, + "order": Order + }; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "gift_cards": GiftCard + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["token"], "path": "checkouts/.json"}, + {"http_method": "get", "operation": "shipping_rates", "ids": ["token"], "path": "checkouts//shipping_rates.json"}, + {"http_method": "post", "operation": "complete", "ids": ["token"], "path": "checkouts//complete.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "checkouts.json"}, + {"http_method": "put", "operation": "put", "ids": ["token"], "path": "checkouts/.json"} + ]; + protected static PRIMARY_KEY: string = "token"; + + public static async find( + { + session, + token + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"token": token}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async shipping_rates( + { + session, + token, + ...otherArgs + }: ShippingRatesArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "shipping_rates", + session: session, + urlIds: {"token": token}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async complete( + { + body = null, + ...otherArgs + }: CompleteArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "complete", + session: this.session, + urlIds: {"token": this.token}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public billing_address: {[key: string]: unknown} | null; + public line_items: {[key: string]: unknown}[] | null; + public applied_discount: {[key: string]: unknown} | null; + public buyer_accepts_marketing: boolean | null; + public created_at: string | null; + public currency: string | null; + public customer_id: number | null; + public discount_code: DiscountCode | null | {[key: string]: any}; + public email: string | null; + public gift_cards: GiftCard[] | null | {[key: string]: any}; + public order: Order | null | {[key: string]: any}; + public payment_due: string | null; + public payment_url: string | null; + public phone: string | null; + public presentment_currency: string | null; + public requires_shipping: boolean | null; + public reservation_time: string | null; + public reservation_time_left: number | null; + public shipping_address: {[key: string]: unknown} | null; + public shipping_line: {[key: string]: unknown} | null; + public shipping_rate: {[key: string]: unknown} | null; + public source_identifier: string | null; + public source_name: string | null; + public source_url: string | null; + public subtotal_price: string | null; + public tax_lines: {[key: string]: unknown}[] | null; + public taxes_included: boolean | null; + public token: string | null; + public total_price: string | null; + public total_tax: string | null; + public updated_at: string | null; + public user_id: number | null; + public web_url: string | null; +} diff --git a/rest/admin/2023-01/collect.ts b/rest/admin/2023-01/collect.ts new file mode 100644 index 000000000..530aad145 --- /dev/null +++ b/rest/admin/2023-01/collect.ts @@ -0,0 +1,122 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} + +export class Collect extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'collect'; + protected static PLURAL_NAME = 'collects'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "collects/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "collects/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "collects.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "collects/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "collects.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public collection_id: number | null; + public created_at: string | null; + public id: number | null; + public position: number | null; + public product_id: number | null; + public sort_value: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/collection.ts b/rest/admin/2023-01/collection.ts new file mode 100644 index 000000000..56109ef52 --- /dev/null +++ b/rest/admin/2023-01/collection.ts @@ -0,0 +1,84 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Image} from './image'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface ProductsArgs { + [key: string]: unknown; + session: Session; + id: number | string; + limit?: unknown; +} + +export class Collection extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'collection'; + protected static PLURAL_NAME = 'collections'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "image": Image + }; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "collections/.json"}, + {"http_method": "get", "operation": "products", "ids": ["id"], "path": "collections//products.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async products( + { + session, + id, + limit = null, + ...otherArgs + }: ProductsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "products", + session: session, + urlIds: {"id": id}, + params: {"limit": limit, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public title: string | null; + public body_html: string | null; + public handle: string | null; + public id: number | null; + public image: Image | null | {[key: string]: any}; + public published_at: string | null; + public published_scope: string | null; + public sort_order: string | null; + public template_suffix: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/collection_listing.ts b/rest/admin/2023-01/collection_listing.ts new file mode 100644 index 000000000..11cec1d95 --- /dev/null +++ b/rest/admin/2023-01/collection_listing.ts @@ -0,0 +1,127 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Image} from './image'; + +interface FindArgs { + session: Session; + collection_id: number | string; +} +interface DeleteArgs { + session: Session; + collection_id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; +} +interface ProductIdsArgs { + [key: string]: unknown; + session: Session; + collection_id: number | string; + limit?: unknown; +} + +export class CollectionListing extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'collection_listing'; + protected static PLURAL_NAME = 'collection_listings'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "image": Image + }; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["collection_id"], "path": "collection_listings/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "collection_listings.json"}, + {"http_method": "get", "operation": "get", "ids": ["collection_id"], "path": "collection_listings/.json"}, + {"http_method": "get", "operation": "product_ids", "ids": ["collection_id"], "path": "collection_listings//product_ids.json"}, + {"http_method": "put", "operation": "put", "ids": ["collection_id"], "path": "collection_listings/.json"} + ]; + protected static PRIMARY_KEY: string = "collection_id"; + + public static async find( + { + session, + collection_id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"collection_id": collection_id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + collection_id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"collection_id": collection_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, ...otherArgs}, + }); + + return response; + } + + public static async product_ids( + { + session, + collection_id, + limit = null, + ...otherArgs + }: ProductIdsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "product_ids", + session: session, + urlIds: {"collection_id": collection_id}, + params: {"limit": limit, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public body_html: string | null; + public collection_id: number | null; + public default_product_image: {[key: string]: unknown}[] | null; + public handle: string | null; + public image: Image | null | {[key: string]: any}; + public published_at: string | null; + public sort_order: string | null; + public title: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/comment.ts b/rest/admin/2023-01/comment.ts new file mode 100644 index 000000000..db1e867e4 --- /dev/null +++ b/rest/admin/2023-01/comment.ts @@ -0,0 +1,259 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + fields?: unknown; + published_status?: unknown; + status?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + status?: unknown; +} +interface ApproveArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface NotSpamArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface RemoveArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface RestoreArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface SpamArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Comment extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'comment'; + protected static PLURAL_NAME = 'comments'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": [], "path": "comments/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "comments.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "comments/.json"}, + {"http_method": "post", "operation": "approve", "ids": ["id"], "path": "comments//approve.json"}, + {"http_method": "post", "operation": "not_spam", "ids": ["id"], "path": "comments//not_spam.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "comments.json"}, + {"http_method": "post", "operation": "remove", "ids": ["id"], "path": "comments//remove.json"}, + {"http_method": "post", "operation": "restore", "ids": ["id"], "path": "comments//restore.json"}, + {"http_method": "post", "operation": "spam", "ids": ["id"], "path": "comments//spam.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "comments/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + fields = null, + published_status = null, + status = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "fields": fields, "published_status": published_status, "status": status, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "status": status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async approve( + { + body = null, + ...otherArgs + }: ApproveArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "approve", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async not_spam( + { + body = null, + ...otherArgs + }: NotSpamArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "not_spam", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async remove( + { + body = null, + ...otherArgs + }: RemoveArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "remove", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async restore( + { + body = null, + ...otherArgs + }: RestoreArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "restore", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async spam( + { + body = null, + ...otherArgs + }: SpamArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "spam", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public article_id: number | null; + public author: string | null; + public blog_id: number | null; + public body: string | null; + public body_html: string | null; + public created_at: string | null; + public email: string | null; + public id: number | null; + public ip: string | null; + public published_at: string | null; + public status: string | null; + public updated_at: string | null; + public user_agent: string | null; +} diff --git a/rest/admin/2023-01/country.ts b/rest/admin/2023-01/country.ts new file mode 100644 index 000000000..a7f6873f9 --- /dev/null +++ b/rest/admin/2023-01/country.ts @@ -0,0 +1,123 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Province} from './province'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} + +export class Country extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'country'; + protected static PLURAL_NAME = 'countries'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "provinces": Province + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "countries/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "countries/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "countries.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "countries/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "countries.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "countries/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public code: string | null; + public id: number | null; + public name: string | null; + public provinces: Province[] | null | {[key: string]: any}; + public tax: number | null; +} diff --git a/rest/admin/2023-01/currency.ts b/rest/admin/2023-01/currency.ts new file mode 100644 index 000000000..9d9e2dd8b --- /dev/null +++ b/rest/admin/2023-01/currency.ts @@ -0,0 +1,43 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class Currency extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'currency'; + protected static PLURAL_NAME = 'currencies'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "currencies.json"} + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public currency: string | null; + public rate_updated_at: string | null; +} diff --git a/rest/admin/2023-01/custom_collection.ts b/rest/admin/2023-01/custom_collection.ts new file mode 100644 index 000000000..36b50bd72 --- /dev/null +++ b/rest/admin/2023-01/custom_collection.ts @@ -0,0 +1,159 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + ids?: unknown; + since_id?: unknown; + title?: unknown; + product_id?: unknown; + handle?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + title?: unknown; + product_id?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} + +export class CustomCollection extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'custom_collection'; + protected static PLURAL_NAME = 'custom_collections'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "custom_collections/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "custom_collections/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "custom_collections.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "custom_collections/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "custom_collections.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "custom_collections/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + ids = null, + since_id = null, + title = null, + product_id = null, + handle = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "ids": ids, "since_id": since_id, "title": title, "product_id": product_id, "handle": handle, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + title = null, + product_id = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"title": title, "product_id": product_id, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public title: string | null; + public body_html: string | null; + public handle: string | null; + public id: number | null; + public image: string | {[key: string]: unknown} | null; + public published: boolean | null; + public published_at: string | null; + public published_scope: string | null; + public sort_order: string | null; + public template_suffix: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/customer.ts b/rest/admin/2023-01/customer.ts new file mode 100644 index 000000000..421035032 --- /dev/null +++ b/rest/admin/2023-01/customer.ts @@ -0,0 +1,275 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Metafield} from './metafield'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + ids?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + limit?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; +} +interface OrdersArgs { + [key: string]: unknown; + session: Session; + id: number | string; + status?: unknown; +} +interface SearchArgs { + [key: string]: unknown; + session: Session; + order?: unknown; + query?: unknown; + limit?: unknown; + fields?: unknown; +} +interface AccountActivationUrlArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface SendInviteArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Customer extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'customer'; + protected static PLURAL_NAME = 'customers'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "metafield": Metafield + }; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "customers/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "customers/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "customers.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "customers/.json"}, + {"http_method": "get", "operation": "orders", "ids": ["id"], "path": "customers//orders.json"}, + {"http_method": "get", "operation": "search", "ids": [], "path": "customers/search.json"}, + {"http_method": "post", "operation": "account_activation_url", "ids": ["id"], "path": "customers//account_activation_url.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "customers.json"}, + {"http_method": "post", "operation": "send_invite", "ids": ["id"], "path": "customers//send_invite.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "customers/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ids = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + limit = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"ids": ids, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "limit": limit, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async orders( + { + session, + id, + status = null, + ...otherArgs + }: OrdersArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "orders", + session: session, + urlIds: {"id": id}, + params: {"status": status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async search( + { + session, + order = null, + query = null, + limit = null, + fields = null, + ...otherArgs + }: SearchArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "search", + session: session, + urlIds: {}, + params: {"order": order, "query": query, "limit": limit, "fields": fields, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async account_activation_url( + { + body = null, + ...otherArgs + }: AccountActivationUrlArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "account_activation_url", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async send_invite( + { + body = null, + ...otherArgs + }: SendInviteArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "send_invite", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public accepts_marketing: boolean | null; + public accepts_marketing_updated_at: string | null; + public addresses: {[key: string]: unknown}[] | null; + public created_at: string | null; + public currency: string | null; + public default_address: {[key: string]: unknown} | null; + public email: string | null; + public email_marketing_consent: {[key: string]: unknown} | null; + public first_name: string | null; + public id: number | null; + public last_name: string | null; + public last_order_id: number | null; + public last_order_name: string | null; + public marketing_opt_in_level: string | null; + public metafield: Metafield | null | {[key: string]: any}; + public multipass_identifier: string | null; + public note: string | null; + public orders_count: number | null; + public password: string | null; + public password_confirmation: string | null; + public phone: string | null; + public sms_marketing_consent: {[key: string]: unknown} | null; + public state: string | null; + public tags: string | null; + public tax_exempt: boolean | null; + public tax_exemptions: string[] | null; + public total_spent: string | null; + public updated_at: string | null; + public verified_email: boolean | null; +} diff --git a/rest/admin/2023-01/customer_address.ts b/rest/admin/2023-01/customer_address.ts new file mode 100644 index 000000000..2aac676fd --- /dev/null +++ b/rest/admin/2023-01/customer_address.ts @@ -0,0 +1,163 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + customer_id?: number | string | null; +} +interface DeleteArgs { + session: Session; + id: number | string; + customer_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + customer_id?: number | string | null; +} +interface DefaultArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface SetArgs { + [key: string]: unknown; + address_ids?: unknown[] | number | string | null; + operation?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class CustomerAddress extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'customer_address'; + protected static PLURAL_NAME = 'customer_addresses'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["customer_id", "id"], "path": "customers//addresses/.json"}, + {"http_method": "get", "operation": "get", "ids": ["customer_id"], "path": "customers//addresses.json"}, + {"http_method": "get", "operation": "get", "ids": ["customer_id", "id"], "path": "customers//addresses/.json"}, + {"http_method": "post", "operation": "post", "ids": ["customer_id"], "path": "customers//addresses.json"}, + {"http_method": "put", "operation": "default", "ids": ["customer_id", "id"], "path": "customers//addresses//default.json"}, + {"http_method": "put", "operation": "put", "ids": ["customer_id", "id"], "path": "customers//addresses/.json"}, + {"http_method": "put", "operation": "set", "ids": ["customer_id"], "path": "customers//addresses/set.json"} + ]; + + protected static getJsonBodyName(): string + { + return "address"; + } + + public static async find( + { + session, + id, + customer_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "customer_id": customer_id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id, + customer_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "customer_id": customer_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + customer_id = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"customer_id": customer_id}, + params: {...otherArgs}, + }); + + return response; + } + + public async default( + { + body = null, + ...otherArgs + }: DefaultArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "default", + session: this.session, + urlIds: {"id": this.id, "customer_id": this.customer_id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async set( + { + address_ids = null, + operation = null, + body = null, + ...otherArgs + }: SetArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "set", + session: this.session, + urlIds: {"customer_id": this.customer_id}, + params: {"address_ids": address_ids, "operation": operation, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public address1: string | null; + public address2: string | null; + public city: string | null; + public company: string | null; + public country: string | null; + public country_code: string | null; + public country_name: string | null; + public customer_id: number | null; + public first_name: string | null; + public id: number | null; + public last_name: string | null; + public name: string | null; + public phone: string | null; + public province: string | null; + public province_code: string | null; + public zip: string | null; +} diff --git a/rest/admin/2023-01/customer_saved_search.ts b/rest/admin/2023-01/customer_saved_search.ts new file mode 100644 index 000000000..4755757e1 --- /dev/null +++ b/rest/admin/2023-01/customer_saved_search.ts @@ -0,0 +1,155 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; +} +interface CustomersArgs { + [key: string]: unknown; + session: Session; + id: number | string; + order?: unknown; + limit?: unknown; + fields?: unknown; +} + +export class CustomerSavedSearch extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'customer_saved_search'; + protected static PLURAL_NAME = 'customer_saved_searches'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "customer_saved_searches/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "customer_saved_searches/count.json"}, + {"http_method": "get", "operation": "customers", "ids": ["id"], "path": "customer_saved_searches//customers.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "customer_saved_searches.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "customer_saved_searches/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "customer_saved_searches.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "customer_saved_searches/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + since_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"since_id": since_id, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async customers( + { + session, + id, + order = null, + limit = null, + fields = null, + ...otherArgs + }: CustomersArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "customers", + session: session, + urlIds: {"id": id}, + params: {"order": order, "limit": limit, "fields": fields, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public created_at: string | null; + public id: number | null; + public name: string | null; + public query: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/deprecated_api_call.ts b/rest/admin/2023-01/deprecated_api_call.ts new file mode 100644 index 000000000..3811c4617 --- /dev/null +++ b/rest/admin/2023-01/deprecated_api_call.ts @@ -0,0 +1,43 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class DeprecatedApiCall extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'deprecated_api_call'; + protected static PLURAL_NAME = 'deprecated_api_calls'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "deprecated_api_calls.json"} + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public data_updated_at: string | null; + public deprecated_api_calls: {[key: string]: unknown}[] | null; +} diff --git a/rest/admin/2023-01/discount_code.ts b/rest/admin/2023-01/discount_code.ts new file mode 100644 index 000000000..19642f9e0 --- /dev/null +++ b/rest/admin/2023-01/discount_code.ts @@ -0,0 +1,207 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + price_rule_id?: number | string | null; +} +interface DeleteArgs { + session: Session; + id: number | string; + price_rule_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + price_rule_id?: number | string | null; + batch_id?: number | string | null; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + times_used?: unknown; + times_used_min?: unknown; + times_used_max?: unknown; +} +interface GetAllArgs { + [key: string]: unknown; + session: Session; + price_rule_id?: number | string | null; + batch_id?: number | string | null; +} +interface LookupArgs { + [key: string]: unknown; + session: Session; + code?: unknown; +} +interface BatchArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class DiscountCode extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'discount_code'; + protected static PLURAL_NAME = 'discount_codes'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["price_rule_id", "id"], "path": "price_rules//discount_codes/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "discount_codes/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["price_rule_id", "batch_id"], "path": "price_rules//batch//discount_codes.json"}, + {"http_method": "get", "operation": "get", "ids": ["price_rule_id"], "path": "price_rules//discount_codes.json"}, + {"http_method": "get", "operation": "get", "ids": ["price_rule_id", "id"], "path": "price_rules//discount_codes/.json"}, + {"http_method": "get", "operation": "get_all", "ids": ["price_rule_id", "batch_id"], "path": "price_rules//batch/.json"}, + {"http_method": "get", "operation": "lookup", "ids": [], "path": "discount_codes/lookup.json"}, + {"http_method": "post", "operation": "batch", "ids": ["price_rule_id"], "path": "price_rules//batch.json"}, + {"http_method": "post", "operation": "post", "ids": ["price_rule_id"], "path": "price_rules//discount_codes.json"}, + {"http_method": "put", "operation": "put", "ids": ["price_rule_id", "id"], "path": "price_rules//discount_codes/.json"} + ]; + + public static async find( + { + session, + id, + price_rule_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "price_rule_id": price_rule_id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id, + price_rule_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "price_rule_id": price_rule_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + price_rule_id = null, + batch_id = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"price_rule_id": price_rule_id, "batch_id": batch_id}, + params: {...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + times_used = null, + times_used_min = null, + times_used_max = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"times_used": times_used, "times_used_min": times_used_min, "times_used_max": times_used_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async get_all( + { + session, + price_rule_id = null, + batch_id = null, + ...otherArgs + }: GetAllArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "get_all", + session: session, + urlIds: {"price_rule_id": price_rule_id, "batch_id": batch_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async lookup( + { + session, + code = null, + ...otherArgs + }: LookupArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "lookup", + session: session, + urlIds: {}, + params: {"code": code, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async batch( + { + body = null, + ...otherArgs + }: BatchArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "batch", + session: this.session, + urlIds: {"price_rule_id": this.price_rule_id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public code: string | null; + public created_at: string | null; + public id: number | null; + public price_rule_id: number | null; + public updated_at: string | null; + public usage_count: number | null; +} diff --git a/rest/admin/2023-01/dispute.ts b/rest/admin/2023-01/dispute.ts new file mode 100644 index 000000000..7ce5437dc --- /dev/null +++ b/rest/admin/2023-01/dispute.ts @@ -0,0 +1,79 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + last_id?: unknown; + status?: unknown; + initiated_at?: unknown; +} + +export class Dispute extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'dispute'; + protected static PLURAL_NAME = 'disputes'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shopify_payments/disputes.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "shopify_payments/disputes/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + since_id = null, + last_id = null, + status = null, + initiated_at = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "last_id": last_id, "status": status, "initiated_at": initiated_at, ...otherArgs}, + }); + + return response; + } + + public amount: string | null; + public currency: string | null; + public evidence_due_by: string | null; + public evidence_sent_on: string | null; + public finalized_on: string | null; + public id: number | null; + public network_reason_code: number | null; + public order_id: number | null; + public reason: string | null; + public status: string | null; + public type: string | null; +} diff --git a/rest/admin/2023-01/draft_order.ts b/rest/admin/2023-01/draft_order.ts new file mode 100644 index 000000000..fb7741b07 --- /dev/null +++ b/rest/admin/2023-01/draft_order.ts @@ -0,0 +1,217 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Customer} from './customer'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; + limit?: unknown; + since_id?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + ids?: unknown; + status?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + status?: unknown; + updated_at_max?: unknown; + updated_at_min?: unknown; +} +interface SendInvoiceArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface CompleteArgs { + [key: string]: unknown; + payment_gateway_id?: unknown; + payment_pending?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class DraftOrder extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'draft_order'; + protected static PLURAL_NAME = 'draft_orders'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "customer": Customer + }; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "draft_orders/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "draft_orders/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "draft_orders.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "draft_orders/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "draft_orders.json"}, + {"http_method": "post", "operation": "send_invoice", "ids": ["id"], "path": "draft_orders//send_invoice.json"}, + {"http_method": "put", "operation": "complete", "ids": ["id"], "path": "draft_orders//complete.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "draft_orders/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + fields = null, + limit = null, + since_id = null, + updated_at_min = null, + updated_at_max = null, + ids = null, + status = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, "limit": limit, "since_id": since_id, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "ids": ids, "status": status, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + since_id = null, + status = null, + updated_at_max = null, + updated_at_min = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"since_id": since_id, "status": status, "updated_at_max": updated_at_max, "updated_at_min": updated_at_min, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async send_invoice( + { + body = null, + ...otherArgs + }: SendInvoiceArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "send_invoice", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async complete( + { + payment_gateway_id = null, + payment_pending = null, + body = null, + ...otherArgs + }: CompleteArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "complete", + session: this.session, + urlIds: {"id": this.id}, + params: {"payment_gateway_id": payment_gateway_id, "payment_pending": payment_pending, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public applied_discount: {[key: string]: unknown} | null; + public billing_address: {[key: string]: unknown} | null; + public completed_at: string | null; + public created_at: string | null; + public currency: string | null; + public customer: Customer | null | {[key: string]: any}; + public email: string | null; + public id: number | null; + public invoice_sent_at: string | null; + public invoice_url: string | null; + public line_items: {[key: string]: unknown}[] | null; + public name: string | null; + public note: string | null; + public note_attributes: {[key: string]: unknown}[] | null; + public order_id: number | null; + public payment_terms: {[key: string]: unknown} | null; + public shipping_address: {[key: string]: unknown} | null; + public shipping_line: {[key: string]: unknown} | null; + public source_name: string | null; + public status: string | null; + public subtotal_price: number | null; + public tags: string | null; + public tax_exempt: boolean | null; + public tax_exemptions: string[] | null; + public tax_lines: {[key: string]: unknown}[] | null; + public taxes_included: boolean | null; + public total_price: string | null; + public total_tax: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/event.ts b/rest/admin/2023-01/event.ts new file mode 100644 index 000000000..e59401725 --- /dev/null +++ b/rest/admin/2023-01/event.ts @@ -0,0 +1,120 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + product_id?: number | string | null; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + filter?: unknown; + verb?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + created_at_min?: unknown; + created_at_max?: unknown; +} + +export class Event extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'event'; + protected static PLURAL_NAME = 'events'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": [], "path": "events/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "events.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "events/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//events.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//events.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + order_id = null, + product_id = null, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + filter = null, + verb = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id, "product_id": product_id}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "filter": filter, "verb": verb, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + created_at_min = null, + created_at_max = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public arguments: string | null; + public body: string | null; + public created_at: string | null; + public description: string | null; + public id: number | null; + public message: string | null; + public path: string | null; + public subject_id: number | null; + public subject_type: string | null; + public verb: string | null; +} diff --git a/rest/admin/2023-01/fulfillment.ts b/rest/admin/2023-01/fulfillment.ts new file mode 100644 index 000000000..5d8e5d998 --- /dev/null +++ b/rest/admin/2023-01/fulfillment.ts @@ -0,0 +1,187 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + fulfillment_order_id?: number | string | null; + order_id?: number | string | null; + created_at_max?: unknown; + created_at_min?: unknown; + fields?: unknown; + limit?: unknown; + since_id?: unknown; + updated_at_max?: unknown; + updated_at_min?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; +} +interface CancelArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface UpdateTrackingArgs { + [key: string]: unknown; + notify_customer?: unknown; + tracking_info?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Fulfillment extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'fulfillment'; + protected static PLURAL_NAME = 'fulfillments'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": ["order_id"], "path": "orders//fulfillments/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//fulfillments.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//fulfillments.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//fulfillments/.json"}, + {"http_method": "post", "operation": "cancel", "ids": ["id"], "path": "fulfillments//cancel.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "fulfillments.json"}, + {"http_method": "post", "operation": "update_tracking", "ids": ["id"], "path": "fulfillments//update_tracking.json"} + ]; + + public static async find( + { + session, + id, + order_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + fulfillment_order_id = null, + order_id = null, + created_at_max = null, + created_at_min = null, + fields = null, + limit = null, + since_id = null, + updated_at_max = null, + updated_at_min = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"fulfillment_order_id": fulfillment_order_id, "order_id": order_id}, + params: {"created_at_max": created_at_max, "created_at_min": created_at_min, "fields": fields, "limit": limit, "since_id": since_id, "updated_at_max": updated_at_max, "updated_at_min": updated_at_min, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + order_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"order_id": order_id}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async cancel( + { + body = null, + ...otherArgs + }: CancelArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "cancel", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async update_tracking( + { + notify_customer = null, + tracking_info = null, + body = null, + ...otherArgs + }: UpdateTrackingArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "update_tracking", + session: this.session, + urlIds: {"id": this.id}, + params: {"notify_customer": notify_customer, "tracking_info": tracking_info, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public created_at: string | null; + public id: number | null; + public line_items: {[key: string]: unknown}[] | null; + public location_id: number | null; + public name: string | null; + public notify_customer: boolean | null; + public order_id: number | null; + public origin_address: {[key: string]: unknown}[] | null; + public receipt: {[key: string]: unknown} | null; + public service: string | null; + public shipment_status: string | null; + public status: string | null; + public tracking_company: string | null; + public tracking_numbers: string[] | null; + public tracking_urls: string[] | null; + public updated_at: string | null; + public variant_inventory_management: string | null; +} diff --git a/rest/admin/2023-01/fulfillment_event.ts b/rest/admin/2023-01/fulfillment_event.ts new file mode 100644 index 000000000..7ad8ebf44 --- /dev/null +++ b/rest/admin/2023-01/fulfillment_event.ts @@ -0,0 +1,125 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Country} from './country'; +import {Province} from './province'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fulfillment_id?: number | string | null; + event_id?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fulfillment_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + fulfillment_id?: number | string | null; +} + +export class FulfillmentEvent extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'fulfillment_event'; + protected static PLURAL_NAME = 'fulfillment_events'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "country": Country, + "province": Province + }; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["order_id", "fulfillment_id", "id"], "path": "orders//fulfillments//events/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "fulfillment_id"], "path": "orders//fulfillments//events.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "fulfillment_id", "id"], "path": "orders//fulfillments//events/.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id", "fulfillment_id"], "path": "orders//fulfillments//events.json"} + ]; + + protected static getJsonBodyName(): string + { + return "event"; + } + + public static async find( + { + session, + id, + order_id = null, + fulfillment_id = null, + event_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id, "fulfillment_id": fulfillment_id}, + params: {"event_id": event_id}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id, + order_id = null, + fulfillment_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "order_id": order_id, "fulfillment_id": fulfillment_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + order_id = null, + fulfillment_id = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id, "fulfillment_id": fulfillment_id}, + params: {...otherArgs}, + }); + + return response; + } + + public address1: string | null; + public city: string | null; + public country: Country | null | {[key: string]: any}; + public created_at: string | null; + public estimated_delivery_at: string | null; + public fulfillment_id: number | null; + public happened_at: string | null; + public id: number | null; + public latitude: number | null; + public longitude: number | null; + public message: string | null; + public order_id: number | null; + public province: Province | null | {[key: string]: any}; + public shop_id: number | null; + public status: string | null; + public updated_at: string | null; + public zip: string | null; +} diff --git a/rest/admin/2023-01/fulfillment_order.ts b/rest/admin/2023-01/fulfillment_order.ts new file mode 100644 index 000000000..2537b49df --- /dev/null +++ b/rest/admin/2023-01/fulfillment_order.ts @@ -0,0 +1,286 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; +} +interface CancelArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface CloseArgs { + [key: string]: unknown; + message?: unknown; + body?: {[key: string]: unknown} | null; +} +interface HoldArgs { + [key: string]: unknown; + reason?: unknown; + reason_notes?: unknown; + notify_merchant?: unknown; + body?: {[key: string]: unknown} | null; +} +interface MoveArgs { + [key: string]: unknown; + fulfillment_order?: unknown; + body?: {[key: string]: unknown} | null; +} +interface OpenArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface ReleaseHoldArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface RescheduleArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface SetFulfillmentOrdersDeadlineArgs { + [key: string]: unknown; + fulfillment_order_ids?: unknown; + fulfillment_deadline?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class FulfillmentOrder extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'fulfillment_order'; + protected static PLURAL_NAME = 'fulfillment_orders'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "fulfillment_orders/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//fulfillment_orders.json"}, + {"http_method": "post", "operation": "cancel", "ids": ["id"], "path": "fulfillment_orders//cancel.json"}, + {"http_method": "post", "operation": "close", "ids": ["id"], "path": "fulfillment_orders//close.json"}, + {"http_method": "post", "operation": "hold", "ids": ["id"], "path": "fulfillment_orders//hold.json"}, + {"http_method": "post", "operation": "move", "ids": ["id"], "path": "fulfillment_orders//move.json"}, + {"http_method": "post", "operation": "open", "ids": ["id"], "path": "fulfillment_orders//open.json"}, + {"http_method": "post", "operation": "release_hold", "ids": ["id"], "path": "fulfillment_orders//release_hold.json"}, + {"http_method": "post", "operation": "reschedule", "ids": ["id"], "path": "fulfillment_orders//reschedule.json"}, + {"http_method": "post", "operation": "set_fulfillment_orders_deadline", "ids": [], "path": "fulfillment_orders/set_fulfillment_orders_deadline.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + order_id = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id}, + params: {...otherArgs}, + }); + + return response; + } + + public async cancel( + { + body = null, + ...otherArgs + }: CancelArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "cancel", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async close( + { + message = null, + body = null, + ...otherArgs + }: CloseArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "close", + session: this.session, + urlIds: {"id": this.id}, + params: {"message": message, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async hold( + { + reason = null, + reason_notes = null, + notify_merchant = null, + body = null, + ...otherArgs + }: HoldArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "hold", + session: this.session, + urlIds: {"id": this.id}, + params: {"reason": reason, "reason_notes": reason_notes, "notify_merchant": notify_merchant, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async move( + { + fulfillment_order = null, + body = null, + ...otherArgs + }: MoveArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "move", + session: this.session, + urlIds: {"id": this.id}, + params: {"fulfillment_order": fulfillment_order, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async open( + { + body = null, + ...otherArgs + }: OpenArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "open", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async release_hold( + { + body = null, + ...otherArgs + }: ReleaseHoldArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "release_hold", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async reschedule( + { + body = null, + ...otherArgs + }: RescheduleArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "reschedule", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async set_fulfillment_orders_deadline( + { + fulfillment_order_ids = null, + fulfillment_deadline = null, + body = null, + ...otherArgs + }: SetFulfillmentOrdersDeadlineArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "set_fulfillment_orders_deadline", + session: this.session, + urlIds: {}, + params: {"fulfillment_order_ids": fulfillment_order_ids, "fulfillment_deadline": fulfillment_deadline, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public assigned_location: {[key: string]: unknown} | null; + public assigned_location_id: number | null; + public created_at: string | null; + public delivery_method: {[key: string]: unknown} | null; + public destination: {[key: string]: unknown} | null; + public fulfill_at: string | null; + public fulfill_by: string | null; + public fulfillment_holds: {[key: string]: unknown}[] | null; + public id: number | null; + public international_duties: {[key: string]: unknown} | null; + public line_items: {[key: string]: unknown}[] | null; + public merchant_requests: {[key: string]: unknown}[] | null; + public order_id: number | null; + public request_status: string | null; + public shop_id: number | null; + public status: string | null; + public supported_actions: string[] | null; + public updated_at: {[key: string]: unknown} | null; +} diff --git a/rest/admin/2023-01/fulfillment_request.ts b/rest/admin/2023-01/fulfillment_request.ts new file mode 100644 index 000000000..cdfccfce4 --- /dev/null +++ b/rest/admin/2023-01/fulfillment_request.ts @@ -0,0 +1,78 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {ApiVersion} from '../../../lib/types'; + +interface AcceptArgs { + [key: string]: unknown; + message?: unknown; + body?: {[key: string]: unknown} | null; +} +interface RejectArgs { + [key: string]: unknown; + message?: unknown; + reason?: unknown; + line_items?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class FulfillmentRequest extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'fulfillment_request'; + protected static PLURAL_NAME = 'fulfillment_requests'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "post", "operation": "accept", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//fulfillment_request/accept.json"}, + {"http_method": "post", "operation": "post", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//fulfillment_request.json"}, + {"http_method": "post", "operation": "reject", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//fulfillment_request/reject.json"} + ]; + + public async accept( + { + message = null, + body = null, + ...otherArgs + }: AcceptArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "accept", + session: this.session, + urlIds: {"fulfillment_order_id": this.fulfillment_order_id}, + params: {"message": message, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async reject( + { + message = null, + reason = null, + line_items = null, + body = null, + ...otherArgs + }: RejectArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "reject", + session: this.session, + urlIds: {"fulfillment_order_id": this.fulfillment_order_id}, + params: {"message": message, "reason": reason, "line_items": line_items, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public fulfillment_order_id: number | null; +} diff --git a/rest/admin/2023-01/fulfillment_service.ts b/rest/admin/2023-01/fulfillment_service.ts new file mode 100644 index 000000000..92b0b6bc7 --- /dev/null +++ b/rest/admin/2023-01/fulfillment_service.ts @@ -0,0 +1,98 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + scope?: unknown; +} + +export class FulfillmentService extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'fulfillment_service'; + protected static PLURAL_NAME = 'fulfillment_services'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "fulfillment_services/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "fulfillment_services.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "fulfillment_services/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "fulfillment_services.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "fulfillment_services/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + scope = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"scope": scope, ...otherArgs}, + }); + + return response; + } + + public admin_graphql_api_id: string | null; + public callback_url: string | null; + public fulfillment_orders_opt_in: boolean | null; + public handle: string | null; + public id: number | null; + public inventory_management: boolean | null; + public location_id: number | null; + public name: string | null; + public permits_sku_sharing: boolean | null; + public provider_id: string | null; + public requires_shipping_method: boolean | null; + public tracking_support: boolean | null; +} diff --git a/rest/admin/2023-01/gift_card.ts b/rest/admin/2023-01/gift_card.ts new file mode 100644 index 000000000..9153c99e1 --- /dev/null +++ b/rest/admin/2023-01/gift_card.ts @@ -0,0 +1,177 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + status?: unknown; + limit?: unknown; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + status?: unknown; +} +interface SearchArgs { + [key: string]: unknown; + session: Session; + order?: unknown; + query?: unknown; + limit?: unknown; + fields?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; +} +interface DisableArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class GiftCard extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'gift_card'; + protected static PLURAL_NAME = 'gift_cards'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": [], "path": "gift_cards/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "gift_cards.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "gift_cards/.json"}, + {"http_method": "get", "operation": "search", "ids": [], "path": "gift_cards/search.json"}, + {"http_method": "post", "operation": "disable", "ids": ["id"], "path": "gift_cards//disable.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "gift_cards.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "gift_cards/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + status = null, + limit = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"status": status, "limit": limit, "since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"status": status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async search( + { + session, + order = null, + query = null, + limit = null, + fields = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + ...otherArgs + }: SearchArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "search", + session: session, + urlIds: {}, + params: {"order": order, "query": query, "limit": limit, "fields": fields, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async disable( + { + body = null, + ...otherArgs + }: DisableArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "disable", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public api_client_id: number | null; + public balance: number | null; + public code: string | null; + public created_at: string | null; + public currency: string | null; + public customer_id: number | null; + public disabled_at: string | null; + public expires_on: string | null; + public id: number | null; + public initial_value: number | null; + public last_characters: string | null; + public line_item_id: number | null; + public note: string | null; + public order_id: number | null; + public template_suffix: string | null; + public updated_at: string | null; + public user_id: number | null; +} diff --git a/rest/admin/2023-01/gift_card_adjustment.ts b/rest/admin/2023-01/gift_card_adjustment.ts new file mode 100644 index 000000000..bb77e9750 --- /dev/null +++ b/rest/admin/2023-01/gift_card_adjustment.ts @@ -0,0 +1,82 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + gift_card_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + gift_card_id?: number | string | null; +} + +export class GiftCardAdjustment extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'gift_card_adjustment'; + protected static PLURAL_NAME = 'gift_card_adjustments'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["gift_card_id"], "path": "gift_cards//adjustments.json"}, + {"http_method": "get", "operation": "get", "ids": ["gift_card_id", "id"], "path": "gift_cards//adjustments/.json"}, + {"http_method": "post", "operation": "post", "ids": ["gift_card_id"], "path": "gift_cards//adjustments.json"} + ]; + + protected static getJsonBodyName(): string + { + return "adjustment"; + } + + public static async find( + { + session, + id, + gift_card_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "gift_card_id": gift_card_id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + gift_card_id = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"gift_card_id": gift_card_id}, + params: {...otherArgs}, + }); + + return response; + } + + public amount: number | null; + public api_client_id: number | null; + public created_at: string | null; + public gift_card_id: number | null; + public id: number | null; + public note: string | null; + public number: number | null; + public order_transaction_id: number | null; + public processed_at: string | null; + public remote_transaction_ref: string | null; + public remote_transaction_url: string | null; + public user_id: number | null; +} diff --git a/rest/admin/2023-01/image.ts b/rest/admin/2023-01/image.ts new file mode 100644 index 000000000..848d2a4cf --- /dev/null +++ b/rest/admin/2023-01/image.ts @@ -0,0 +1,133 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + product_id?: number | string | null; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + product_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; + since_id?: unknown; +} + +export class Image extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'image'; + protected static PLURAL_NAME = 'images'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["product_id", "id"], "path": "products//images/.json"}, + {"http_method": "get", "operation": "count", "ids": ["product_id"], "path": "products//images/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//images.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id", "id"], "path": "products//images/.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_id"], "path": "products//images.json"}, + {"http_method": "put", "operation": "put", "ids": ["product_id", "id"], "path": "products//images/.json"} + ]; + + public static async find( + { + session, + id, + product_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "product_id": product_id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id, + product_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "product_id": product_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + product_id = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"product_id": product_id}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + product_id = null, + since_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"product_id": product_id}, + params: {"since_id": since_id, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public created_at: string | null; + public height: number | null; + public id: number | null; + public position: number | null; + public product_id: number | null; + public src: string | null; + public updated_at: string | null; + public variant_ids: number[] | null; + public width: number | null; +} diff --git a/rest/admin/2023-01/index.ts b/rest/admin/2023-01/index.ts new file mode 100644 index 000000000..b06f0f619 --- /dev/null +++ b/rest/admin/2023-01/index.ts @@ -0,0 +1,231 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {ShopifyRestResources} from '../../types'; + +import {AbandonedCheckout} from './abandoned_checkout'; +import {AccessScope} from './access_scope'; +import {ApplePayCertificate} from './apple_pay_certificate'; +import {ApplicationCharge} from './application_charge'; +import {ApplicationCredit} from './application_credit'; +import {Article} from './article'; +import {Asset} from './asset'; +import {AssignedFulfillmentOrder} from './assigned_fulfillment_order'; +import {Balance} from './balance'; +import {Blog} from './blog'; +import {CancellationRequest} from './cancellation_request'; +import {CarrierService} from './carrier_service'; +import {Checkout} from './checkout'; +import {Collect} from './collect'; +import {Collection} from './collection'; +import {CollectionListing} from './collection_listing'; +import {Comment} from './comment'; +import {Country} from './country'; +import {Currency} from './currency'; +import {CustomCollection} from './custom_collection'; +import {Customer} from './customer'; +import {CustomerAddress} from './customer_address'; +import {CustomerSavedSearch} from './customer_saved_search'; +import {DeprecatedApiCall} from './deprecated_api_call'; +import {DiscountCode} from './discount_code'; +import {Dispute} from './dispute'; +import {DraftOrder} from './draft_order'; +import {Event} from './event'; +import {Fulfillment} from './fulfillment'; +import {FulfillmentEvent} from './fulfillment_event'; +import {FulfillmentOrder} from './fulfillment_order'; +import {FulfillmentRequest} from './fulfillment_request'; +import {FulfillmentService} from './fulfillment_service'; +import {GiftCard} from './gift_card'; +import {GiftCardAdjustment} from './gift_card_adjustment'; +import {Image} from './image'; +import {InventoryItem} from './inventory_item'; +import {InventoryLevel} from './inventory_level'; +import {Location} from './location'; +import {LocationsForMove} from './locations_for_move'; +import {MarketingEvent} from './marketing_event'; +import {Metafield} from './metafield'; +import {MobilePlatformApplication} from './mobile_platform_application'; +import {Order} from './order'; +import {OrderRisk} from './order_risk'; +import {Page} from './page'; +import {Payment} from './payment'; +import {PaymentGateway} from './payment_gateway'; +import {PaymentTransaction} from './payment_transaction'; +import {Payout} from './payout'; +import {Policy} from './policy'; +import {PriceRule} from './price_rule'; +import {Product} from './product'; +import {ProductListing} from './product_listing'; +import {ProductResourceFeedback} from './product_resource_feedback'; +import {Province} from './province'; +import {RecurringApplicationCharge} from './recurring_application_charge'; +import {Redirect} from './redirect'; +import {Refund} from './refund'; +import {Report} from './report'; +import {ResourceFeedback} from './resource_feedback'; +import {ScriptTag} from './script_tag'; +import {ShippingZone} from './shipping_zone'; +import {Shop} from './shop'; +import {SmartCollection} from './smart_collection'; +import {StorefrontAccessToken} from './storefront_access_token'; +import {TenderTransaction} from './tender_transaction'; +import {Theme} from './theme'; +import {Transaction} from './transaction'; +import {UsageCharge} from './usage_charge'; +import {User} from './user'; +import {Variant} from './variant'; +import {Webhook} from './webhook'; + +export interface RestResources extends ShopifyRestResources { + AbandonedCheckout: typeof AbandonedCheckout; + AccessScope: typeof AccessScope; + ApplePayCertificate: typeof ApplePayCertificate; + ApplicationCharge: typeof ApplicationCharge; + ApplicationCredit: typeof ApplicationCredit; + Article: typeof Article; + Asset: typeof Asset; + AssignedFulfillmentOrder: typeof AssignedFulfillmentOrder; + Balance: typeof Balance; + Blog: typeof Blog; + CancellationRequest: typeof CancellationRequest; + CarrierService: typeof CarrierService; + Checkout: typeof Checkout; + Collect: typeof Collect; + Collection: typeof Collection; + CollectionListing: typeof CollectionListing; + Comment: typeof Comment; + Country: typeof Country; + Currency: typeof Currency; + CustomCollection: typeof CustomCollection; + Customer: typeof Customer; + CustomerAddress: typeof CustomerAddress; + CustomerSavedSearch: typeof CustomerSavedSearch; + DeprecatedApiCall: typeof DeprecatedApiCall; + DiscountCode: typeof DiscountCode; + Dispute: typeof Dispute; + DraftOrder: typeof DraftOrder; + Event: typeof Event; + Fulfillment: typeof Fulfillment; + FulfillmentEvent: typeof FulfillmentEvent; + FulfillmentOrder: typeof FulfillmentOrder; + FulfillmentRequest: typeof FulfillmentRequest; + FulfillmentService: typeof FulfillmentService; + GiftCard: typeof GiftCard; + GiftCardAdjustment: typeof GiftCardAdjustment; + Image: typeof Image; + InventoryItem: typeof InventoryItem; + InventoryLevel: typeof InventoryLevel; + Location: typeof Location; + LocationsForMove: typeof LocationsForMove; + MarketingEvent: typeof MarketingEvent; + Metafield: typeof Metafield; + MobilePlatformApplication: typeof MobilePlatformApplication; + Order: typeof Order; + OrderRisk: typeof OrderRisk; + Page: typeof Page; + Payment: typeof Payment; + PaymentGateway: typeof PaymentGateway; + PaymentTransaction: typeof PaymentTransaction; + Payout: typeof Payout; + Policy: typeof Policy; + PriceRule: typeof PriceRule; + Product: typeof Product; + ProductListing: typeof ProductListing; + ProductResourceFeedback: typeof ProductResourceFeedback; + Province: typeof Province; + RecurringApplicationCharge: typeof RecurringApplicationCharge; + Redirect: typeof Redirect; + Refund: typeof Refund; + Report: typeof Report; + ResourceFeedback: typeof ResourceFeedback; + ScriptTag: typeof ScriptTag; + ShippingZone: typeof ShippingZone; + Shop: typeof Shop; + SmartCollection: typeof SmartCollection; + StorefrontAccessToken: typeof StorefrontAccessToken; + TenderTransaction: typeof TenderTransaction; + Theme: typeof Theme; + Transaction: typeof Transaction; + UsageCharge: typeof UsageCharge; + User: typeof User; + Variant: typeof Variant; + Webhook: typeof Webhook; +} + +export const restResources: RestResources = { + AbandonedCheckout, + AccessScope, + ApplePayCertificate, + ApplicationCharge, + ApplicationCredit, + Article, + Asset, + AssignedFulfillmentOrder, + Balance, + Blog, + CancellationRequest, + CarrierService, + Checkout, + Collect, + Collection, + CollectionListing, + Comment, + Country, + Currency, + CustomCollection, + Customer, + CustomerAddress, + CustomerSavedSearch, + DeprecatedApiCall, + DiscountCode, + Dispute, + DraftOrder, + Event, + Fulfillment, + FulfillmentEvent, + FulfillmentOrder, + FulfillmentRequest, + FulfillmentService, + GiftCard, + GiftCardAdjustment, + Image, + InventoryItem, + InventoryLevel, + Location, + LocationsForMove, + MarketingEvent, + Metafield, + MobilePlatformApplication, + Order, + OrderRisk, + Page, + Payment, + PaymentGateway, + PaymentTransaction, + Payout, + Policy, + PriceRule, + Product, + ProductListing, + ProductResourceFeedback, + Province, + RecurringApplicationCharge, + Redirect, + Refund, + Report, + ResourceFeedback, + ScriptTag, + ShippingZone, + Shop, + SmartCollection, + StorefrontAccessToken, + TenderTransaction, + Theme, + Transaction, + UsageCharge, + User, + Variant, + Webhook, +}; \ No newline at end of file diff --git a/rest/admin/2023-01/inventory_item.ts b/rest/admin/2023-01/inventory_item.ts new file mode 100644 index 000000000..87ff34357 --- /dev/null +++ b/rest/admin/2023-01/inventory_item.ts @@ -0,0 +1,76 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + ids?: unknown; + limit?: unknown; +} + +export class InventoryItem extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'inventory_item'; + protected static PLURAL_NAME = 'inventory_items'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "inventory_items.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "inventory_items/.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "inventory_items/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + ids = null, + limit = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"ids": ids, "limit": limit, ...otherArgs}, + }); + + return response; + } + + public cost: string | null; + public country_code_of_origin: string | null; + public country_harmonized_system_codes: {[key: string]: unknown}[] | null; + public created_at: string | null; + public harmonized_system_code: number | null; + public id: number | null; + public province_code_of_origin: string | null; + public requires_shipping: boolean | null; + public sku: string | null; + public tracked: boolean | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/inventory_level.ts b/rest/admin/2023-01/inventory_level.ts new file mode 100644 index 000000000..5bfba210d --- /dev/null +++ b/rest/admin/2023-01/inventory_level.ts @@ -0,0 +1,169 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface DeleteArgs { + session: Session; + inventory_item_id?: unknown; + location_id?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + inventory_item_ids?: unknown; + location_ids?: unknown; + limit?: unknown; + updated_at_min?: unknown; +} +interface AdjustArgs { + [key: string]: unknown; + inventory_item_id?: unknown; + location_id?: unknown; + available_adjustment?: unknown; + body?: {[key: string]: unknown} | null; +} +interface ConnectArgs { + [key: string]: unknown; + inventory_item_id?: unknown; + location_id?: unknown; + relocate_if_necessary?: unknown; + body?: {[key: string]: unknown} | null; +} +interface SetArgs { + [key: string]: unknown; + inventory_item_id?: unknown; + location_id?: unknown; + available?: unknown; + disconnect_if_necessary?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class InventoryLevel extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'inventory_level'; + protected static PLURAL_NAME = 'inventory_levels'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": [], "path": "inventory_levels.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "inventory_levels.json"}, + {"http_method": "post", "operation": "adjust", "ids": [], "path": "inventory_levels/adjust.json"}, + {"http_method": "post", "operation": "connect", "ids": [], "path": "inventory_levels/connect.json"}, + {"http_method": "post", "operation": "set", "ids": [], "path": "inventory_levels/set.json"} + ]; + + public static async delete( + { + session, + inventory_item_id = null, + location_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {}, + params: {"inventory_item_id": inventory_item_id, "location_id": location_id}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + inventory_item_ids = null, + location_ids = null, + limit = null, + updated_at_min = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"inventory_item_ids": inventory_item_ids, "location_ids": location_ids, "limit": limit, "updated_at_min": updated_at_min, ...otherArgs}, + }); + + return response; + } + + public async adjust( + { + inventory_item_id = null, + location_id = null, + available_adjustment = null, + body = null, + ...otherArgs + }: AdjustArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "adjust", + session: this.session, + urlIds: {}, + params: {"inventory_item_id": inventory_item_id, "location_id": location_id, "available_adjustment": available_adjustment, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async connect( + { + inventory_item_id = null, + location_id = null, + relocate_if_necessary = null, + body = null, + ...otherArgs + }: ConnectArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "connect", + session: this.session, + urlIds: {}, + params: {"inventory_item_id": inventory_item_id, "location_id": location_id, "relocate_if_necessary": relocate_if_necessary, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async set( + { + inventory_item_id = null, + location_id = null, + available = null, + disconnect_if_necessary = null, + body = null, + ...otherArgs + }: SetArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "set", + session: this.session, + urlIds: {}, + params: {"inventory_item_id": inventory_item_id, "location_id": location_id, "available": available, "disconnect_if_necessary": disconnect_if_necessary, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public available: number | null; + public inventory_item_id: number | null; + public location_id: number | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/location.ts b/rest/admin/2023-01/location.ts new file mode 100644 index 000000000..b17bdbf25 --- /dev/null +++ b/rest/admin/2023-01/location.ts @@ -0,0 +1,127 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} +interface InventoryLevelsArgs { + [key: string]: unknown; + session: Session; + id: number | string; +} + +export class Location extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'location'; + protected static PLURAL_NAME = 'locations'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": [], "path": "locations/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "locations.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "locations/.json"}, + {"http_method": "get", "operation": "inventory_levels", "ids": ["id"], "path": "locations//inventory_levels.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async inventory_levels( + { + session, + id, + ...otherArgs + }: InventoryLevelsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "inventory_levels", + session: session, + urlIds: {"id": id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public active: boolean | null; + public address1: string | null; + public address2: string | null; + public city: string | null; + public country: string | null; + public country_code: string | null; + public created_at: string | null; + public id: number | null; + public legacy: boolean | null; + public localized_country_name: string | null; + public localized_province_name: string | null; + public name: string | null; + public phone: string | null; + public province: string | null; + public province_code: string | null; + public updated_at: string | null; + public zip: string | null; +} diff --git a/rest/admin/2023-01/locations_for_move.ts b/rest/admin/2023-01/locations_for_move.ts new file mode 100644 index 000000000..2afc51395 --- /dev/null +++ b/rest/admin/2023-01/locations_for_move.ts @@ -0,0 +1,44 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + fulfillment_order_id?: number | string | null; +} + +export class LocationsForMove extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'locations_for_move'; + protected static PLURAL_NAME = 'locations_for_moves'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["fulfillment_order_id"], "path": "fulfillment_orders//locations_for_move.json"} + ]; + + public static async all( + { + session, + fulfillment_order_id = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"fulfillment_order_id": fulfillment_order_id}, + params: {...otherArgs}, + }); + + return response; + } + + public locations_for_move: {[key: string]: unknown}[] | null; +} diff --git a/rest/admin/2023-01/marketing_event.ts b/rest/admin/2023-01/marketing_event.ts new file mode 100644 index 000000000..fbc032c87 --- /dev/null +++ b/rest/admin/2023-01/marketing_event.ts @@ -0,0 +1,171 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + offset?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} +interface EngagementsArgs { + [key: string]: unknown; + occurred_on?: unknown; + impressions_count?: unknown; + views_count?: unknown; + clicks_count?: unknown; + shares_count?: unknown; + favorites_count?: unknown; + comments_count?: unknown; + ad_spend?: unknown; + is_cumulative?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class MarketingEvent extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'marketing_event'; + protected static PLURAL_NAME = 'marketing_events'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "marketing_events/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "marketing_events/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "marketing_events.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "marketing_events/.json"}, + {"http_method": "post", "operation": "engagements", "ids": ["id"], "path": "marketing_events//engagements.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "marketing_events.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "marketing_events/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + offset = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "offset": offset, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async engagements( + { + occurred_on = null, + impressions_count = null, + views_count = null, + clicks_count = null, + shares_count = null, + favorites_count = null, + comments_count = null, + ad_spend = null, + is_cumulative = null, + body = null, + ...otherArgs + }: EngagementsArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "engagements", + session: this.session, + urlIds: {"id": this.id}, + params: {"occurred_on": occurred_on, "impressions_count": impressions_count, "views_count": views_count, "clicks_count": clicks_count, "shares_count": shares_count, "favorites_count": favorites_count, "comments_count": comments_count, "ad_spend": ad_spend, "is_cumulative": is_cumulative, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public event_type: string | null; + public marketing_channel: string | null; + public paid: boolean | null; + public started_at: string | null; + public UTM_parameters: {[key: string]: unknown} | null; + public budget: string | null; + public budget_type: string | null; + public currency: string | null; + public description: string | null; + public ended_at: string | null; + public id: number | null; + public manage_url: string | null; + public marketed_resources: {[key: string]: unknown}[] | null; + public preview_url: string | null; + public referring_domain: string | null; + public remote_id: string | null; + public scheduled_to_end_at: string | null; +} diff --git a/rest/admin/2023-01/metafield.ts b/rest/admin/2023-01/metafield.ts new file mode 100644 index 000000000..a8c52e71d --- /dev/null +++ b/rest/admin/2023-01/metafield.ts @@ -0,0 +1,298 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + article_id?: number | string | null; + blog_id?: number | string | null; + collection_id?: number | string | null; + customer_id?: number | string | null; + draft_order_id?: number | string | null; + order_id?: number | string | null; + page_id?: number | string | null; + product_image_id?: number | string | null; + product_id?: number | string | null; + variant_id?: number | string | null; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + article_id?: number | string | null; + blog_id?: number | string | null; + collection_id?: number | string | null; + customer_id?: number | string | null; + draft_order_id?: number | string | null; + order_id?: number | string | null; + page_id?: number | string | null; + product_image_id?: number | string | null; + product_id?: number | string | null; + variant_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + article_id?: number | string | null; + blog_id?: number | string | null; + collection_id?: number | string | null; + customer_id?: number | string | null; + draft_order_id?: number | string | null; + order_id?: number | string | null; + page_id?: number | string | null; + product_image_id?: number | string | null; + product_id?: number | string | null; + variant_id?: number | string | null; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + namespace?: unknown; + key?: unknown; + type?: unknown; + fields?: unknown; + metafield?: {[key: string]: unknown} | null; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + article_id?: number | string | null; + blog_id?: number | string | null; + collection_id?: number | string | null; + customer_id?: number | string | null; + draft_order_id?: number | string | null; + order_id?: number | string | null; + page_id?: number | string | null; + product_image_id?: number | string | null; + product_id?: number | string | null; + variant_id?: number | string | null; +} + +export class Metafield extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'metafield'; + protected static PLURAL_NAME = 'metafields'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["order_id", "id"], "path": "orders//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["page_id", "id"], "path": "pages//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, + {"http_method": "delete", "operation": "delete", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, + {"http_method": "get", "operation": "count", "ids": ["article_id"], "path": "articles//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["blog_id"], "path": "blogs//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["collection_id"], "path": "collections//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["customer_id"], "path": "customers//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["draft_order_id"], "path": "draft_orders//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["order_id"], "path": "orders//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["page_id"], "path": "pages//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["product_image_id"], "path": "product_images//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["product_id"], "path": "products//metafields/count.json"}, + {"http_method": "get", "operation": "count", "ids": ["variant_id"], "path": "variants//metafields/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["article_id"], "path": "articles//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["collection_id"], "path": "collections//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["customer_id"], "path": "customers//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["draft_order_id"], "path": "draft_orders//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["page_id"], "path": "pages//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["page_id", "id"], "path": "pages//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_image_id"], "path": "product_images//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, + {"http_method": "get", "operation": "get", "ids": ["variant_id"], "path": "variants//metafields.json"}, + {"http_method": "get", "operation": "get", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"}, + {"http_method": "post", "operation": "post", "ids": ["article_id"], "path": "articles//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["blog_id"], "path": "blogs//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["collection_id"], "path": "collections//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["customer_id"], "path": "customers//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["draft_order_id"], "path": "draft_orders//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id"], "path": "orders//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["page_id"], "path": "pages//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_image_id"], "path": "product_images//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_id"], "path": "products//metafields.json"}, + {"http_method": "post", "operation": "post", "ids": ["variant_id"], "path": "variants//metafields.json"}, + {"http_method": "put", "operation": "put", "ids": ["article_id", "id"], "path": "articles//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["blog_id", "id"], "path": "blogs//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["collection_id", "id"], "path": "collections//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["customer_id", "id"], "path": "customers//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["draft_order_id", "id"], "path": "draft_orders//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["order_id", "id"], "path": "orders//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["page_id", "id"], "path": "pages//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["product_image_id", "id"], "path": "product_images//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["product_id", "id"], "path": "products//metafields/.json"}, + {"http_method": "put", "operation": "put", "ids": ["variant_id", "id"], "path": "variants//metafields/.json"} + ]; + + public static async find( + { + session, + id, + article_id = null, + blog_id = null, + collection_id = null, + customer_id = null, + draft_order_id = null, + order_id = null, + page_id = null, + product_image_id = null, + product_id = null, + variant_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "article_id": article_id, "blog_id": blog_id, "collection_id": collection_id, "customer_id": customer_id, "draft_order_id": draft_order_id, "order_id": order_id, "page_id": page_id, "product_image_id": product_image_id, "product_id": product_id, "variant_id": variant_id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id, + article_id = null, + blog_id = null, + collection_id = null, + customer_id = null, + draft_order_id = null, + order_id = null, + page_id = null, + product_image_id = null, + product_id = null, + variant_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "article_id": article_id, "blog_id": blog_id, "collection_id": collection_id, "customer_id": customer_id, "draft_order_id": draft_order_id, "order_id": order_id, "page_id": page_id, "product_image_id": product_image_id, "product_id": product_id, "variant_id": variant_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + article_id = null, + blog_id = null, + collection_id = null, + customer_id = null, + draft_order_id = null, + order_id = null, + page_id = null, + product_image_id = null, + product_id = null, + variant_id = null, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + namespace = null, + key = null, + type = null, + fields = null, + metafield = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"article_id": article_id, "blog_id": blog_id, "collection_id": collection_id, "customer_id": customer_id, "draft_order_id": draft_order_id, "order_id": order_id, "page_id": page_id, "product_image_id": product_image_id, "product_id": product_id, "variant_id": variant_id}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "namespace": namespace, "key": key, "type": type, "fields": fields, "metafield": metafield, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + article_id = null, + blog_id = null, + collection_id = null, + customer_id = null, + draft_order_id = null, + order_id = null, + page_id = null, + product_image_id = null, + product_id = null, + variant_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"article_id": article_id, "blog_id": blog_id, "collection_id": collection_id, "customer_id": customer_id, "draft_order_id": draft_order_id, "order_id": order_id, "page_id": page_id, "product_image_id": product_image_id, "product_id": product_id, "variant_id": variant_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public key: string | null; + public namespace: string | null; + public value: string | number | number | null; + public article_id: number | null; + public blog_id: number | null; + public collection_id: number | null; + public created_at: string | null; + public customer_id: number | null; + public description: string | null; + public draft_order_id: number | null; + public id: number | null; + public order_id: number | null; + public owner_id: number | null; + public owner_resource: string | null; + public page_id: number | null; + public product_id: number | null; + public product_image_id: number | null; + public type: string | null; + public updated_at: string | null; + public variant_id: number | null; +} diff --git a/rest/admin/2023-01/mobile_platform_application.ts b/rest/admin/2023-01/mobile_platform_application.ts new file mode 100644 index 000000000..560654ac0 --- /dev/null +++ b/rest/admin/2023-01/mobile_platform_application.ts @@ -0,0 +1,90 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class MobilePlatformApplication extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'mobile_platform_application'; + protected static PLURAL_NAME = 'mobile_platform_applications'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "mobile_platform_applications/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "mobile_platform_applications.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "mobile_platform_applications/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "mobile_platform_applications.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "mobile_platform_applications/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public application_id: string | null; + public enabled_shared_webcredentials: boolean | null; + public enabled_universal_or_app_links: boolean | null; + public id: number | null; + public platform: string | null; + public sha256_cert_fingerprints: string[] | null; +} diff --git a/rest/admin/2023-01/order.ts b/rest/admin/2023-01/order.ts new file mode 100644 index 000000000..6482a3a6f --- /dev/null +++ b/rest/admin/2023-01/order.ts @@ -0,0 +1,326 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Customer} from './customer'; +import {DiscountCode} from './discount_code'; +import {Fulfillment} from './fulfillment'; +import {Refund} from './refund'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + ids?: unknown; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + processed_at_min?: unknown; + processed_at_max?: unknown; + attribution_app_id?: unknown; + status?: unknown; + financial_status?: unknown; + fulfillment_status?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + status?: unknown; + financial_status?: unknown; + fulfillment_status?: unknown; +} +interface CancelArgs { + [key: string]: unknown; + amount?: unknown; + currency?: unknown; + restock?: unknown; + reason?: unknown; + email?: unknown; + refund?: unknown; + body?: {[key: string]: unknown} | null; +} +interface CloseArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} +interface OpenArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Order extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'order'; + protected static PLURAL_NAME = 'orders'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "customer": Customer + }; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "discount_codes": DiscountCode, + "fulfillments": Fulfillment, + "refunds": Refund + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "orders/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "orders/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "orders.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "orders/.json"}, + {"http_method": "post", "operation": "cancel", "ids": ["id"], "path": "orders//cancel.json"}, + {"http_method": "post", "operation": "close", "ids": ["id"], "path": "orders//close.json"}, + {"http_method": "post", "operation": "open", "ids": ["id"], "path": "orders//open.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "orders.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "orders/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ids = null, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + processed_at_min = null, + processed_at_max = null, + attribution_app_id = null, + status = null, + financial_status = null, + fulfillment_status = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"ids": ids, "limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "processed_at_min": processed_at_min, "processed_at_max": processed_at_max, "attribution_app_id": attribution_app_id, "status": status, "financial_status": financial_status, "fulfillment_status": fulfillment_status, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + status = null, + financial_status = null, + fulfillment_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "status": status, "financial_status": financial_status, "fulfillment_status": fulfillment_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async cancel( + { + amount = null, + currency = null, + restock = null, + reason = null, + email = null, + refund = null, + body = null, + ...otherArgs + }: CancelArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "cancel", + session: this.session, + urlIds: {"id": this.id}, + params: {"amount": amount, "currency": currency, "restock": restock, "reason": reason, "email": email, "refund": refund, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async close( + { + body = null, + ...otherArgs + }: CloseArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "close", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public async open( + { + body = null, + ...otherArgs + }: OpenArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "open", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public line_items: {[key: string]: unknown}[] | null; + public app_id: number | null; + public billing_address: {[key: string]: unknown} | null; + public browser_ip: string | null; + public buyer_accepts_marketing: boolean | null; + public cancel_reason: string | null; + public cancelled_at: string | null; + public cart_token: string | null; + public checkout_token: string | null; + public client_details: {[key: string]: unknown} | null; + public closed_at: string | null; + public company: {[key: string]: unknown} | null; + public created_at: string | null; + public currency: string | null; + public current_subtotal_price: string | null; + public current_subtotal_price_set: {[key: string]: unknown} | null; + public current_total_discounts: string | null; + public current_total_discounts_set: {[key: string]: unknown} | null; + public current_total_duties_set: {[key: string]: unknown} | null; + public current_total_price: string | null; + public current_total_price_set: {[key: string]: unknown} | null; + public current_total_tax: string | null; + public current_total_tax_set: {[key: string]: unknown} | null; + public customer: Customer | null | {[key: string]: any}; + public customer_locale: string | null; + public discount_applications: {[key: string]: unknown}[] | null; + public discount_codes: DiscountCode[] | null | {[key: string]: any}; + public email: string | null; + public estimated_taxes: boolean | null; + public financial_status: string | null; + public fulfillment_status: string | null; + public fulfillments: Fulfillment[] | null | {[key: string]: any}; + public gateway: string | null; + public id: number | null; + public landing_site: string | null; + public location_id: number | null; + public merchant_of_record_app_id: number | null; + public name: string | null; + public note: string | null; + public note_attributes: {[key: string]: unknown}[] | null; + public number: number | null; + public order_number: number | null; + public order_status_url: string | null; + public original_total_duties_set: {[key: string]: unknown} | null; + public payment_details: {[key: string]: unknown} | null; + public payment_gateway_names: string[] | null; + public payment_terms: {[key: string]: unknown} | null; + public phone: string | null; + public presentment_currency: string | null; + public processed_at: string | null; + public processing_method: string | null; + public referring_site: string | null; + public refunds: Refund[] | null | {[key: string]: any}; + public shipping_address: {[key: string]: unknown} | null; + public shipping_lines: {[key: string]: unknown}[] | null; + public source_identifier: string | null; + public source_name: string | null; + public source_url: string | null; + public subtotal_price: number | null; + public subtotal_price_set: {[key: string]: unknown} | null; + public tags: string | null; + public tax_lines: {[key: string]: unknown}[] | null; + public taxes_included: boolean | null; + public test: boolean | null; + public token: string | null; + public total_discounts: string | null; + public total_discounts_set: {[key: string]: unknown} | null; + public total_line_items_price: string | null; + public total_line_items_price_set: {[key: string]: unknown} | null; + public total_outstanding: string | null; + public total_price: string | null; + public total_price_set: {[key: string]: unknown} | null; + public total_shipping_price_set: {[key: string]: unknown} | null; + public total_tax: string | number | null; + public total_tax_set: {[key: string]: unknown} | null; + public total_tip_received: string | null; + public total_weight: number | null; + public updated_at: string | null; + public user_id: number | null; +} diff --git a/rest/admin/2023-01/order_risk.ts b/rest/admin/2023-01/order_risk.ts new file mode 100644 index 000000000..c9ad1917d --- /dev/null +++ b/rest/admin/2023-01/order_risk.ts @@ -0,0 +1,105 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; +} +interface DeleteArgs { + session: Session; + id: number | string; + order_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; +} + +export class OrderRisk extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'order_risk'; + protected static PLURAL_NAME = 'order_risks'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["order_id", "id"], "path": "orders//risks/.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//risks.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//risks/.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id"], "path": "orders//risks.json"}, + {"http_method": "put", "operation": "put", "ids": ["order_id", "id"], "path": "orders//risks/.json"} + ]; + + protected static getJsonBodyName(): string + { + return "risk"; + } + + public static async find( + { + session, + id, + order_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id, + order_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + order_id = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id}, + params: {...otherArgs}, + }); + + return response; + } + + public cause_cancel: boolean | null; + public checkout_id: number | null; + public display: boolean | null; + public id: number | null; + public merchant_message: string | null; + public message: string | null; + public order_id: number | null; + public recommendation: string | null; + public score: number | null; + public source: string | null; +} diff --git a/rest/admin/2023-01/page.ts b/rest/admin/2023-01/page.ts new file mode 100644 index 000000000..d4a5fb02b --- /dev/null +++ b/rest/admin/2023-01/page.ts @@ -0,0 +1,166 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Metafield} from './metafield'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + title?: unknown; + handle?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + fields?: unknown; + published_status?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + title?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} + +export class Page extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'page'; + protected static PLURAL_NAME = 'pages'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "metafield": Metafield + }; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "pages/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "pages/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "pages.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "pages/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "pages.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "pages/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + title = null, + handle = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + fields = null, + published_status = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "title": title, "handle": handle, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "fields": fields, "published_status": published_status, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + title = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"title": title, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public admin_graphql_api_id: string | null; + public author: string | null; + public body_html: string | null; + public created_at: string | null; + public handle: string | null; + public id: number | null; + public metafield: Metafield | null | {[key: string]: any}; + public published_at: string | null; + public shop_id: number | null; + public template_suffix: string | null; + public title: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/payment.ts b/rest/admin/2023-01/payment.ts new file mode 100644 index 000000000..996ac606c --- /dev/null +++ b/rest/admin/2023-01/payment.ts @@ -0,0 +1,104 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Transaction} from './transaction'; +import {Checkout} from './checkout'; + +interface FindArgs { + session: Session; + id: number | string; + checkout_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + checkout_id?: number | string | null; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + checkout_id?: number | string | null; +} + +export class Payment extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'payment'; + protected static PLURAL_NAME = 'payments'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "transaction": Transaction, + "checkout": Checkout + }; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": ["checkout_id"], "path": "checkouts//payments/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["checkout_id"], "path": "checkouts//payments.json"}, + {"http_method": "get", "operation": "get", "ids": ["checkout_id", "id"], "path": "checkouts//payments/.json"}, + {"http_method": "post", "operation": "post", "ids": ["checkout_id"], "path": "checkouts//payments.json"} + ]; + + public static async find( + { + session, + id, + checkout_id = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "checkout_id": checkout_id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + checkout_id = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"checkout_id": checkout_id}, + params: {...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + checkout_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"checkout_id": checkout_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public checkout: Checkout | null | {[key: string]: any}; + public credit_card: {[key: string]: unknown} | null; + public id: number | null; + public next_action: {[key: string]: unknown} | null; + public payment_processing_error_message: string | null; + public transaction: Transaction | null | {[key: string]: any}; + public unique_token: string | null; +} diff --git a/rest/admin/2023-01/payment_gateway.ts b/rest/admin/2023-01/payment_gateway.ts new file mode 100644 index 000000000..af31641eb --- /dev/null +++ b/rest/admin/2023-01/payment_gateway.ts @@ -0,0 +1,101 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class PaymentGateway extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'payment_gateway'; + protected static PLURAL_NAME = 'payment_gateways'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "payment_gateways/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "payment_gateways.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "payment_gateways/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "payment_gateways.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "payment_gateways/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public attachment: string | null; + public created_at: string | null; + public credential1: string | null; + public credential2: string | null; + public credential3: string | null; + public credential4: string | null; + public disabled: boolean | null; + public enabled_card_brands: string[] | null; + public id: number | null; + public name: string | null; + public processing_method: string | null; + public provider_id: number | null; + public sandbox: boolean | null; + public service_name: string | null; + public supports_network_tokenization: boolean | null; + public type: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/payment_transaction.ts b/rest/admin/2023-01/payment_transaction.ts new file mode 100644 index 000000000..32ce43a53 --- /dev/null +++ b/rest/admin/2023-01/payment_transaction.ts @@ -0,0 +1,73 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Currency} from './currency'; + +interface TransactionsArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + last_id?: unknown; + test?: unknown; + payout_id?: unknown; + payout_status?: unknown; +} + +export class PaymentTransaction extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'payment_transaction'; + protected static PLURAL_NAME = 'payment_transactions'; + protected static HAS_ONE: {[key: string]: typeof Base} = { + "currency": Currency + }; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "transactions", "ids": [], "path": "shopify_payments/balance/transactions.json"} + ]; + + public static async transactions( + { + session, + since_id = null, + last_id = null, + test = null, + payout_id = null, + payout_status = null, + ...otherArgs + }: TransactionsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "transactions", + session: session, + urlIds: {}, + params: {"since_id": since_id, "last_id": last_id, "test": test, "payout_id": payout_id, "payout_status": payout_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public amount: string | null; + public currency: Currency | null | {[key: string]: any}; + public fee: string | null; + public id: number | null; + public net: string | null; + public payout_id: number | null; + public payout_status: string | null; + public processed_at: string | null; + public source_id: number | null; + public source_order_id: number | null; + public source_order_transaction_id: number | null; + public source_type: string | null; + public test: boolean | null; + public type: string | null; +} diff --git a/rest/admin/2023-01/payout.ts b/rest/admin/2023-01/payout.ts new file mode 100644 index 000000000..92be8978b --- /dev/null +++ b/rest/admin/2023-01/payout.ts @@ -0,0 +1,77 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + last_id?: unknown; + date_min?: unknown; + date_max?: unknown; + date?: unknown; + status?: unknown; +} + +export class Payout extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'payout'; + protected static PLURAL_NAME = 'payouts'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shopify_payments/payouts.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "shopify_payments/payouts/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + since_id = null, + last_id = null, + date_min = null, + date_max = null, + date = null, + status = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "last_id": last_id, "date_min": date_min, "date_max": date_max, "date": date, "status": status, ...otherArgs}, + }); + + return response; + } + + public amount: string | null; + public currency: string | null; + public date: string | null; + public id: number | null; + public status: string | null; +} diff --git a/rest/admin/2023-01/policy.ts b/rest/admin/2023-01/policy.ts new file mode 100644 index 000000000..20bdce54d --- /dev/null +++ b/rest/admin/2023-01/policy.ts @@ -0,0 +1,47 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class Policy extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'policy'; + protected static PLURAL_NAME = 'policies'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "policies.json"} + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public body: string | null; + public created_at: string | null; + public handle: string | null; + public title: string | null; + public updated_at: string | null; + public url: string | null; +} diff --git a/rest/admin/2023-01/price_rule.ts b/rest/admin/2023-01/price_rule.ts new file mode 100644 index 000000000..60183765e --- /dev/null +++ b/rest/admin/2023-01/price_rule.ts @@ -0,0 +1,159 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + starts_at_min?: unknown; + starts_at_max?: unknown; + ends_at_min?: unknown; + ends_at_max?: unknown; + times_used?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} + +export class PriceRule extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'price_rule'; + protected static PLURAL_NAME = 'price_rules'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "price_rules/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "price_rules/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "price_rules.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "price_rules/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "price_rules.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "price_rules/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + starts_at_min = null, + starts_at_max = null, + ends_at_min = null, + ends_at_max = null, + times_used = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "starts_at_min": starts_at_min, "starts_at_max": starts_at_max, "ends_at_min": ends_at_min, "ends_at_max": ends_at_max, "times_used": times_used, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public allocation_limit: number | null; + public allocation_method: string | null; + public created_at: string | null; + public customer_segment_prerequisite_ids: number[] | null; + public customer_selection: string | null; + public ends_at: string | null; + public entitled_collection_ids: number[] | null; + public entitled_country_ids: number[] | null; + public entitled_product_ids: number[] | null; + public entitled_variant_ids: number[] | null; + public id: number | null; + public once_per_customer: boolean | null; + public prerequisite_collection_ids: number[] | null; + public prerequisite_customer_ids: number[] | null; + public prerequisite_product_ids: number[] | null; + public prerequisite_quantity_range: {[key: string]: unknown} | null; + public prerequisite_shipping_price_range: {[key: string]: unknown} | null; + public prerequisite_subtotal_range: {[key: string]: unknown} | null; + public prerequisite_to_entitlement_purchase: {[key: string]: unknown} | null; + public prerequisite_to_entitlement_quantity_ratio: {[key: string]: unknown} | null; + public prerequisite_variant_ids: number[] | null; + public starts_at: string | null; + public target_selection: string | null; + public target_type: string | null; + public title: string | null; + public updated_at: string | null; + public usage_limit: number | null; + public value: string | null; + public value_type: string | null; +} diff --git a/rest/admin/2023-01/product.ts b/rest/admin/2023-01/product.ts new file mode 100644 index 000000000..e28a0c5e8 --- /dev/null +++ b/rest/admin/2023-01/product.ts @@ -0,0 +1,188 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Image} from './image'; +import {Variant} from './variant'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + ids?: unknown; + limit?: unknown; + since_id?: unknown; + title?: unknown; + vendor?: unknown; + handle?: unknown; + product_type?: unknown; + status?: unknown; + collection_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + fields?: unknown; + presentment_currencies?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + vendor?: unknown; + product_type?: unknown; + collection_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} + +export class Product extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'product'; + protected static PLURAL_NAME = 'products'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "images": Image, + "variants": Variant + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "products/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "products/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "products.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "products/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "products.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "products/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ids = null, + limit = null, + since_id = null, + title = null, + vendor = null, + handle = null, + product_type = null, + status = null, + collection_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + fields = null, + presentment_currencies = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"ids": ids, "limit": limit, "since_id": since_id, "title": title, "vendor": vendor, "handle": handle, "product_type": product_type, "status": status, "collection_id": collection_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "fields": fields, "presentment_currencies": presentment_currencies, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + vendor = null, + product_type = null, + collection_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"vendor": vendor, "product_type": product_type, "collection_id": collection_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public title: string | null; + public body_html: string | null; + public created_at: string | null; + public handle: string | null; + public id: number | null; + public images: Image[] | null | {[key: string]: any}; + public options: {[key: string]: unknown} | {[key: string]: unknown}[] | null; + public product_type: string | null; + public published_at: string | null; + public published_scope: string | null; + public status: string | null; + public tags: string | string[] | null; + public template_suffix: string | null; + public updated_at: string | null; + public variants: Variant[] | null | {[key: string]: any}; + public vendor: string | null; +} diff --git a/rest/admin/2023-01/product_listing.ts b/rest/admin/2023-01/product_listing.ts new file mode 100644 index 000000000..a972b758d --- /dev/null +++ b/rest/admin/2023-01/product_listing.ts @@ -0,0 +1,163 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Image} from './image'; +import {Variant} from './variant'; + +interface FindArgs { + session: Session; + product_id: number | string; +} +interface DeleteArgs { + session: Session; + product_id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + product_ids?: unknown; + limit?: unknown; + collection_id?: unknown; + updated_at_min?: unknown; + handle?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; +} +interface ProductIdsArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; +} + +export class ProductListing extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'product_listing'; + protected static PLURAL_NAME = 'product_listings'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "images": Image, + "variants": Variant + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["product_id"], "path": "product_listings/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "product_listings/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "product_listings.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "product_listings/.json"}, + {"http_method": "get", "operation": "product_ids", "ids": [], "path": "product_listings/product_ids.json"}, + {"http_method": "put", "operation": "put", "ids": ["product_id"], "path": "product_listings/.json"} + ]; + protected static PRIMARY_KEY: string = "product_id"; + + public static async find( + { + session, + product_id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"product_id": product_id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + product_id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"product_id": product_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + product_ids = null, + limit = null, + collection_id = null, + updated_at_min = null, + handle = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"product_ids": product_ids, "limit": limit, "collection_id": collection_id, "updated_at_min": updated_at_min, "handle": handle, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public static async product_ids( + { + session, + limit = null, + ...otherArgs + }: ProductIdsArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "product_ids", + session: session, + urlIds: {}, + params: {"limit": limit, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public body_html: string | null; + public created_at: string | null; + public handle: string | null; + public images: Image[] | null | {[key: string]: any}; + public options: {[key: string]: unknown}[] | null; + public product_id: number | null; + public product_type: string | null; + public published_at: string | null; + public tags: string | null; + public title: string | null; + public updated_at: string | null; + public variants: Variant[] | null | {[key: string]: any}; + public vendor: string | null; +} diff --git a/rest/admin/2023-01/product_resource_feedback.ts b/rest/admin/2023-01/product_resource_feedback.ts new file mode 100644 index 000000000..a3e74534a --- /dev/null +++ b/rest/admin/2023-01/product_resource_feedback.ts @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; +} + +export class ProductResourceFeedback extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'product_resource_feedback'; + protected static PLURAL_NAME = 'product_resource_feedbacks'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//resource_feedback.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_id"], "path": "products//resource_feedback.json"} + ]; + + protected static getJsonBodyName(): string + { + return "resource_feedback"; + } + + public static async all( + { + session, + product_id = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"product_id": product_id}, + params: {...otherArgs}, + }); + + return response; + } + + public created_at: string | null; + public feedback_generated_at: string | null; + public messages: string[] | null; + public product_id: number | null; + public resource_id: number | null; + public resource_type: string | null; + public resource_updated_at: string | null; + public state: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/province.ts b/rest/admin/2023-01/province.ts new file mode 100644 index 000000000..cc56306dd --- /dev/null +++ b/rest/admin/2023-01/province.ts @@ -0,0 +1,106 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + country_id?: number | string | null; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + country_id?: number | string | null; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + country_id?: number | string | null; +} + +export class Province extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'province'; + protected static PLURAL_NAME = 'provinces'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": ["country_id"], "path": "countries//provinces/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["country_id"], "path": "countries//provinces.json"}, + {"http_method": "get", "operation": "get", "ids": ["country_id", "id"], "path": "countries//provinces/.json"}, + {"http_method": "put", "operation": "put", "ids": ["country_id", "id"], "path": "countries//provinces/.json"} + ]; + + public static async find( + { + session, + id, + country_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "country_id": country_id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + country_id = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"country_id": country_id}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + country_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"country_id": country_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public code: string | null; + public country_id: number | null; + public id: number | null; + public name: string | null; + public shipping_zone_id: number | null; + public tax: number | null; + public tax_name: string | null; + public tax_percentage: number | null; + public tax_type: string | null; +} diff --git a/rest/admin/2023-01/recurring_application_charge.ts b/rest/admin/2023-01/recurring_application_charge.ts new file mode 100644 index 000000000..f60079f1f --- /dev/null +++ b/rest/admin/2023-01/recurring_application_charge.ts @@ -0,0 +1,129 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + since_id?: unknown; + fields?: unknown; +} +interface CustomizeArgs { + [key: string]: unknown; + body?: {[key: string]: unknown} | null; +} + +export class RecurringApplicationCharge extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'recurring_application_charge'; + protected static PLURAL_NAME = 'recurring_application_charges'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "recurring_application_charges/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "recurring_application_charges.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "recurring_application_charges/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "recurring_application_charges.json"}, + {"http_method": "put", "operation": "customize", "ids": ["id"], "path": "recurring_application_charges//customize.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public async customize( + { + body = null, + ...otherArgs + }: CustomizeArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "customize", + session: this.session, + urlIds: {"id": this.id}, + params: {...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public activated_on: string | null; + public billing_on: string | null; + public cancelled_on: string | null; + public capped_amount: string | number | null; + public confirmation_url: string | null; + public created_at: string | null; + public id: number | null; + public name: string | null; + public price: string | number | null; + public return_url: string | null; + public status: string | null; + public terms: string | null; + public test: boolean | null; + public trial_days: number | null; + public trial_ends_on: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/redirect.ts b/rest/admin/2023-01/redirect.ts new file mode 100644 index 000000000..7bb7d9d60 --- /dev/null +++ b/rest/admin/2023-01/redirect.ts @@ -0,0 +1,127 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + path?: unknown; + target?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + path?: unknown; + target?: unknown; +} + +export class Redirect extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'redirect'; + protected static PLURAL_NAME = 'redirects'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "redirects/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "redirects/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "redirects.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "redirects/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "redirects.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "redirects/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + path = null, + target = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "path": path, "target": target, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + path = null, + target = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"path": path, "target": target, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public id: number | null; + public path: string | null; + public target: string | null; +} diff --git a/rest/admin/2023-01/refund.ts b/rest/admin/2023-01/refund.ts new file mode 100644 index 000000000..42945c491 --- /dev/null +++ b/rest/admin/2023-01/refund.ts @@ -0,0 +1,121 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Transaction} from './transaction'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fields?: unknown; + in_shop_currency?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + limit?: unknown; + fields?: unknown; + in_shop_currency?: unknown; +} +interface CalculateArgs { + [key: string]: unknown; + shipping?: unknown; + refund_line_items?: unknown; + currency?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class Refund extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'refund'; + protected static PLURAL_NAME = 'refunds'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "transactions": Transaction + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//refunds.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//refunds/.json"}, + {"http_method": "post", "operation": "calculate", "ids": ["order_id"], "path": "orders//refunds/calculate.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id"], "path": "orders//refunds.json"} + ]; + + public static async find( + { + session, + id, + order_id = null, + fields = null, + in_shop_currency = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {"fields": fields, "in_shop_currency": in_shop_currency}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + order_id = null, + limit = null, + fields = null, + in_shop_currency = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id}, + params: {"limit": limit, "fields": fields, "in_shop_currency": in_shop_currency, ...otherArgs}, + }); + + return response; + } + + public async calculate( + { + shipping = null, + refund_line_items = null, + currency = null, + body = null, + ...otherArgs + }: CalculateArgs + ): Promise { + const response = await this.request({ + http_method: "post", + operation: "calculate", + session: this.session, + urlIds: {"order_id": this.order_id}, + params: {"shipping": shipping, "refund_line_items": refund_line_items, "currency": currency, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public created_at: string | null; + public duties: {[key: string]: unknown}[] | null; + public id: number | null; + public note: string | null; + public order_adjustments: {[key: string]: unknown}[] | null; + public order_id: number | null; + public processed_at: string | null; + public refund_duties: {[key: string]: unknown}[] | null; + public refund_line_items: {[key: string]: unknown}[] | null; + public restock: boolean | null; + public transactions: Transaction[] | null | {[key: string]: any}; + public user_id: number | null; +} diff --git a/rest/admin/2023-01/report.ts b/rest/admin/2023-01/report.ts new file mode 100644 index 000000000..9288ec490 --- /dev/null +++ b/rest/admin/2023-01/report.ts @@ -0,0 +1,103 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + ids?: unknown; + limit?: unknown; + since_id?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + fields?: unknown; +} + +export class Report extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'report'; + protected static PLURAL_NAME = 'reports'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "reports/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "reports.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "reports/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "reports.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "reports/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ids = null, + limit = null, + since_id = null, + updated_at_min = null, + updated_at_max = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"ids": ids, "limit": limit, "since_id": since_id, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public category: string | null; + public id: number | null; + public name: string | null; + public shopify_ql: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/resource_feedback.ts b/rest/admin/2023-01/resource_feedback.ts new file mode 100644 index 000000000..aa22f3b9d --- /dev/null +++ b/rest/admin/2023-01/resource_feedback.ts @@ -0,0 +1,49 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class ResourceFeedback extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'resource_feedback'; + protected static PLURAL_NAME = 'resource_feedbacks'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "resource_feedback.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "resource_feedback.json"} + ]; + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public created_at: string | null; + public feedback_generated_at: string | null; + public messages: string[] | null; + public resource_id: number | null; + public resource_type: string | null; + public state: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/script_tag.ts b/rest/admin/2023-01/script_tag.ts new file mode 100644 index 000000000..99350ac98 --- /dev/null +++ b/rest/admin/2023-01/script_tag.ts @@ -0,0 +1,135 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + created_at_min?: unknown; + created_at_max?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + src?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + src?: unknown; +} + +export class ScriptTag extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'script_tag'; + protected static PLURAL_NAME = 'script_tags'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "script_tags/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "script_tags/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "script_tags.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "script_tags/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "script_tags.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "script_tags/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + since_id = null, + created_at_min = null, + created_at_max = null, + updated_at_min = null, + updated_at_max = null, + src = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "created_at_min": created_at_min, "created_at_max": created_at_max, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "src": src, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + src = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"src": src, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public event: string | null; + public src: string | null; + public cache: boolean | null; + public created_at: string | null; + public display_scope: string | null; + public id: number | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/shipping_zone.ts b/rest/admin/2023-01/shipping_zone.ts new file mode 100644 index 000000000..f69e09f87 --- /dev/null +++ b/rest/admin/2023-01/shipping_zone.ts @@ -0,0 +1,58 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +import {Country} from './country'; +import {Province} from './province'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; +} + +export class ShippingZone extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'shipping_zone'; + protected static PLURAL_NAME = 'shipping_zones'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = { + "countries": Country, + "provinces": Province + }; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shipping_zones.json"} + ]; + + public static async all( + { + session, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public carrier_shipping_rate_providers: unknown | null; + public countries: Country[] | null | {[key: string]: any}; + public id: number | null; + public location_group_id: number | null; + public name: string | null; + public price_based_shipping_rates: {[key: string]: unknown} | null; + public profile_id: number | null; + public provinces: Province[] | null | {[key: string]: any}; + public weight_based_shipping_rates: {[key: string]: unknown} | null; +} diff --git a/rest/admin/2023-01/shop.ts b/rest/admin/2023-01/shop.ts new file mode 100644 index 000000000..1cfc96070 --- /dev/null +++ b/rest/admin/2023-01/shop.ts @@ -0,0 +1,99 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; +} + +export class Shop extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'shop'; + protected static PLURAL_NAME = 'shops'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "shop.json"} + ]; + + public static async all( + { + session, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public address1: string | null; + public address2: string | null; + public checkout_api_supported: boolean | null; + public city: string | null; + public cookie_consent_level: string | null; + public country: string | null; + public country_code: string | null; + public country_name: string | null; + public county_taxes: string | null; + public created_at: string | null; + public currency: string | null; + public customer_email: string | null; + public domain: string | null; + public eligible_for_card_reader_giveaway: boolean | null; + public eligible_for_payments: boolean | null; + public email: string | null; + public enabled_presentment_currencies: string[] | null; + public finances: boolean | null; + public force_ssl: boolean | null; + public google_apps_domain: string | null; + public google_apps_login_enabled: string | null; + public has_discounts: boolean | null; + public has_gift_cards: boolean | null; + public has_storefront: boolean | null; + public iana_timezone: string | null; + public id: number | null; + public latitude: number | null; + public longitude: number | null; + public marketing_sms_consent_enabled_at_checkout: boolean | null; + public money_format: string | null; + public money_in_emails_format: string | null; + public money_with_currency_format: string | null; + public money_with_currency_in_emails_format: string | null; + public multi_location_enabled: boolean | null; + public myshopify_domain: string | null; + public name: string | null; + public password_enabled: boolean | null; + public phone: string | null; + public plan_display_name: string | null; + public plan_name: string | null; + public pre_launch_enabled: boolean | null; + public primary_locale: string | null; + public primary_location_id: number | null; + public province: string | null; + public province_code: string | null; + public requires_extra_payments_agreement: boolean | null; + public setup_required: boolean | null; + public shop_owner: string | null; + public source: string | null; + public tax_shipping: string | null; + public taxes_included: string | null; + public timezone: string | null; + public transactional_sms_disabled: boolean | null; + public updated_at: string | null; + public weight_unit: string | null; + public zip: string | null; +} diff --git a/rest/admin/2023-01/smart_collection.ts b/rest/admin/2023-01/smart_collection.ts new file mode 100644 index 000000000..1276a0198 --- /dev/null +++ b/rest/admin/2023-01/smart_collection.ts @@ -0,0 +1,188 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + ids?: unknown; + since_id?: unknown; + title?: unknown; + product_id?: unknown; + handle?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + title?: unknown; + product_id?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; + published_at_min?: unknown; + published_at_max?: unknown; + published_status?: unknown; +} +interface OrderArgs { + [key: string]: unknown; + products?: unknown; + sort_order?: unknown; + body?: {[key: string]: unknown} | null; +} + +export class SmartCollection extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'smart_collection'; + protected static PLURAL_NAME = 'smart_collections'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "smart_collections/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "smart_collections/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "smart_collections.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "smart_collections/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "smart_collections.json"}, + {"http_method": "put", "operation": "order", "ids": ["id"], "path": "smart_collections//order.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "smart_collections/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + limit = null, + ids = null, + since_id = null, + title = null, + product_id = null, + handle = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "ids": ids, "since_id": since_id, "title": title, "product_id": product_id, "handle": handle, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + title = null, + product_id = null, + updated_at_min = null, + updated_at_max = null, + published_at_min = null, + published_at_max = null, + published_status = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"title": title, "product_id": product_id, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, "published_at_min": published_at_min, "published_at_max": published_at_max, "published_status": published_status, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public async order( + { + products = null, + sort_order = null, + body = null, + ...otherArgs + }: OrderArgs + ): Promise { + const response = await this.request({ + http_method: "put", + operation: "order", + session: this.session, + urlIds: {"id": this.id}, + params: {"products": products, "sort_order": sort_order, ...otherArgs}, + body: body, + entity: this, + }); + + return response ? response.body : null; + } + + public rules: {[key: string]: unknown} | {[key: string]: unknown}[] | null; + public title: string | null; + public body_html: string | null; + public disjunctive: boolean | null; + public handle: string | null; + public id: number | null; + public image: string | {[key: string]: unknown} | null; + public published_at: string | null; + public published_scope: string | null; + public sort_order: string | null; + public template_suffix: string | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/storefront_access_token.ts b/rest/admin/2023-01/storefront_access_token.ts new file mode 100644 index 000000000..b53c1c35d --- /dev/null +++ b/rest/admin/2023-01/storefront_access_token.ts @@ -0,0 +1,69 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; +} + +export class StorefrontAccessToken extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'storefront_access_token'; + protected static PLURAL_NAME = 'storefront_access_tokens'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "storefront_access_tokens/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "storefront_access_tokens.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "storefront_access_tokens.json"} + ]; + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {...otherArgs}, + }); + + return response; + } + + public title: string | null; + public access_scope: string | null; + public access_token: string | null; + public created_at: string | null; + public id: number | null; +} diff --git a/rest/admin/2023-01/tender_transaction.ts b/rest/admin/2023-01/tender_transaction.ts new file mode 100644 index 000000000..a4acbb61b --- /dev/null +++ b/rest/admin/2023-01/tender_transaction.ts @@ -0,0 +1,63 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + since_id?: unknown; + processed_at_min?: unknown; + processed_at_max?: unknown; + processed_at?: unknown; + order?: unknown; +} + +export class TenderTransaction extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'tender_transaction'; + protected static PLURAL_NAME = 'tender_transactions'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": [], "path": "tender_transactions.json"} + ]; + + public static async all( + { + session, + limit = null, + since_id = null, + processed_at_min = null, + processed_at_max = null, + processed_at = null, + order = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "since_id": since_id, "processed_at_min": processed_at_min, "processed_at_max": processed_at_max, "processed_at": processed_at, "order": order, ...otherArgs}, + }); + + return response; + } + + public amount: string | null; + public currency: string | null; + public id: number | null; + public order_id: number | null; + public payment_details: {[key: string]: unknown} | null; + public payment_method: string | null; + public processed_at: string | null; + public remote_reference: string | null; + public test: boolean | null; + public user_id: number | null; +} diff --git a/rest/admin/2023-01/theme.ts b/rest/admin/2023-01/theme.ts new file mode 100644 index 000000000..e93968862 --- /dev/null +++ b/rest/admin/2023-01/theme.ts @@ -0,0 +1,96 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + fields?: unknown; +} + +export class Theme extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'theme'; + protected static PLURAL_NAME = 'themes'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "themes/.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "themes.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "themes/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "themes.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "themes/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public created_at: string | null; + public id: number | null; + public name: string | null; + public previewable: boolean | null; + public processing: boolean | null; + public role: string | null; + public theme_store_id: number | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/transaction.ts b/rest/admin/2023-01/transaction.ts new file mode 100644 index 000000000..c146e57a5 --- /dev/null +++ b/rest/admin/2023-01/transaction.ts @@ -0,0 +1,125 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + order_id?: number | string | null; + fields?: unknown; + in_shop_currency?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; + since_id?: unknown; + fields?: unknown; + in_shop_currency?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + order_id?: number | string | null; +} + +export class Transaction extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'transaction'; + protected static PLURAL_NAME = 'transactions'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "count", "ids": ["order_id"], "path": "orders//transactions/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id"], "path": "orders//transactions.json"}, + {"http_method": "get", "operation": "get", "ids": ["order_id", "id"], "path": "orders//transactions/.json"}, + {"http_method": "post", "operation": "post", "ids": ["order_id"], "path": "orders//transactions.json"} + ]; + + public static async find( + { + session, + id, + order_id = null, + fields = null, + in_shop_currency = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "order_id": order_id}, + params: {"fields": fields, "in_shop_currency": in_shop_currency}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + order_id = null, + since_id = null, + fields = null, + in_shop_currency = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"order_id": order_id}, + params: {"since_id": since_id, "fields": fields, "in_shop_currency": in_shop_currency, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + order_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"order_id": order_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public kind: string | null; + public amount: string | null; + public authorization: string | null; + public authorization_expires_at: string | null; + public created_at: string | null; + public currency: string | null; + public currency_exchange_adjustment: {[key: string]: unknown} | null; + public device_id: number | null; + public error_code: string | null; + public extended_authorization_attributes: {[key: string]: unknown} | null; + public gateway: string | null; + public id: number | null; + public location_id: number | null; + public message: string | null; + public order_id: number | null; + public parent_id: number | null; + public payment_details: {[key: string]: unknown} | null; + public payments_refund_attributes: {[key: string]: unknown} | null; + public processed_at: string | null; + public receipt: {[key: string]: unknown} | null; + public source_name: string | null; + public status: string | null; + public test: boolean | null; + public user_id: number | null; +} diff --git a/rest/admin/2023-01/usage_charge.ts b/rest/admin/2023-01/usage_charge.ts new file mode 100644 index 000000000..2bd13bc64 --- /dev/null +++ b/rest/admin/2023-01/usage_charge.ts @@ -0,0 +1,75 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + recurring_application_charge_id?: number | string | null; + fields?: unknown; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + recurring_application_charge_id?: number | string | null; + fields?: unknown; +} + +export class UsageCharge extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'usage_charge'; + protected static PLURAL_NAME = 'usage_charges'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "get", "ids": ["recurring_application_charge_id"], "path": "recurring_application_charges//usage_charges.json"}, + {"http_method": "get", "operation": "get", "ids": ["recurring_application_charge_id", "id"], "path": "recurring_application_charges//usage_charges/.json"}, + {"http_method": "post", "operation": "post", "ids": ["recurring_application_charge_id"], "path": "recurring_application_charges//usage_charges.json"} + ]; + + public static async find( + { + session, + id, + recurring_application_charge_id = null, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id, "recurring_application_charge_id": recurring_application_charge_id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + recurring_application_charge_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"recurring_application_charge_id": recurring_application_charge_id}, + params: {"fields": fields, ...otherArgs}, + }); + + return response; + } + + public created_at: string | null; + public description: string | null; + public id: number | null; + public price: number | null; + public recurring_application_charge_id: number | null; + public updated_at: string | null; +} diff --git a/rest/admin/2023-01/user.ts b/rest/admin/2023-01/user.ts new file mode 100644 index 000000000..5c99c4bb9 --- /dev/null +++ b/rest/admin/2023-01/user.ts @@ -0,0 +1,102 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + limit?: unknown; + page_info?: unknown; +} +interface CurrentArgs { + [key: string]: unknown; + session: Session; +} + +export class User extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'user'; + protected static PLURAL_NAME = 'users'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "get", "operation": "current", "ids": [], "path": "users/current.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "users.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "users/.json"} + ]; + + public static async find( + { + session, + id + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {}, + }); + return result ? result[0] : null; + } + + public static async all( + { + session, + limit = null, + page_info = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"limit": limit, "page_info": page_info, ...otherArgs}, + }); + + return response; + } + + public static async current( + { + session, + ...otherArgs + }: CurrentArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "current", + session: session, + urlIds: {}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public account_owner: boolean | null; + public bio: string | null; + public email: string | null; + public first_name: string | null; + public id: number | null; + public im: string | null; + public last_name: string | null; + public locale: string | null; + public permissions: string[] | null; + public phone: string | null; + public receive_announcements: number | null; + public screen_name: string | null; + public url: string | null; + public user_type: string | null; +} diff --git a/rest/admin/2023-01/variant.ts b/rest/admin/2023-01/variant.ts new file mode 100644 index 000000000..e968fa590 --- /dev/null +++ b/rest/admin/2023-01/variant.ts @@ -0,0 +1,154 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; + product_id?: number | string | null; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; + limit?: unknown; + presentment_currencies?: unknown; + since_id?: unknown; + fields?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + product_id?: number | string | null; +} + +export class Variant extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'variant'; + protected static PLURAL_NAME = 'variants'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["product_id", "id"], "path": "products//variants/.json"}, + {"http_method": "get", "operation": "count", "ids": ["product_id"], "path": "products//variants/count.json"}, + {"http_method": "get", "operation": "get", "ids": ["product_id"], "path": "products//variants.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "variants/.json"}, + {"http_method": "post", "operation": "post", "ids": ["product_id"], "path": "products//variants.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "variants/.json"} + ]; + protected static READ_ONLY_ATTRIBUTES: string[] = [ + "inventory_quantity", + "inventory_quantity_adjustment" + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id, + product_id = null + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id, "product_id": product_id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + product_id = null, + limit = null, + presentment_currencies = null, + since_id = null, + fields = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {"product_id": product_id}, + params: {"limit": limit, "presentment_currencies": presentment_currencies, "since_id": since_id, "fields": fields, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + product_id = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {"product_id": product_id}, + params: {...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public barcode: string | null; + public compare_at_price: string | null; + public created_at: string | null; + public fulfillment_service: string | null; + public grams: number | null; + public id: number | null; + public image_id: number | null; + public inventory_item_id: number | null; + public inventory_management: string | null; + public inventory_policy: string | null; + public inventory_quantity: number | null; + public inventory_quantity_adjustment: number | null; + public old_inventory_quantity: number | null; + public option: {[key: string]: unknown} | null; + public position: number | null; + public presentment_prices: {[key: string]: unknown}[] | null; + public price: string | null; + public product_id: number | null; + public requires_shipping: boolean | null; + public sku: string | null; + public tax_code: string | null; + public taxable: boolean | null; + public title: string | null; + public updated_at: string | null; + public weight: number | null; + public weight_unit: string | null; +} diff --git a/rest/admin/2023-01/webhook.ts b/rest/admin/2023-01/webhook.ts new file mode 100644 index 000000000..7185cee18 --- /dev/null +++ b/rest/admin/2023-01/webhook.ts @@ -0,0 +1,142 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Base} from '../../base'; +import {ResourcePath} from '../../types'; +import {Session} from '../../../lib/session/session'; +import {ApiVersion} from '../../../lib/types'; + +interface FindArgs { + session: Session; + id: number | string; + fields?: unknown; +} +interface DeleteArgs { + session: Session; + id: number | string; +} +interface AllArgs { + [key: string]: unknown; + session: Session; + address?: unknown; + created_at_max?: unknown; + created_at_min?: unknown; + fields?: unknown; + limit?: unknown; + since_id?: unknown; + topic?: unknown; + updated_at_min?: unknown; + updated_at_max?: unknown; +} +interface CountArgs { + [key: string]: unknown; + session: Session; + address?: unknown; + topic?: unknown; +} + +export class Webhook extends Base { + public static API_VERSION = ApiVersion.January23; + + protected static NAME = 'webhook'; + protected static PLURAL_NAME = 'webhooks'; + protected static HAS_ONE: {[key: string]: typeof Base} = {}; + protected static HAS_MANY: {[key: string]: typeof Base} = {}; + protected static PATHS: ResourcePath[] = [ + {"http_method": "delete", "operation": "delete", "ids": ["id"], "path": "webhooks/.json"}, + {"http_method": "get", "operation": "count", "ids": [], "path": "webhooks/count.json"}, + {"http_method": "get", "operation": "get", "ids": [], "path": "webhooks.json"}, + {"http_method": "get", "operation": "get", "ids": ["id"], "path": "webhooks/.json"}, + {"http_method": "post", "operation": "post", "ids": [], "path": "webhooks.json"}, + {"http_method": "put", "operation": "put", "ids": ["id"], "path": "webhooks/.json"} + ]; + + public static async find( + { + session, + id, + fields = null + }: FindArgs + ): Promise { + const result = await this.baseFind({ + session: session, + urlIds: {"id": id}, + params: {"fields": fields}, + }); + return result ? result[0] : null; + } + + public static async delete( + { + session, + id + }: DeleteArgs + ): Promise { + const response = await this.request({ + http_method: "delete", + operation: "delete", + session: session, + urlIds: {"id": id}, + params: {}, + }); + + return response ? response.body : null; + } + + public static async all( + { + session, + address = null, + created_at_max = null, + created_at_min = null, + fields = null, + limit = null, + since_id = null, + topic = null, + updated_at_min = null, + updated_at_max = null, + ...otherArgs + }: AllArgs + ): Promise { + const response = await this.baseFind({ + session: session, + urlIds: {}, + params: {"address": address, "created_at_max": created_at_max, "created_at_min": created_at_min, "fields": fields, "limit": limit, "since_id": since_id, "topic": topic, "updated_at_min": updated_at_min, "updated_at_max": updated_at_max, ...otherArgs}, + }); + + return response; + } + + public static async count( + { + session, + address = null, + topic = null, + ...otherArgs + }: CountArgs + ): Promise { + const response = await this.request({ + http_method: "get", + operation: "count", + session: session, + urlIds: {}, + params: {"address": address, "topic": topic, ...otherArgs}, + body: {}, + entity: null, + }); + + return response ? response.body : null; + } + + public address: string | null; + public topic: string | null; + public api_version: string | null; + public created_at: string | null; + public fields: string[] | null; + public format: string | null; + public id: number | null; + public metafield_namespaces: string[] | null; + public private_metafield_namespaces: string[] | null; + public updated_at: string | null; +} diff --git a/rest/admin/__tests__/2022-04/abandoned_checkout.test.ts b/rest/admin/__tests__/2022-04/abandoned_checkout.test.ts index 3f1d14cb9..e2aa1ae7c 100644 --- a/rest/admin/__tests__/2022-04/abandoned_checkout.test.ts +++ b/rest/admin/__tests__/2022-04/abandoned_checkout.test.ts @@ -31,60 +31,60 @@ describe('AbandonedCheckout resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, + created_at_max: "2013-10-12T07:05:27-02:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/checkouts.json', - query: '', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/checkouts.json', - query: 'status=closed', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - created_at_max: "2013-10-12T07:05:27-02:00", + status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/checkouts.json', - query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + query: 'status=closed', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, @@ -102,53 +102,53 @@ describe('AbandonedCheckout resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/checkouts.json', - query: 'status=closed', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, + created_at_max: "2013-10-12T07:05:27-02:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/checkouts.json', - query: '', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - created_at_max: "2013-10-12T07:05:27-02:00", + status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/checkouts.json', - query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + query: 'status=closed', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-04/apple_pay_certificate.test.ts b/rest/admin/__tests__/2022-04/apple_pay_certificate.test.ts index 99bfe1cb2..3fa8ed781 100644 --- a/rest/admin/__tests__/2022-04/apple_pay_certificate.test.ts +++ b/rest/admin/__tests__/2022-04/apple_pay_certificate.test.ts @@ -31,7 +31,7 @@ describe('ApplePayCertificate resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938274, "status": "issuing", "merchant_id": null}})); + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938276, "status": "issuing", "merchant_id": null}})); const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); @@ -48,17 +48,17 @@ describe('ApplePayCertificate resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938276, "status": "csr", "merchant_id": null}})); + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938274, "status": "csr", "merchant_id": null}})); await shopify.rest.ApplePayCertificate.find({ session: session, - id: 1068938276, + id: 1068938274, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/apple_pay_certificates/1068938276.json', + path: '/admin/api/2022-04/apple_pay_certificates/1068938274.json', query: '', headers, data: undefined @@ -66,10 +66,10 @@ describe('ApplePayCertificate resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938277, "status": "completed", "merchant_id": "merchant.something"}})); + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938275, "status": "completed", "merchant_id": "merchant.something"}})); const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); - apple_pay_certificate.id = 1068938277; + apple_pay_certificate.id = 1068938275; apple_pay_certificate.status = "completed"; apple_pay_certificate.merchant_id = "merchant.something"; apple_pay_certificate.encoded_signed_certificate = "MIIEZzCCBA6gAwIBA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9saWN5IGFuZCBjZXJ0aWZp\nY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDYGCCsGAQUFBwIBFipodHRw\nOi8vd3d3LmFwcGxlLmNvbS9jZXJ0aWZpY2F0ZWF1dGhvcml0eS8wNgYDVR0f\nBC8wLTAroCmgJ4YlaHR0cDovL2NybC5hcHBsZS5jb20vYXBwbGV3d2RyY2Ey\nLmNybDAOBgNVHQ8BAf8EBAMCAygwTwYJKoZIhvdjZAYgBEIMQDM0NTBBMjhB\nOTlGRjIyRkI5OTdDRERFODU1REREOTI5NTE4RjVGMDdBQUM4NzdDMzRCQjM3\nODFCQTg2MzkyNjIwCgYIKoZIzj0EAwIDRwAwRAIgZ/oNx0gCc/PM4pYhOWL2\nCecFQrIgzHr/fZd8qcy3Be8CIEQCaAPpmvQrXEX0hFexoYMHtOHY9dgN2D8L\nNKpVyn3t\n"; @@ -78,7 +78,7 @@ describe('ApplePayCertificate resource', () => { expect({ method: 'PUT', domain, - path: '/admin/api/2022-04/apple_pay_certificates/1068938277.json', + path: '/admin/api/2022-04/apple_pay_certificates/1068938275.json', query: '', headers, data: { "apple_pay_certificate": {"status": "completed", "merchant_id": "merchant.something", "encoded_signed_certificate": "MIIEZzCCBA6gAwIBAgIIWGMideLkDJAwCgYIKoZIzj0EAwIwgYAxNDAyBgNV\nBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0g\nRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMw\nEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNDEyMDgyMTMy\nMDBaFw0xNzAxMDYyMTMyMDBaMIGZMSowKAYKCZImiZPyLGQBAQwabWVyY2hh\nbnQuY29tLm5vcm1vcmUuamFzb24xMDAuBgNVBAMMJ01lcmNoYW50IElEOiBt\nZXJjaGFudC5jb20ubm9ybW9yZS5qYXNvbjETMBEGA1UECw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OWL2\nCecFQrIgzHr/fZd8qcy3Be8CIEQCaAPpmvQrXEX0hFexoYMHtOHY9dgN2D8L\nNKpVyn3t\n"} } @@ -90,13 +90,13 @@ describe('ApplePayCertificate resource', () => { await shopify.rest.ApplePayCertificate.delete({ session: session, - id: 1068938278, + id: 1068938277, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/apple_pay_certificates/1068938278.json', + path: '/admin/api/2022-04/apple_pay_certificates/1068938277.json', query: '', headers, data: undefined @@ -108,13 +108,13 @@ describe('ApplePayCertificate resource', () => { await shopify.rest.ApplePayCertificate.csr({ session: session, - id: 1068938275, + id: 1068938278, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/apple_pay_certificates/1068938275/csr.json', + path: '/admin/api/2022-04/apple_pay_certificates/1068938278/csr.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/application_charge.test.ts b/rest/admin/__tests__/2022-04/application_charge.test.ts index a624dac90..4eb7545fd 100644 --- a/rest/admin/__tests__/2022-04/application_charge.test.ts +++ b/rest/admin/__tests__/2022-04/application_charge.test.ts @@ -31,7 +31,7 @@ describe('ApplicationCharge resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262347, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": true, "created_at": "2022-10-03T12:20:20-04:00", "updated_at": "2022-10-03T12:20:20-04:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262347", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262347/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBAsxojw6EmF1dG9fYWN0aXZhdGVU--997306f5eeeafb34d59f4272303af853c6aa28da"}})); + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262349, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": true, "created_at": "2023-01-03T13:03:09-05:00", "updated_at": "2023-01-03T13:03:09-05:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262349", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262349/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA0xojw6EmF1dG9fYWN0aXZhdGVU--ea73480c6bd64f4002e70c5f128c1623aaa7991e"}})); const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; @@ -51,7 +51,7 @@ describe('ApplicationCharge resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262350, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": null, "created_at": "2022-10-03T12:20:27-04:00", "updated_at": "2022-10-03T12:20:27-04:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262350", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262350/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA4xojw6EmF1dG9fYWN0aXZhdGVU--ac057c7548ab2cf6b733606771fc47a03238e4ed"}})); + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262351, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": null, "created_at": "2023-01-03T13:03:15-05:00", "updated_at": "2023-01-03T13:03:15-05:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262351", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262351/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA8xojw6EmF1dG9fYWN0aXZhdGVU--9dad4a7611bec2f70cd0db8cc9157e15360188f0"}})); const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; @@ -70,17 +70,16 @@ describe('ApplicationCharge resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"application_charge": {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}})); + queueMockResponse(JSON.stringify({"application_charges": [{"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}, {"id": 556467234, "name": "Green theme", "api_client_id": 755357713, "price": "120.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "theme", "decorated_return_url": "http://google.com?charge_id=556467234"}, {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}]})); - await shopify.rest.ApplicationCharge.find({ + await shopify.rest.ApplicationCharge.all({ session: session, - id: 675931192, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/application_charges/675931192.json', + path: '/admin/api/2022-04/application_charges.json', query: '', headers, data: undefined @@ -88,7 +87,7 @@ describe('ApplicationCharge resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"application_charges": [{"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}, {"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}]})); + queueMockResponse(JSON.stringify({"application_charges": [{"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}, {"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}]})); await shopify.rest.ApplicationCharge.all({ session: session, @@ -106,16 +105,17 @@ describe('ApplicationCharge resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"application_charges": [{"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}, {"id": 556467234, "name": "Green theme", "api_client_id": 755357713, "price": "120.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": "theme", "decorated_return_url": "http://google.com?charge_id=556467234"}, {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}]})); + queueMockResponse(JSON.stringify({"application_charge": {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}})); - await shopify.rest.ApplicationCharge.all({ + await shopify.rest.ApplicationCharge.find({ session: session, + id: 675931192, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/application_charges.json', + path: '/admin/api/2022-04/application_charges/675931192.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/application_credit.test.ts b/rest/admin/__tests__/2022-04/application_credit.test.ts index ad239ea37..1066a5d7a 100644 --- a/rest/admin/__tests__/2022-04/application_credit.test.ts +++ b/rest/admin/__tests__/2022-04/application_credit.test.ts @@ -31,12 +31,11 @@ describe('ApplicationCredit resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636125, "amount": "5.00", "description": "application credit for refund", "test": true}})); + queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636125, "amount": "5.00", "description": "application credit for refund", "test": null}})); const application_credit = new shopify.rest.ApplicationCredit({session: session}); application_credit.description = "application credit for refund"; application_credit.amount = 5.0; - application_credit.test = true; await application_credit.save({}); expect({ @@ -45,16 +44,17 @@ describe('ApplicationCredit resource', () => { path: '/admin/api/2022-04/application_credits.json', query: '', headers, - data: { "application_credit": {"description": "application credit for refund", "amount": 5.0, "test": true} } + data: { "application_credit": {"description": "application credit for refund", "amount": 5.0} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636127, "amount": "5.00", "description": "application credit for refund", "test": null}})); + queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636129, "amount": "5.00", "description": "application credit for refund", "test": true}})); const application_credit = new shopify.rest.ApplicationCredit({session: session}); application_credit.description = "application credit for refund"; application_credit.amount = 5.0; + application_credit.test = true; await application_credit.save({}); expect({ @@ -63,7 +63,7 @@ describe('ApplicationCredit resource', () => { path: '/admin/api/2022-04/application_credits.json', query: '', headers, - data: { "application_credit": {"description": "application credit for refund", "amount": 5.0} } + data: { "application_credit": {"description": "application credit for refund", "amount": 5.0, "test": true} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/article.test.ts b/rest/admin/__tests__/2022-04/article.test.ts index 3a8e31f02..68f3005c4 100644 --- a/rest/admin/__tests__/2022-04/article.test.ts +++ b/rest/admin/__tests__/2022-04/article.test.ts @@ -31,194 +31,206 @@ describe('Article resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"articles": [{"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}]})); + queueMockResponse(JSON.stringify({"articles": [{"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}]})); await shopify.rest.Article.all({ session: session, blog_id: 241253187, - since_id: "134645308", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/blogs/241253187/articles.json', - query: 'since_id=134645308', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"articles": [{"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}]})); + queueMockResponse(JSON.stringify({"articles": [{"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}]})); await shopify.rest.Article.all({ session: session, blog_id: 241253187, + since_id: "134645308", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/blogs/241253187/articles.json', - query: '', + query: 'since_id=134645308', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"count": 4})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293785, "title": "My new Article title", "created_at": "2023-01-03T12:47:34-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:34-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293785"}})); - await shopify.rest.Article.count({ - session: session, - blog_id: 241253187, - }); + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + await article.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/blogs/241253187/articles/count.json', + path: '/admin/api/2022-04/blogs/241253187/articles.json', query: '', headers, - data: undefined + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293781, "title": "My new Article title", "created_at": "2023-01-03T12:47:18-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:18-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293781", "image": {"created_at": "2023-01-03T12:47:18-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768038"}}})); - await shopify.rest.Article.find({ - session: session, - blog_id: 241253187, - id: 134645308, - }); + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + }; + await article.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-04/blogs/241253187/articles.json', query: '', headers, - data: undefined + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "user_id": null, "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "updated_at": "2022-10-03T12:46:51-04:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293786, "title": "My new Article title", "created_at": "2023-01-03T12:47:51-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:52-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293786"}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.id = 134645308; - article.title = "My new Title"; - article.author = "Your name"; - article.tags = "Tags, Will Be, Updated"; - article.body_html = "

Look, I can even update through a web service.

"; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await article.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-04/blogs/241253187/articles.json', query: '', headers, - data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "updated_at": "2022-10-03T12:47:19-04:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:47:18-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20221003-23488-6gc29.gif?v=1664815639"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293788, "title": "My new Article title", "created_at": "2023-01-03T12:48:03-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:48:04-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293788", "image": {"created_at": "2023-01-03T12:48:03-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20230103-54493-87k83g.gif?v=1672768084"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.id = 134645308; - article.title = "My new Title"; - article.author = "Your name"; - article.tags = "Tags, Will Be, Updated"; - article.body_html = "

Look, I can even update through a web service.

"; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; article.image = { + "src": "http://example.com/rails_logo.gif", "alt": "Rails logo" }; await article.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-04/blogs/241253187/articles.json', query: '', headers, - data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"alt": "Rails logo"}} } + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": "2022-10-03T12:47:23-04:00", "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2022-10-03T12:47:23-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293784, "title": "My new Article title", "created_at": "2023-01-03T12:47:30-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": null, "updated_at": "2023-01-03T12:47:30-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293784"}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.id = 134645308; - article.published = true; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published = false; await article.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-04/blogs/241253187/articles.json', query: '', headers, - data: { "article": {"published": true} } + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published": false} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "updated_at": "2022-10-03T12:48:10-04:00", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:48:10-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1664815690"}}})); + queueMockResponse(JSON.stringify({"count": 4})); - const article = new shopify.rest.Article({session: session}); - article.blog_id = 241253187; - article.id = 134645308; - article.title = "My new Title"; - article.author = "Your name"; - article.tags = "Tags, Will Be, Updated"; - article.body_html = "

Look, I can even update through a web service.

"; - article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - article.image = { - "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9M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niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n" - }; - await article.save({}); + await shopify.rest.Article.count({ + session: session, + blog_id: 241253187, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-04/blogs/241253187/articles/count.json', query: '', headers, - data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENb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8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": null, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2022-10-03T12:48:53-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); - const article = new shopify.rest.Article({session: session}); - article.blog_id = 241253187; - article.id = 134645308; - article.published = false; - await article.save({}); + await shopify.rest.Article.find({ + session: session, + blog_id: 241253187, + id: 134645308, + }); expect({ - method: 'PUT', + method: 'GET', domain, path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2022-10-03T12:48:56-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2023-01-03T12:48:00-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; @@ -244,12 +256,12 @@ describe('Article resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "updated_at": "2022-10-03T12:49:00-04:00", "id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308"}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": null, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2023-01-03T12:48:14-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; article.id = 134645308; - article.image = ""; + article.published = false; await article.save({}); expect({ @@ -258,151 +270,139 @@ describe('Article resource', () => { path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"image": ""} } + data: { "article": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": "2023-01-03T12:47:11-05:00", "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2023-01-03T12:47:11-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); - await shopify.rest.Article.delete({ - session: session, - blog_id: 241253187, - id: 134645308, - }); + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.published = true; + await article.save({}); expect({ - method: 'DELETE', + method: 'PUT', domain, path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', query: '', headers, - data: undefined + data: { "article": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293784, "title": "My new Article title", "created_at": "2022-10-03T12:47:52-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:47:52-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293784", "image": {"created_at": "2022-10-03T12:47:52-04:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664815672"}}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "updated_at": "2023-01-03T12:47:43-05:00", "id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308"}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; - article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - article.image = { - "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" - }; + article.id = 134645308; + article.image = ""; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/blogs/241253187/articles.json', + path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}} } + data: { "article": {"image": ""} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293786, "title": "My new Article title", "created_at": "2022-10-03T12:48:37-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:48:37-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293786"}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "updated_at": "2023-01-03T12:48:33-05:00", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:48:33-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672768113"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - article.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + article.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyO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+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n" + }; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/blogs/241253187/articles.json', + path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrO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QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"}} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293787, "title": "My new Article title", "created_at": "2022-10-03T12:48:40-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": null, "updated_at": "2022-10-03T12:48:40-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293787"}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "user_id": null, "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "updated_at": "2023-01-03T12:47:47-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; - article.published = false; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/blogs/241253187/articles.json', + path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published": false} } + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293788, "title": "My new Article title", "created_at": "2022-10-03T12:48:48-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:48:49-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293788", "image": {"created_at": "2022-10-03T12:48:49-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20221003-23488-ryyw9l.gif?v=1664815729"}}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "updated_at": "2023-01-03T12:48:40-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:48:40-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20230103-54493-qvpb1u.gif?v=1672768120"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; article.image = { - "src": "http://example.com/rails_logo.gif", "alt": "Rails logo" }; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/blogs/241253187/articles.json', + path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails logo"}} } + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293792, "title": "My new Article title", "created_at": "2022-10-03T12:49:40-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:49:40-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293792"}})); + queueMockResponse(JSON.stringify({})); - const article = new shopify.rest.Article({session: session}); - article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; - article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - await article.save({}); + await shopify.rest.Article.delete({ + session: session, + blog_id: 241253187, + id: 134645308, + }); expect({ - method: 'POST', + method: 'DELETE', domain, - path: '/admin/api/2022-04/blogs/241253187/articles.json', + path: '/admin/api/2022-04/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + data: undefined }).toMatchMadeHttpRequest(); }); @@ -424,74 +424,74 @@ describe('Article resource', () => { }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); await shopify.rest.Article.tags({ session: session, - limit: "1", - popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/articles/tags.json', - query: 'limit=1&popular=1', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); await shopify.rest.Article.tags({ session: session, + limit: "1", + popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/articles/tags.json', - query: '', + query: 'limit=1&popular=1', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); await shopify.rest.Article.tags({ session: session, blog_id: 241253187, - limit: "1", - popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/blogs/241253187/articles/tags.json', - query: 'limit=1&popular=1', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); await shopify.rest.Article.tags({ session: session, blog_id: 241253187, + limit: "1", + popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/blogs/241253187/articles/tags.json', - query: '', + query: 'limit=1&popular=1', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-04/asset.test.ts b/rest/admin/__tests__/2022-04/asset.test.ts index a20260907..53d4d0f95 100644 --- a/rest/admin/__tests__/2022-04/asset.test.ts +++ b/rest/admin/__tests__/2022-04/asset.test.ts @@ -49,12 +49,12 @@ describe('Asset resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "layout/alternate.liquid", "public_url": null, "created_at": "2022-10-03T13:22:25-04:00", "updated_at": "2022-10-03T13:22:25-04:00", "content_type": "application/x-liquid", "size": 3049, "checksum": "1879a06996941b2ff1ff485a1fe60a97", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2023-01-03T12:39:59-05:00", "content_type": "application/x-liquid", "size": 110, "checksum": "cd71db2e14df976c8aa44b44c8dae77b", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; - asset.key = "layout/alternate.liquid"; - asset.source_key = "layout/theme.liquid"; + asset.key = "templates/index.liquid"; + asset.value = "

We are busy updating the store for you and will be back within the hour.

"; await asset.save({}); expect({ @@ -63,12 +63,12 @@ describe('Asset resource', () => { path: '/admin/api/2022-04/themes/828155753/assets.json', query: '', headers, - data: { "asset": {"key": "layout/alternate.liquid", "source_key": "layout/theme.liquid"} } + data: { "asset": {"key": "templates/index.liquid", "value": "

We are busy updating the store for you and will be back within the hour.

"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "assets/empty.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/empty.gif?v=1664817747", "created_at": "2022-10-03T13:22:27-04:00", "updated_at": "2022-10-03T13:22:27-04:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "assets/empty.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/empty.gif?v=1672767606", "created_at": "2023-01-03T12:40:06-05:00", "updated_at": "2023-01-03T12:40:06-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; @@ -87,12 +87,12 @@ describe('Asset resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2022-10-03T13:22:28-04:00", "content_type": "application/x-liquid", "size": 110, "checksum": "cd71db2e14df976c8aa44b44c8dae77b", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1672767597", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2023-01-03T12:39:57-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; - asset.key = "templates/index.liquid"; - asset.value = "

We are busy updating the store for you and will be back within the hour.

"; + asset.key = "assets/bg-body.gif"; + asset.src = "http://example.com/new_bg.gif"; await asset.save({}); expect({ @@ -101,17 +101,17 @@ describe('Asset resource', () => { path: '/admin/api/2022-04/themes/828155753/assets.json', query: '', headers, - data: { "asset": {"key": "templates/index.liquid", "value": "

We are busy updating the store for you and will be back within the hour.

"} } + data: { "asset": {"key": "assets/bg-body.gif", "src": "http://example.com/new_bg.gif"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1664817751", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2022-10-03T13:22:31-04:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "layout/alternate.liquid", "public_url": null, "created_at": "2023-01-03T12:40:04-05:00", "updated_at": "2023-01-03T12:40:04-05:00", "content_type": "application/x-liquid", "size": 3049, "checksum": "1879a06996941b2ff1ff485a1fe60a97", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; - asset.key = "assets/bg-body.gif"; - asset.src = "http://example.com/new_bg.gif"; + asset.key = "layout/alternate.liquid"; + asset.source_key = "layout/theme.liquid"; await asset.save({}); expect({ @@ -120,7 +120,7 @@ describe('Asset resource', () => { path: '/admin/api/2022-04/themes/828155753/assets.json', query: '', headers, - data: { "asset": {"key": "assets/bg-body.gif", "src": "http://example.com/new_bg.gif"} } + data: { "asset": {"key": "layout/alternate.liquid", "source_key": "layout/theme.liquid"} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/assigned_fulfillment_order.test.ts b/rest/admin/__tests__/2022-04/assigned_fulfillment_order.test.ts index f619b412b..bb1a3caf9 100644 --- a/rest/admin/__tests__/2022-04/assigned_fulfillment_order.test.ts +++ b/rest/admin/__tests__/2022-04/assigned_fulfillment_order.test.ts @@ -31,7 +31,7 @@ describe('AssignedFulfillmentOrder resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000777, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000777, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737481, "shop_id": 548380009, "fulfillment_order_id": 1046000777, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}}]})); + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000830, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000821, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737568, "shop_id": 548380009, "fulfillment_order_id": 1046000830, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}}]})); await shopify.rest.AssignedFulfillmentOrder.all({ session: session, diff --git a/rest/admin/__tests__/2022-04/blog.test.ts b/rest/admin/__tests__/2022-04/blog.test.ts index c3af291b7..4e883092f 100644 --- a/rest/admin/__tests__/2022-04/blog.test.ts +++ b/rest/admin/__tests__/2022-04/blog.test.ts @@ -31,7 +31,7 @@ describe('Blog resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}]})); + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}]})); await shopify.rest.Blog.all({ session: session, @@ -48,7 +48,7 @@ describe('Blog resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 1008414250, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2022-10-11T13:03:48-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:48-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414250"}]})); + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 1008414253, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:27-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:27-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414253"}]})); await shopify.rest.Blog.all({ session: session, @@ -66,18 +66,10 @@ describe('Blog resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 1008414248, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2022-10-11T13:03:41-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:41-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414248"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 1008414251, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:18-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:18-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414251"}})); const blog = new shopify.rest.Blog({session: session}); blog.title = "Apple main blog"; - blog.metafields = [ - { - "key": "sponsor", - "value": "Shopify", - "type": "single_line_text_field", - "namespace": "global" - } - ]; await blog.save({}); expect({ @@ -86,15 +78,23 @@ describe('Blog resource', () => { path: '/admin/api/2022-04/blogs.json', query: '', headers, - data: { "blog": {"title": "Apple main blog", "metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "blog": {"title": "Apple main blog"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 1008414253, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2022-10-11T13:04:01-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:04:01-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414253"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 1008414254, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:35-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:34-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414254"}})); const blog = new shopify.rest.Blog({session: session}); blog.title = "Apple main blog"; + blog.metafields = [ + { + "key": "sponsor", + "value": "Shopify", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await blog.save({}); expect({ @@ -103,7 +103,7 @@ describe('Blog resource', () => { path: '/admin/api/2022-04/blogs.json', query: '', headers, - data: { "blog": {"title": "Apple main blog"} } + data: { "blog": {"title": "Apple main blog", "metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); @@ -125,44 +125,44 @@ describe('Blog resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "title": "Mah Blog"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); await shopify.rest.Blog.find({ session: session, id: 241253187, - fields: "id,title", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/blogs/241253187.json', - query: 'fields=id%2Ctitle', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "title": "Mah Blog"}})); await shopify.rest.Blog.find({ session: session, id: 241253187, + fields: "id,title", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/blogs/241253187.json', - query: '', + query: 'fields=id%2Ctitle', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"blog": {"title": "Mah Blog", "handle": "apple-blog", "id": 241253187, "updated_at": "2022-10-11T13:03:39-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"title": "Mah Blog", "handle": "apple-blog", "id": 241253187, "updated_at": "2023-01-03T12:45:58-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); const blog = new shopify.rest.Blog({session: session}); blog.id = 241253187; @@ -187,7 +187,7 @@ describe('Blog resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "apple-blog", "id": 241253187, "updated_at": "2022-10-11T13:03:45-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "apple-blog", "id": 241253187, "updated_at": "2023-01-03T12:46:23-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); const blog = new shopify.rest.Blog({session: session}); blog.id = 241253187; @@ -205,7 +205,7 @@ describe('Blog resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate", "id": 241253187, "updated_at": "2022-10-11T13:03:46-04:00", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate", "id": 241253187, "updated_at": "2023-01-03T12:46:11-05:00", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); const blog = new shopify.rest.Blog({session: session}); blog.id = 241253187; diff --git a/rest/admin/__tests__/2022-04/cancellation_request.test.ts b/rest/admin/__tests__/2022-04/cancellation_request.test.ts index 107ee304c..423796d2a 100644 --- a/rest/admin/__tests__/2022-04/cancellation_request.test.ts +++ b/rest/admin/__tests__/2022-04/cancellation_request.test.ts @@ -31,17 +31,17 @@ describe('CancellationRequest resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000778, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000778, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737482, "shop_id": 548380009, "fulfillment_order_id": 1046000778, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000808, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737539, "shop_id": 548380009, "fulfillment_order_id": 1046000808, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const cancellation_request = new shopify.rest.CancellationRequest({session: session}); - cancellation_request.fulfillment_order_id = 1046000778; + cancellation_request.fulfillment_order_id = 1046000808; cancellation_request.message = "The customer changed his mind."; await cancellation_request.save({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000778/cancellation_request.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000808/cancellation_request.json', query: '', headers, data: { "cancellation_request": {"message": "The customer changed his mind."} } @@ -49,10 +49,10 @@ describe('CancellationRequest resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000779, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_accepted", "status": "cancelled", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000779, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737483, "shop_id": 548380009, "fulfillment_order_id": 1046000779, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000806, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_accepted", "status": "cancelled", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000798, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737537, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const cancellation_request = new shopify.rest.CancellationRequest({session: session}); - cancellation_request.fulfillment_order_id = 1046000779; + cancellation_request.fulfillment_order_id = 1046000806; await cancellation_request.accept({ body: {"cancellation_request": {"message": "We had not started any processing yet."}}, }); @@ -60,7 +60,7 @@ describe('CancellationRequest resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000779/cancellation_request/accept.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000806/cancellation_request/accept.json', query: '', headers, data: { "cancellation_request": {"message": "We had not started any processing yet."} } @@ -68,10 +68,10 @@ describe('CancellationRequest resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000780, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_rejected", "status": "in_progress", "supported_actions": [], "destination": {"id": 1046000780, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737484, "shop_id": 548380009, "fulfillment_order_id": 1046000780, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000807, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_rejected", "status": "in_progress", "supported_actions": [], "destination": {"id": 1046000799, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737538, "shop_id": 548380009, "fulfillment_order_id": 1046000807, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const cancellation_request = new shopify.rest.CancellationRequest({session: session}); - cancellation_request.fulfillment_order_id = 1046000780; + cancellation_request.fulfillment_order_id = 1046000807; await cancellation_request.reject({ body: {"cancellation_request": {"message": "We have already send the shipment out."}}, }); @@ -79,7 +79,7 @@ describe('CancellationRequest resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000780/cancellation_request/reject.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000807/cancellation_request/reject.json', query: '', headers, data: { "cancellation_request": {"message": "We have already send the shipment out."} } diff --git a/rest/admin/__tests__/2022-04/carrier_service.test.ts b/rest/admin/__tests__/2022-04/carrier_service.test.ts index b07dce228..8b49d8ee0 100644 --- a/rest/admin/__tests__/2022-04/carrier_service.test.ts +++ b/rest/admin/__tests__/2022-04/carrier_service.test.ts @@ -31,7 +31,7 @@ describe('CarrierService resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"carrier_service": {"id": 1067451814, "name": "Shipping Rate Provider", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451814", "format": "json", "callback_url": "http://shipping.example.com/"}})); + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894957, "name": "Shipping Rate Provider", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894957", "format": "json", "callback_url": "http://shipping.example.com/"}})); const carrier_service = new shopify.rest.CarrierService({session: session}); carrier_service.name = "Shipping Rate Provider"; @@ -50,7 +50,7 @@ describe('CarrierService resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"carrier_services": [{"id": 1067451817, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451817", "format": "json", "callback_url": "http://example.com/"}, {"id": 260046840, "name": "ups_shipping", "active": true, "service_discovery": true, "carrier_service_type": "legacy", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/260046840"}]})); + queueMockResponse(JSON.stringify({"carrier_services": [{"id": 1036894958, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894958", "format": "json", "callback_url": "http://example.com/"}, {"id": 260046840, "name": "ups_shipping", "active": true, "service_discovery": true, "carrier_service_type": "legacy", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/260046840"}]})); await shopify.rest.CarrierService.all({ session: session, @@ -67,10 +67,10 @@ describe('CarrierService resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"carrier_service": {"active": false, "id": 1067451815, "name": "Some new name", "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451815", "format": "json", "callback_url": "http://example.com/"}})); + queueMockResponse(JSON.stringify({"carrier_service": {"active": false, "id": 1036894955, "name": "Some new name", "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894955", "format": "json", "callback_url": "http://example.com/"}})); const carrier_service = new shopify.rest.CarrierService({session: session}); - carrier_service.id = 1067451815; + carrier_service.id = 1036894955; carrier_service.name = "Some new name"; carrier_service.active = false; await carrier_service.save({}); @@ -78,7 +78,7 @@ describe('CarrierService resource', () => { expect({ method: 'PUT', domain, - path: '/admin/api/2022-04/carrier_services/1067451815.json', + path: '/admin/api/2022-04/carrier_services/1036894955.json', query: '', headers, data: { "carrier_service": {"name": "Some new name", "active": false} } @@ -86,17 +86,17 @@ describe('CarrierService resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"carrier_service": {"id": 1067451816, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451816", "format": "json", "callback_url": "http://example.com/"}})); + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894954, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894954", "format": "json", "callback_url": "http://example.com/"}})); await shopify.rest.CarrierService.find({ session: session, - id: 1067451816, + id: 1036894954, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/carrier_services/1067451816.json', + path: '/admin/api/2022-04/carrier_services/1036894954.json', query: '', headers, data: undefined @@ -108,13 +108,13 @@ describe('CarrierService resource', () => { await shopify.rest.CarrierService.delete({ session: session, - id: 1067451812, + id: 1036894959, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/carrier_services/1067451812.json', + path: '/admin/api/2022-04/carrier_services/1036894959.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/checkout.test.ts b/rest/admin/__tests__/2022-04/checkout.test.ts index bffaca88e..a2b489e6b 100644 --- a/rest/admin/__tests__/2022-04/checkout.test.ts +++ b/rest/admin/__tests__/2022-04/checkout.test.ts @@ -31,10 +31,15 @@ describe('Checkout resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2022-10-03T12:24:56-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339458, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "me@example.com", "legal_notice_url": null, "location_id": null, "name": "#1066348319", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "8fa96ad154739bb205a00fab92a6cbb4", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2022-10-03T12:24:56-04:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/8fa96ad154739bb205a00fab92a6cbb4", "total_duties": null, "total_additional_fees": null, "line_items": [], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2023-01-03T12:41:32-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": null, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": null, "legal_notice_url": null, "location_id": null, "name": "#1066348317", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "995.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "995.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "c3b86d7cdfaf5a4d1bf89efbbe88789e", "total_price": "995.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "995.00", "updated_at": "2023-01-03T12:41:32-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/c3b86d7cdfaf5a4d1bf89efbbe88789e", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "e8a51fbe23cff8fcad2766f024a761d6", "key": "e8a51fbe23cff8fcad2766f024a761d6", "product_id": 632910392, "variant_id": 39072856, "sku": "IPOD2008GREEN", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Green", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "995.00", "properties": {}, "quantity": 5, "grams": 567, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); - checkout.email = "me@example.com"; + checkout.line_items = [ + { + "variant_id": 39072856, + "quantity": 5 + } + ]; await checkout.save({}); expect({ @@ -43,20 +48,15 @@ describe('Checkout resource', () => { path: '/admin/api/2022-04/checkouts.json', query: '', headers, - data: { "checkout": {"email": "me@example.com"} } + data: { "checkout": {"line_items": [{"variant_id": 39072856, "quantity": 5}]} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2022-10-03T12:25:20-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": null, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": null, "legal_notice_url": null, "location_id": null, "name": "#1066348320", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "995.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "995.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "d0c540d493f50196bbdf010794a53b9d", "total_price": "995.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "995.00", "updated_at": "2022-10-03T12:25:20-04:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/d0c540d493f50196bbdf010794a53b9d", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "4b03a6477a2646f2bef85f95822a6615", "key": "4b03a6477a2646f2bef85f95822a6615", "product_id": 632910392, "variant_id": 39072856, "sku": "IPOD2008GREEN", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Green", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "995.00", "properties": {}, "quantity": 5, "grams": 567, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2023-01-03T12:41:50-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339479, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "me@example.com", "legal_notice_url": null, "location_id": null, "name": "#1066348318", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "8a8043ef00104a4738ba3a235cd2441b", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2023-01-03T12:41:50-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/8a8043ef00104a4738ba3a235cd2441b", "total_duties": null, "total_additional_fees": null, "line_items": [], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); - checkout.line_items = [ - { - "variant_id": 39072856, - "quantity": 5 - } - ]; + checkout.email = "me@example.com"; await checkout.save({}); expect({ @@ -65,12 +65,12 @@ describe('Checkout resource', () => { path: '/admin/api/2022-04/checkouts.json', query: '', headers, - data: { "checkout": {"line_items": [{"variant_id": 39072856, "quantity": 5}]} } + data: { "checkout": {"email": "me@example.com"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#86568385", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "b490a9220cd14d7344024f4874f640a6", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2022-10-03T12:25:25-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/b490a9220cd14d7344024f4874f640a6", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": 49148385, "key": 49148385, "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": false, "gift_card": false, "price": "0.00", "compare_at_price": null, "line_price": "0.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#86568385", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "b490a9220cd14d7344024f4874f640a6", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2023-01-03T12:41:10-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/b490a9220cd14d7344024f4874f640a6", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": 49148385, "key": 49148385, "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": false, "gift_card": false, "price": "0.00", "compare_at_price": null, "line_price": "0.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); checkout.token = "b490a9220cd14d7344024f4874f640a6"; @@ -87,7 +87,7 @@ describe('Checkout resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": "2005-07-31T11:57:11-04:00", "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#901414060", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": 450789469, "order_status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you", "order": {"id": 450789469, "name": "#1001", "status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you"}, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": "2005-07-31T11:57:11-04:00", "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#901414060", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": 450789469, "order_status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you", "order": {"id": 450789469, "name": "#1001", "status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you"}, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); await shopify.rest.Checkout.find({ session: session, @@ -105,17 +105,17 @@ describe('Checkout resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); await shopify.rest.Checkout.find({ session: session, - token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + token: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', + path: '/admin/api/2022-04/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x.json', query: '', headers, data: undefined @@ -123,17 +123,17 @@ describe('Checkout resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); await shopify.rest.Checkout.find({ session: session, - token: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x.json', + path: '/admin/api/2022-04/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', query: '', headers, data: undefined @@ -141,7 +141,7 @@ describe('Checkout resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2022-10-03T12:25:06-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:41:57-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; @@ -161,7 +161,7 @@ describe('Checkout resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339459, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "john.smith@example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2022-10-03T12:25:22-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "John", "last_name": "Smith", "phone": "(123)456-7890", "company": null, "address1": "126 York St.", "address2": "", "city": "Los Angeles", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "90002"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339478, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "john.smith@example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:41:43-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "John", "last_name": "Smith", "phone": "(123)456-7890", "company": null, "address1": "126 York St.", "address2": "", "city": "Los Angeles", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "90002"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; @@ -189,17 +189,17 @@ describe('Checkout resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"shipping_rates": []})); + queueMockResponse(JSON.stringify({"shipping_rates": [{"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "checkout": {"total_tax": "0.00", "total_price": "398.00", "subtotal_price": "398.00"}, "phone_required": false, "delivery_range": null, "estimated_time_in_transit": null, "handle": "shopify-Free%20Shipping-0.00"}]})); await shopify.rest.Checkout.shipping_rates({ session: session, - token: "zs9ru89kuqcdagk8bz4r9hnxt22wwd42", + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/checkouts/zs9ru89kuqcdagk8bz4r9hnxt22wwd42/shipping_rates.json', + path: '/admin/api/2022-04/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', query: '', headers, data: undefined @@ -225,17 +225,17 @@ describe('Checkout resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"shipping_rates": [{"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "checkout": {"total_tax": "0.00", "total_price": "398.00", "subtotal_price": "398.00"}, "phone_required": false, "delivery_range": null, "estimated_time_in_transit": null, "handle": "shopify-Free%20Shipping-0.00"}]})); + queueMockResponse(JSON.stringify({"shipping_rates": []})); await shopify.rest.Checkout.shipping_rates({ session: session, - token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + token: "zs9ru89kuqcdagk8bz4r9hnxt22wwd42", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', + path: '/admin/api/2022-04/checkouts/zs9ru89kuqcdagk8bz4r9hnxt22wwd42/shipping_rates.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/collect.test.ts b/rest/admin/__tests__/2022-04/collect.test.ts index bda19a2fe..aaa5b08a3 100644 --- a/rest/admin/__tests__/2022-04/collect.test.ts +++ b/rest/admin/__tests__/2022-04/collect.test.ts @@ -31,7 +31,7 @@ describe('Collect resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"collect": {"id": 1071559580, "collection_id": 841564295, "product_id": 921728736, "created_at": "2022-10-03T13:19:30-04:00", "updated_at": "2022-10-03T13:19:30-04:00", "position": 2, "sort_value": "0000000002"}})); + queueMockResponse(JSON.stringify({"collect": {"id": 1071559576, "collection_id": 841564295, "product_id": 921728736, "created_at": "2023-01-03T12:45:21-05:00", "updated_at": "2023-01-03T12:45:21-05:00", "position": 2, "sort_value": "0000000002"}})); const collect = new shopify.rest.Collect({session: session}); collect.product_id = 921728736; @@ -49,17 +49,16 @@ describe('Collect resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 800915878, "collection_id": 482865238, "product_id": 921728736, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); - await shopify.rest.Collect.delete({ + await shopify.rest.Collect.all({ session: session, - id: 455204334, }); expect({ - method: 'DELETE', + method: 'GET', domain, - path: '/admin/api/2022-04/collects/455204334.json', + path: '/admin/api/2022-04/collects.json', query: '', headers, data: undefined @@ -67,18 +66,18 @@ describe('Collect resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"collect": {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}})); + queueMockResponse(JSON.stringify({"collects": [{"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 1071559574, "collection_id": 841564295, "product_id": 921728736, "created_at": "2023-01-03T12:45:12-05:00", "updated_at": "2023-01-03T12:45:12-05:00", "position": 2, "sort_value": "0000000002"}]})); - await shopify.rest.Collect.find({ + await shopify.rest.Collect.all({ session: session, - id: 455204334, + collection_id: "841564295", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/collects/455204334.json', - query: '', + path: '/admin/api/2022-04/collects.json', + query: 'collection_id=841564295', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -103,16 +102,17 @@ describe('Collect resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 800915878, "collection_id": 482865238, "product_id": 921728736, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); + queueMockResponse(JSON.stringify({})); - await shopify.rest.Collect.all({ + await shopify.rest.Collect.delete({ session: session, + id: 455204334, }); expect({ - method: 'GET', + method: 'DELETE', domain, - path: '/admin/api/2022-04/collects.json', + path: '/admin/api/2022-04/collects/455204334.json', query: '', headers, data: undefined @@ -120,54 +120,53 @@ describe('Collect resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"collects": [{"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 1071559581, "collection_id": 841564295, "product_id": 921728736, "created_at": "2022-10-03T13:19:33-04:00", "updated_at": "2022-10-03T13:19:33-04:00", "position": 2, "sort_value": "0000000002"}]})); + queueMockResponse(JSON.stringify({"collect": {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}})); - await shopify.rest.Collect.all({ + await shopify.rest.Collect.find({ session: session, - collection_id: "841564295", + id: 455204334, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/collects.json', - query: 'collection_id=841564295', + path: '/admin/api/2022-04/collects/455204334.json', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"count": 2})); await shopify.rest.Collect.count({ session: session, - collection_id: "841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/collects/count.json', - query: 'collection_id=841564295', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"count": 2})); + queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Collect.count({ session: session, - product_id: "632910392", + collection_id: "841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/collects/count.json', - query: 'product_id=632910392', + query: 'collection_id=841564295', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -178,13 +177,14 @@ describe('Collect resource', () => { await shopify.rest.Collect.count({ session: session, + product_id: "632910392", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/collects/count.json', - query: '', + query: 'product_id=632910392', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-04/collection.test.ts b/rest/admin/__tests__/2022-04/collection.test.ts index 4bf0f65f6..d468cdef2 100644 --- a/rest/admin/__tests__/2022-04/collection.test.ts +++ b/rest/admin/__tests__/2022-04/collection.test.ts @@ -31,7 +31,7 @@ describe('Collection resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "collection_type": "custom", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "collection_type": "custom", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); await shopify.rest.Collection.find({ session: session, @@ -49,7 +49,7 @@ describe('Collection resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-10-03T12:15:55-04:00", "handle": "ipod-nano", "updated_at": "2022-10-03T12:15:55-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:21:36-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:21:36-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); await shopify.rest.Collection.products({ session: session, diff --git a/rest/admin/__tests__/2022-04/collection_listing.test.ts b/rest/admin/__tests__/2022-04/collection_listing.test.ts index 0ed8ee1af..e35b794fa 100644 --- a/rest/admin/__tests__/2022-04/collection_listing.test.ts +++ b/rest/admin/__tests__/2022-04/collection_listing.test.ts @@ -31,7 +31,7 @@ describe('CollectionListing resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"collection_listings": [{"collection_id": 482865238, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 841564295, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "IPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 395646240, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever. Again

", "default_product_image": {"id": 850703190, "created_at": "2022-10-03T13:07:13-04:00", "position": 1, "updated_at": "2022-10-03T13:07:13-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664816833", "variant_ids": [], "width": 123, "height": 456}, "handle": "ipods_two", "image": null, "title": "IPods Two", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 691652237, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

No ipods here

", "default_product_image": null, "handle": "non-ipods", "image": null, "title": "Non Ipods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}]})); + queueMockResponse(JSON.stringify({"collection_listings": [{"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 841564295, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "IPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 395646240, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever. Again

", "default_product_image": {"id": 850703190, "created_at": "2023-01-03T12:56:35-05:00", "position": 1, "updated_at": "2023-01-03T12:56:35-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "width": 123, "height": 456}, "handle": "ipods_two", "image": null, "title": "IPods Two", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 691652237, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

No ipods here

", "default_product_image": null, "handle": "non-ipods", "image": null, "title": "Non Ipods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}]})); await shopify.rest.CollectionListing.all({ session: session, @@ -66,7 +66,7 @@ describe('CollectionListing resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); await shopify.rest.CollectionListing.find({ session: session, @@ -84,7 +84,7 @@ describe('CollectionListing resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); const collection_listing = new shopify.rest.CollectionListing({session: session}); collection_listing.collection_id = 482865238; diff --git a/rest/admin/__tests__/2022-04/comment.test.ts b/rest/admin/__tests__/2022-04/comment.test.ts index 1bf79bd95..c8de52b38 100644 --- a/rest/admin/__tests__/2022-04/comment.test.ts +++ b/rest/admin/__tests__/2022-04/comment.test.ts @@ -31,43 +31,44 @@ describe('Comment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, - article_id: "134645308", - blog_id: "241253187", + since_id: "118373535", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/comments.json', - query: 'article_id=134645308&blog_id=241253187', + query: 'since_id=118373535', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, + article_id: "134645308", + blog_id: "241253187", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/comments.json', - query: '', + query: 'article_id=134645308&blog_id=241253187', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, @@ -85,18 +86,17 @@ describe('Comment resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, - since_id: "118373535", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/comments.json', - query: 'since_id=118373535', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -157,7 +157,7 @@ describe('Comment resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"comment": {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}})); + queueMockResponse(JSON.stringify({"comment": {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}})); await shopify.rest.Comment.find({ session: session, @@ -175,14 +175,14 @@ describe('Comment resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"comment": {"author": "Your new name", "body": "You can even update through a web service.", "email": "your@updated-email.com", "published_at": "2022-10-03T13:05:08-04:00", "id": 118373535, "body_html": "

You can even update through a web service.

", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:08-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"}})); + queueMockResponse(JSON.stringify({"comment": {"author": "Your new name", "body": "You can even update through a web service.", "email": "your@updated-email.com", "published_at": "2023-01-03T12:06:05-05:00", "id": 118373535, "body_html": "

You can even update through a web service.

", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:06-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"}})); const comment = new shopify.rest.Comment({session: session}); comment.id = 118373535; comment.body = "You can even update through a web service."; comment.author = "Your new name"; comment.email = "your@updated-email.com"; - comment.published_at = "2022-10-03T17:05:08.150Z"; + comment.published_at = "2023-01-03T17:06:05.929Z"; await comment.save({}); expect({ @@ -191,12 +191,12 @@ describe('Comment resource', () => { path: '/admin/api/2022-04/comments/118373535.json', query: '', headers, - data: { "comment": {"body": "You can even update through a web service.", "author": "Your new name", "email": "your@updated-email.com", "published_at": "2022-10-03T17:05:08.150Z"} } + data: { "comment": {"body": "You can even update through a web service.", "author": "Your new name", "email": "your@updated-email.com", "published_at": "2023-01-03T17:06:05.929Z"} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"comment": {"id": 757536352, "body": "I like comments\nAnd I like posting them *RESTfully*.", "body_html": "

I like comments
\nAnd I like posting them RESTfully.

", "author": "Your name", "email": "your@email.com", "status": "pending", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T13:05:29-04:00", "updated_at": "2022-10-03T13:05:29-04:00", "ip": "107.20.160.121", "user_agent": null, "published_at": null}})); + queueMockResponse(JSON.stringify({"comment": {"id": 757536352, "body": "I like comments\nAnd I like posting them *RESTfully*.", "body_html": "

I like comments
\nAnd I like posting them RESTfully.

", "author": "Your name", "email": "your@email.com", "status": "pending", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:06:09-05:00", "updated_at": "2023-01-03T12:06:09-05:00", "ip": "107.20.160.121", "user_agent": null, "published_at": null}})); const comment = new shopify.rest.Comment({session: session}); comment.body = "I like comments\nAnd I like posting them *RESTfully*."; @@ -218,7 +218,7 @@ describe('Comment resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"published_at": null, "status": "spam", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:02-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": null, "status": "spam", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:59-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -235,7 +235,7 @@ describe('Comment resource', () => { }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"published_at": "2022-10-03T13:05:06-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:06-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:06:19-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:19-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -252,7 +252,7 @@ describe('Comment resource', () => { }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"published_at": "2022-10-03T13:05:53-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:53-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:06:30-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:30-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -269,7 +269,7 @@ describe('Comment resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"published_at": null, "status": "removed", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:04-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": null, "status": "removed", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:12-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -286,7 +286,7 @@ describe('Comment resource', () => { }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"published_at": "2022-10-03T13:05:15-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:15-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:05:56-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:56-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; diff --git a/rest/admin/__tests__/2022-04/country.test.ts b/rest/admin/__tests__/2022-04/country.test.ts index 1771292b9..e495e2ffb 100644 --- a/rest/admin/__tests__/2022-04/country.test.ts +++ b/rest/admin/__tests__/2022-04/country.test.ts @@ -31,41 +31,76 @@ describe('Country resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"countries": [{"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}, {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}]})); + queueMockResponse(JSON.stringify({"countries": [{"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}, {"id": 359115488, "name": "Colombia", "code": "CO", "tax_name": "VAT", "tax": 0.15, "provinces": []}, {"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}]})); await shopify.rest.Country.all({ session: session, - since_id: "359115488", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/countries.json', - query: 'since_id=359115488', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"countries": [{"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}, {"id": 359115488, "name": "Colombia", "code": "CO", "tax_name": "VAT", "tax": 0.15, "provinces": []}, {"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}]})); + queueMockResponse(JSON.stringify({"countries": [{"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}, {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}]})); await shopify.rest.Country.all({ session: session, + since_id: "359115488", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/countries.json', - query: '', + query: 'since_id=359115488', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 1070231511, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/countries.json', + query: '', + headers, + data: { "country": {"code": "FR"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 1070231510, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + country.tax = 0.2; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/countries.json', + query: '', + headers, + data: { "country": {"code": "FR", "tax": 0.2} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.Country.count({ @@ -82,7 +117,7 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_4', async () => { + it('test_6', async () => { queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); await shopify.rest.Country.find({ @@ -100,7 +135,7 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { + it('test_7', async () => { queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"country_id": 879921427, "tax_name": "Tax", "id": 205434194, "name": "Alberta", "code": "AB", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 170405627, "name": "British Columbia", "code": "BC", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 342345110, "name": "Manitoba", "code": "MB", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 92264567, "name": "New Brunswick", "code": "NB", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 243284171, "name": "Newfoundland", "code": "NL", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 439598329, "name": "Northwest Territories", "code": "NT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 448070559, "name": "Nova Scotia", "code": "NS", "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 670206421, "name": "Nunavut", "code": "NU", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 702530425, "name": "Ontario", "code": "ON", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 570891722, "name": "Prince Edward Island", "code": "PE", "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 473391800, "name": "Saskatchewan", "code": "SK", "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 1005264686, "name": "Yukon", "code": "YT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); const country = new shopify.rest.Country({session: session}); @@ -118,7 +153,7 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { + it('test_8', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Country.delete({ @@ -136,39 +171,4 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { - queueMockResponse(JSON.stringify({"country": {"id": 1070231510, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); - - const country = new shopify.rest.Country({session: session}); - country.code = "FR"; - await country.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-04/countries.json', - query: '', - headers, - data: { "country": {"code": "FR"} } - }).toMatchMadeHttpRequest(); - }); - - it('test_8', async () => { - queueMockResponse(JSON.stringify({"country": {"id": 1070231511, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); - - const country = new shopify.rest.Country({session: session}); - country.code = "FR"; - country.tax = 0.2; - await country.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-04/countries.json', - query: '', - headers, - data: { "country": {"code": "FR", "tax": 0.2} } - }).toMatchMadeHttpRequest(); - }); - }); diff --git a/rest/admin/__tests__/2022-04/custom_collection.test.ts b/rest/admin/__tests__/2022-04/custom_collection.test.ts index 12a5c49cd..69df55e61 100644 --- a/rest/admin/__tests__/2022-04/custom_collection.test.ts +++ b/rest/admin/__tests__/2022-04/custom_collection.test.ts @@ -31,238 +31,253 @@ describe('CustomCollection resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); await shopify.rest.CustomCollection.all({ session: session, + ids: "395646240,691652237,841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/custom_collections.json', - query: '', + query: 'ids=395646240%2C691652237%2C841564295', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); await shopify.rest.CustomCollection.all({ session: session, - ids: "395646240,691652237,841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/custom_collections.json', - query: 'ids=395646240%2C691652237%2C841564295', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 1063001346, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:05:21-05:00", "body_html": null, "published_at": "2023-01-03T13:05:21-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001346"}]})); await shopify.rest.CustomCollection.all({ session: session, - product_id: "632910392", + since_id: "841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/custom_collections.json', - query: 'product_id=632910392', + query: 'since_id=841564295', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 1063001328, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:24:03-04:00", "body_html": null, "published_at": "2022-10-03T12:24:03-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001328"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}]})); await shopify.rest.CustomCollection.all({ session: session, - since_id: "841564295", + product_id: "632910392", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/custom_collections.json', - query: 'since_id=841564295', + query: 'product_id=632910392', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001313, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:10-04:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001313"}})); + queueMockResponse(JSON.stringify({"count": 3})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; - custom_collection.published = false; - await custom_collection.save({}); + await shopify.rest.CustomCollection.count({ + session: session, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/custom_collections.json', + path: '/admin/api/2022-04/custom_collections/count.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks", "published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001315, "handle": "ipods-1", "title": "IPods", "updated_at": "2022-10-03T12:23:13-04:00", "body_html": null, "published_at": "2022-10-03T12:23:13-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001315"}})); + queueMockResponse(JSON.stringify({"count": 2})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "IPods"; - custom_collection.collects = [ - { - "product_id": 921728736 - } - ]; - await custom_collection.save({}); + await shopify.rest.CustomCollection.count({ + session: session, + product_id: "632910392", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/custom_collections.json', - query: '', + path: '/admin/api/2022-04/custom_collections/count.json', + query: 'product_id=632910392', headers, - data: { "custom_collection": {"title": "IPods", "collects": [{"product_id": 921728736}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001319, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:29-04:00", "body_html": null, "published_at": "2022-10-03T12:23:29-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001319"}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; - custom_collection.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; - await custom_collection.save({}); + await shopify.rest.CustomCollection.find({ + session: session, + id: 841564295, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/custom_collections.json', + path: '/admin/api/2022-04/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001322, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:35-04:00", "body_html": null, "published_at": "2022-10-03T12:23:34-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001322", "image": {"created_at": "2022-10-03T12:23:34-04:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-gz22my.gif?v=1664814215"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2023-01-03T13:03:58-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; - custom_collection.image = { - "src": "http://example.com/rails_logo.gif", - "alt": "Rails Logo" - }; + custom_collection.id = 841564295; + custom_collection.collects = [ + { + "product_id": 921728736, + "position": 1 + }, + { + "id": 455204334, + "position": 2 + } + ]; await custom_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/custom_collections.json', + path: '/admin/api/2022-04/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + data: { "custom_collection": {"collects": [{"product_id": 921728736, "position": 1}, {"id": 455204334, "position": 2}]} } }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001324, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:44-04:00", "body_html": null, "published_at": "2022-10-03T12:23:44-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001324"}})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2023-01-03T13:04:15-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; + custom_collection.id = 841564295; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await custom_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/custom_collections.json', + path: '/admin/api/2022-04/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks"} } + data: { "custom_collection": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"count": 2})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": null, "updated_at": "2023-01-03T13:05:26-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); - await shopify.rest.CustomCollection.count({ - session: session, - product_id: "632910392", - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = false; + await custom_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-04/custom_collections/count.json', - query: 'product_id=632910392', + path: '/admin/api/2022-04/custom_collections/841564295.json', + query: '', headers, - data: undefined + data: { "custom_collection": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"count": 3})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": "2023-01-03T13:05:05-05:00", "updated_at": "2023-01-03T13:05:05-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); - await shopify.rest.CustomCollection.count({ - session: session, - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = true; + await custom_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-04/custom_collections/count.json', + path: '/admin/api/2022-04/custom_collections/841564295.json', query: '', headers, - data: undefined + data: { "custom_collection": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

The best selling ipod ever

", "handle": "ipods", "updated_at": "2023-01-03T13:04:49-05:00", "id": 841564295, "sort_order": "manual", "title": "IPods", "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"}})); - await shopify.rest.CustomCollection.find({ - session: session, - id: 841564295, - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.image = ""; + custom_collection.updated_at = "2023-01-03T13:04:48-05:00"; + custom_collection.title = "IPods"; + custom_collection.handle = "ipods"; + custom_collection.body_html = "

The best selling ipod ever

"; + custom_collection.published_at = "2008-02-01T19:00:00-05:00"; + custom_collection.sort_order = "manual"; + custom_collection.template_suffix = null; + custom_collection.published_scope = "web"; + custom_collection.admin_graphql_api_id = "gid://shopify/Collection/841564295"; + await custom_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-04/custom_collections/841564295.json', query: '', headers, - data: undefined + data: { "custom_collection": {"image": "", "updated_at": "2023-01-03T13:04:48-05:00", "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

5000 songs in your pocket

", "title": "IPods", "handle": "ipods", "id": 841564295, "updated_at": "2022-10-03T12:22:50-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2023-01-03T13:05:34-05:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T13:05:34-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672769134"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); custom_collection.id = 841564295; - custom_collection.body_html = "

5000 songs in your pocket

"; + custom_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst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gd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; await custom_collection.save({}); expect({ @@ -271,17 +286,16 @@ describe('CustomCollection resource', () => { path: '/admin/api/2022-04/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"body_html": "

5000 songs in your pocket

"} } + data: { "custom_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH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CKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2022-10-03T12:23:02-04:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:23:02-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1664814182"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2023-01-03T13:04:34-05:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"alt": "Rails logo", "created_at": "2023-01-03T13:04:32-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-s0af8s.gif?v=1672769074"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); custom_collection.id = 841564295; custom_collection.image = { - "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJr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HXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo" }; await custom_collection.save({}); @@ -292,25 +306,16 @@ describe('CustomCollection resource', () => { path: '/admin/api/2022-04/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbq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9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } + data: { "custom_collection": {"image": {"alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2022-10-03T12:23:04-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

5000 songs in your pocket

", "title": "IPods", "handle": "ipods", "id": 841564295, "updated_at": "2023-01-03T13:04:37-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); custom_collection.id = 841564295; - custom_collection.collects = [ - { - "product_id": 921728736, - "position": 1 - }, - { - "id": 455204334, - "position": 2 - } - ]; + custom_collection.body_html = "

5000 songs in your pocket

"; await custom_collection.save({}); expect({ @@ -319,133 +324,128 @@ describe('CustomCollection resource', () => { path: '/admin/api/2022-04/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"collects": [{"product_id": 921728736, "position": 1}, {"id": 455204334, "position": 2}]} } + data: { "custom_collection": {"body_html": "

5000 songs in your pocket

"} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": null, "updated_at": "2022-10-03T12:23:23-04:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.published = false; - await custom_collection.save({}); + await shopify.rest.CustomCollection.delete({ + session: session, + id: 841564295, + }); expect({ - method: 'PUT', + method: 'DELETE', domain, path: '/admin/api/2022-04/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": "2022-10-03T12:23:50-04:00", "updated_at": "2022-10-03T12:23:50-04:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001333, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T13:04:13-05:00", "body_html": null, "published_at": "2023-01-03T13:04:13-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001333"}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.published = true; + custom_collection.title = "IPods"; + custom_collection.collects = [ + { + "product_id": 921728736 + } + ]; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/custom_collections/841564295.json', + path: '/admin/api/2022-04/custom_collections.json', query: '', headers, - data: { "custom_collection": {"published": true} } + data: { "custom_collection": {"title": "IPods", "collects": [{"product_id": 921728736}]} } }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

The best selling ipod ever

", "handle": "ipods", "updated_at": "2022-10-03T12:23:53-04:00", "id": 841564295, "sort_order": "manual", "title": "IPods", "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001341, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:53-05:00", "body_html": null, "published_at": "2023-01-03T13:04:53-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001341"}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.image = ""; - custom_collection.updated_at = "2022-10-03T12:23:53-04:00"; - custom_collection.title = "IPods"; - custom_collection.handle = "ipods"; - custom_collection.body_html = "

The best selling ipod ever

"; - custom_collection.published_at = "2008-02-01T19:00:00-05:00"; - custom_collection.sort_order = "manual"; - custom_collection.template_suffix = null; - custom_collection.published_scope = "web"; - custom_collection.admin_graphql_api_id = "gid://shopify/Collection/841564295"; + custom_collection.title = "Macbooks"; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/custom_collections/841564295.json', + path: '/admin/api/2022-04/custom_collections.json', query: '', headers, - data: { "custom_collection": {"image": "", "updated_at": "2022-10-03T12:23:53-04:00", "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"} } + data: { "custom_collection": {"title": "Macbooks"} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2022-10-03T12:23:56-04:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"alt": "Rails logo", "created_at": "2022-10-03T12:23:55-04:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-72b9ne.gif?v=1664814236"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001342, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:58-05:00", "body_html": null, "published_at": "2023-01-03T13:04:58-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001342"}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.image = { - "alt": "Rails logo" - }; + custom_collection.title = "Macbooks"; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/custom_collections/841564295.json', + path: '/admin/api/2022-04/custom_collections.json', query: '', headers, - data: { "custom_collection": {"image": {"alt": "Rails logo"}} } + data: { "custom_collection": {"title": "Macbooks", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2022-10-03T12:24:10-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001339, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:40-05:00", "body_html": null, "published_at": "2023-01-03T13:04:39-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001339", "image": {"created_at": "2023-01-03T13:04:39-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-c6wrde.gif?v=1672769080"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + custom_collection.title = "Macbooks"; + custom_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/custom_collections/841564295.json', + path: '/admin/api/2022-04/custom_collections.json', query: '', headers, - data: { "custom_collection": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "custom_collection": {"title": "Macbooks", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001337, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:24-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001337"}})); - await shopify.rest.CustomCollection.delete({ - session: session, - id: 841564295, - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + custom_collection.published = false; + await custom_collection.save({}); expect({ - method: 'DELETE', + method: 'POST', domain, - path: '/admin/api/2022-04/custom_collections/841564295.json', + path: '/admin/api/2022-04/custom_collections.json', query: '', headers, - data: undefined + data: { "custom_collection": {"title": "Macbooks", "published": false} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/customer.test.ts b/rest/admin/__tests__/2022-04/customer.test.ts index 8929aa359..be493ca1d 100644 --- a/rest/admin/__tests__/2022-04/customer.test.ts +++ b/rest/admin/__tests__/2022-04/customer.test.ts @@ -31,25 +31,25 @@ describe('Customer resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339464, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:26:08-05:00", "updated_at": "2022-11-09T10:26:08-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:26:08-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339464", "default_address": {"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:25:55-05:00", "updated_at": "2022-11-09T10:25:55-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339469, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:43-05:00", "updated_at": "2023-01-03T12:19:43-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317299, "customer_id": 1073339469, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:19:43-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339469", "default_address": {"id": 1053317299, "customer_id": 1073339469, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:30-05:00", "updated_at": "2023-01-03T12:19:30-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.all({ session: session, - ids: "207119551,1073339464", + ids: "207119551,1073339469", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/customers.json', - query: 'ids=207119551%2C1073339464', + query: 'ids=207119551%2C1073339469', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339466, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:28:04-05:00", "updated_at": "2022-11-09T10:28:04-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317296, "customer_id": 1073339466, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:28:04-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339466", "default_address": {"id": 1053317296, "customer_id": 1073339466, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339458, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:08:39-05:00", "updated_at": "2023-01-03T12:08:39-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:39-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339458", "default_address": {"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}]})); await shopify.rest.Customer.all({ session: session, @@ -67,25 +67,25 @@ describe('Customer resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:23:30-05:00", "updated_at": "2022-11-09T10:23:30-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:12:39-05:00", "updated_at": "2023-01-03T12:12:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.all({ session: session, - updated_at_min: "2022-11-08 15:23:42", + updated_at_min: "2023-01-02 17:12:54", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/customers.json', - query: 'updated_at_min=2022-11-08+15%3A23%3A42', + query: 'updated_at_min=2023-01-02+17%3A12%3A54', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:28:39-05:00", "updated_at": "2022-11-09T10:28:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:09-05:00", "updated_at": "2023-01-03T12:15:09-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.all({ session: session, @@ -120,7 +120,7 @@ describe('Customer resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:21:20-05:00", "updated_at": "2022-11-09T10:21:20-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:13:43-05:00", "updated_at": "2023-01-03T12:13:43-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.search({ session: session, @@ -157,7 +157,7 @@ describe('Customer resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339472, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "tags": "New Customer"}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339466, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "tags": "New Customer"}]})); await shopify.rest.Customer.search({ session: session, @@ -176,7 +176,7 @@ describe('Customer resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:22:34-05:00", "updated_at": "2022-11-09T10:22:34-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:07:03-05:00", "updated_at": "2023-01-03T12:07:03-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.search({ session: session, @@ -194,7 +194,7 @@ describe('Customer resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:33:01-05:00", "updated_at": "2022-11-09T10:33:01-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:16:11-05:00", "updated_at": "2023-01-03T12:16:11-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.search({ session: session, @@ -212,7 +212,7 @@ describe('Customer resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339461, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "verified_email": true}, {"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "verified_email": true}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339460, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "verified_email": true}, {"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "verified_email": true}]})); await shopify.rest.Customer.search({ session: session, @@ -231,7 +231,7 @@ describe('Customer resource', () => { }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:27:08-05:00", "updated_at": "2022-11-09T10:27:08-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:27:08-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:39-05:00", "updated_at": "2023-01-03T12:15:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:15:39-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); await shopify.rest.Customer.find({ session: session, @@ -249,7 +249,7 @@ describe('Customer resource', () => { }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2022-11-09T10:22:49-05:00", "updated_at": "2022-11-09T10:23:03-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:22:49-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2023-01-03T12:18:42-05:00", "updated_at": "2023-01-03T12:18:59-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:18:42-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -274,12 +274,12 @@ describe('Customer resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2022-11-09T10:26:55-05:00", "updated_at": "2022-11-09T10:27:07-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-11-06T10:27:06-05:00", "marketing_opt_in_level": "confirmed_opt_in", "tax_exemptions": [], "email_marketing_consent": {"state": "subscribed", "opt_in_level": "confirmed_opt_in", "consent_updated_at": "2022-11-06T10:27:06-05:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:26:55-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2023-01-03T12:07:21-05:00", "updated_at": "2023-01-03T12:07:37-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-12-31T12:07:36-05:00", "marketing_opt_in_level": "confirmed_opt_in", "tax_exemptions": [], "email_marketing_consent": {"state": "subscribed", "opt_in_level": "confirmed_opt_in", "consent_updated_at": "2022-12-31T12:07:36-05:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:07:21-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; customer.accepts_marketing = true; - customer.accepts_marketing_updated_at = "2022-11-06T10:27:06-05:00"; + customer.accepts_marketing_updated_at = "2022-12-31T12:07:36-05:00"; customer.marketing_opt_in_level = "confirmed_opt_in"; await customer.save({}); @@ -289,12 +289,12 @@ describe('Customer resource', () => { path: '/admin/api/2022-04/customers/207119551.json', query: '', headers, - data: { "customer": {"accepts_marketing": true, "accepts_marketing_updated_at": "2022-11-06T10:27:06-05:00", "marketing_opt_in_level": "confirmed_opt_in"} } + data: { "customer": {"accepts_marketing": true, "accepts_marketing_updated_at": "2022-12-31T12:07:36-05:00", "marketing_opt_in_level": "confirmed_opt_in"} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2022-11-09T10:27:36-05:00", "updated_at": "2022-11-09T10:27:51-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "New Customer, Repeat Customer", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:27:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2023-01-03T12:07:37-05:00", "updated_at": "2023-01-03T12:07:53-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "New Customer, Repeat Customer", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:07:37-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -312,7 +312,7 @@ describe('Customer resource', () => { }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "changed@email.address.com", "note": "Customer is a great guy", "first_name": "Bob", "last_name": "Norman", "accepts_marketing": false, "created_at": "2022-11-09T10:20:18-05:00", "updated_at": "2022-11-09T10:20:33-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:20:33-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:20:18-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "changed@email.address.com", "updated_at": "2023-01-03T12:08:55-05:00", "note": "Customer is a great guy", "first_name": "Bob", "last_name": "Norman", "accepts_marketing": false, "created_at": "2023-01-03T12:08:41-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:55-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:08:41-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -349,7 +349,7 @@ describe('Customer resource', () => { }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 1073339463, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:25:39-05:00", "updated_at": "2022-11-09T10:25:40-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "enabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317293, "customer_id": 1073339463, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:25:40-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339463", "default_address": {"id": 1053317293, "customer_id": 1073339463, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339456, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:08:09-05:00", "updated_at": "2023-01-03T12:08:10-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "enabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317286, "customer_id": 1073339456, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:10-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317286, "customer_id": 1073339456, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -385,7 +385,7 @@ describe('Customer resource', () => { }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 1073339460, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:22:04-05:00", "updated_at": "2022-11-09T10:22:04-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317290, "customer_id": 1073339460, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:22:04-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339460", "default_address": {"id": 1053317290, "customer_id": 1073339460, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339468, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:30-05:00", "updated_at": "2023-01-03T12:19:30-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317298, "customer_id": 1073339468, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:19:30-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339468", "default_address": {"id": 1053317298, "customer_id": 1073339468, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -419,7 +419,7 @@ describe('Customer resource', () => { }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"customer": {"updated_at": "2022-11-09T10:21:50-05:00", "id": 1073339459, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:21:50-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317289, "customer_id": 1073339459, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:21:50-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339459", "default_address": {"id": 1053317289, "customer_id": 1073339459, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339465, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:16:40-05:00", "updated_at": "2023-01-03T12:16:40-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317295, "customer_id": 1073339465, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:16:40-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339465", "default_address": {"id": 1053317295, "customer_id": 1073339465, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -460,7 +460,7 @@ describe('Customer resource', () => { }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 1073339470, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:31:30-05:00", "updated_at": "2022-11-09T10:31:30-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317300, "customer_id": 1073339470, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:31:30-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339470", "default_address": {"id": 1053317300, "customer_id": 1073339470, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339464, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:39-05:00", "updated_at": "2023-01-03T12:15:39-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:15:39-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339464", "default_address": {"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -493,7 +493,7 @@ describe('Customer resource', () => { }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"account_activation_url": "https://jsmith.myshopify.com/account/activate/207119551/63c979bd73389d3b3496db03cea13266-1668007656"})); + queueMockResponse(JSON.stringify({"account_activation_url": "https://jsmith.myshopify.com/account/activate/207119551/75ed95bcf5876b0bac5bb06e1244ccea-1672766051"})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -569,14 +569,14 @@ describe('Customer resource', () => { await shopify.rest.Customer.count({ session: session, - updated_at_min: "2022-11-08 15:33:44", + updated_at_min: "2023-01-02 17:10:34", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/customers/count.json', - query: 'updated_at_min=2022-11-08+15%3A33%3A44', + query: 'updated_at_min=2023-01-02+17%3A10%3A34', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -587,21 +587,21 @@ describe('Customer resource', () => { await shopify.rest.Customer.count({ session: session, - created_at_min: "2022-11-08 15:33:29", + created_at_min: "2023-01-02 17:21:35", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/customers/count.json', - query: 'created_at_min=2022-11-08+15%3A33%3A29', + query: 'created_at_min=2023-01-02+17%3A21%3A35', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_28', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:28:21-05:00", "updated_at": "2022-11-09T10:28:21-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:28:21-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-09T10:28:21-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-09T10:28:21-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-09T10:28:21-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-09T10:28:21-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "c901414060.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:17:39-05:00", "updated_at": "2023-01-03T12:17:39-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:17:39-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:17:39-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:17:39-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:17:39-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:17:39-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Customer.orders({ session: session, @@ -619,7 +619,7 @@ describe('Customer resource', () => { }); it('test_29', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:32:16-05:00", "updated_at": "2022-11-09T10:32:16-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:32:16-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-09T10:32:16-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-09T10:32:16-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-09T10:32:16-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-09T10:32:16-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "c901414060.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:13:09-05:00", "updated_at": "2023-01-03T12:13:09-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:13:09-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:13:09-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:13:09-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:13:09-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:13:09-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Customer.orders({ session: session, diff --git a/rest/admin/__tests__/2022-04/customer_address.test.ts b/rest/admin/__tests__/2022-04/customer_address.test.ts index 7645ad78e..5b002ab44 100644 --- a/rest/admin/__tests__/2022-04/customer_address.test.ts +++ b/rest/admin/__tests__/2022-04/customer_address.test.ts @@ -131,13 +131,13 @@ describe('CustomerAddress resource', () => { await shopify.rest.CustomerAddress.delete({ session: session, customer_id: 207119551, - id: 1053317288, + id: 1053317306, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/customers/207119551/addresses/1053317288.json', + path: '/admin/api/2022-04/customers/207119551/addresses/1053317306.json', query: '', headers, data: undefined @@ -145,7 +145,7 @@ describe('CustomerAddress resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317286, "customer_id": 207119551, "first_name": "Samuel", "last_name": "de Champlain", "company": "Fancy Co.", "address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "phone": "819-555-5555", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada", "default": false}})); + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317303, "customer_id": 207119551, "first_name": "Samuel", "last_name": "de Champlain", "company": "Fancy Co.", "address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "phone": "819-555-5555", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada", "default": false}})); const customer_address = new shopify.rest.CustomerAddress({session: session}); customer_address.customer_id = 207119551; @@ -181,7 +181,7 @@ describe('CustomerAddress resource', () => { const customer_address = new shopify.rest.CustomerAddress({session: session}); customer_address.customer_id = 207119551; await customer_address.set({ - address_ids: ["1053317287"], + address_ids: ["1053317305"], operation: "destroy", }); @@ -189,24 +189,24 @@ describe('CustomerAddress resource', () => { method: 'PUT', domain, path: '/admin/api/2022-04/customers/207119551/addresses/set.json', - query: 'address_ids%5B%5D=1053317287&operation=destroy', + query: 'address_ids%5B%5D=1053317305&operation=destroy', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317289, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317304, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); const customer_address = new shopify.rest.CustomerAddress({session: session}); customer_address.customer_id = 207119551; - customer_address.id = 1053317289; + customer_address.id = 1053317304; await customer_address.default({}); expect({ method: 'PUT', domain, - path: '/admin/api/2022-04/customers/207119551/addresses/1053317289/default.json', + path: '/admin/api/2022-04/customers/207119551/addresses/1053317304/default.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/customer_saved_search.test.ts b/rest/admin/__tests__/2022-04/customer_saved_search.test.ts index 3c3fb0358..ce5afc070 100644 --- a/rest/admin/__tests__/2022-04/customer_saved_search.test.ts +++ b/rest/admin/__tests__/2022-04/customer_saved_search.test.ts @@ -31,7 +31,7 @@ describe('CustomerSavedSearch resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "accepts_marketing:1"}, {"id": 20610973, "name": "Canadian Snowboarders", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "country:Canada"}, {"id": 669439218, "name": "Premier Customers", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}]})); + queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}, {"id": 20610973, "name": "Canadian Snowboarders", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "country:Canada"}, {"id": 669439218, "name": "Premier Customers", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}]})); await shopify.rest.CustomerSavedSearch.all({ session: session, @@ -48,7 +48,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 669439218, "name": "Premier Customers", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}, {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "accepts_marketing:1"}]})); + queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 669439218, "name": "Premier Customers", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}, {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}]})); await shopify.rest.CustomerSavedSearch.all({ session: session, @@ -66,7 +66,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136102, "name": "Spent more than $50", "created_at": "2022-10-31T10:33:27-04:00", "updated_at": "2022-10-31T10:33:27-04:00", "query": "total_spent:>50"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136102, "name": "Spent more than $50", "created_at": "2023-01-03T13:07:07-05:00", "updated_at": "2023-01-03T13:07:07-05:00", "query": "total_spent:>50"}})); const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); customer_saved_search.name = "Spent more than $50"; @@ -84,7 +84,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136103, "name": "Spent more than $50 and after 2013", "created_at": "2022-10-31T10:33:49-04:00", "updated_at": "2022-10-31T10:33:49-04:00", "query": "total_spent:>50 order_date:>=2013-01-01"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136103, "name": "Spent more than $50 and after 2013", "created_at": "2023-01-03T13:07:17-05:00", "updated_at": "2023-01-03T13:07:17-05:00", "query": "total_spent:>50 order_date:>=2013-01-01"}})); const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); customer_saved_search.name = "Spent more than $50 and after 2013"; @@ -137,7 +137,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "accepts_marketing:1"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}})); await shopify.rest.CustomerSavedSearch.find({ session: session, @@ -155,7 +155,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"name": "This Name Has Been Changed", "id": 789629109, "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-31T10:33:35-04:00", "query": "accepts_marketing:1"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"name": "This Name Has Been Changed", "id": 789629109, "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2023-01-03T13:06:53-05:00", "query": "accepts_marketing:1"}})); const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); customer_saved_search.id = 789629109; @@ -191,7 +191,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2022-10-31T10:32:41-04:00", "updated_at": "2022-10-31T10:33:36-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-10-31T10:33:36-04:00", "marketing_opt_in_level": "single_opt_in", "tax_exemptions": [], "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-31T10:32:41-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:07:04-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2023-01-03T13:07:04-05:00", "marketing_opt_in_level": "single_opt_in", "tax_exemptions": [], "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.CustomerSavedSearch.customers({ session: session, diff --git a/rest/admin/__tests__/2022-04/discount_code.test.ts b/rest/admin/__tests__/2022-04/discount_code.test.ts index 6a9227605..92d7342b3 100644 --- a/rest/admin/__tests__/2022-04/discount_code.test.ts +++ b/rest/admin/__tests__/2022-04/discount_code.test.ts @@ -31,7 +31,7 @@ describe('DiscountCode resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"discount_code": {"id": 1054381139, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2022-10-03T12:22:02-04:00", "updated_at": "2022-10-03T12:22:02-04:00"}})); + queueMockResponse(JSON.stringify({"discount_code": {"id": 1054381139, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:38:34-05:00", "updated_at": "2023-01-03T12:38:34-05:00"}})); const discount_code = new shopify.rest.DiscountCode({session: session}); discount_code.price_rule_id = 507328175; @@ -49,7 +49,7 @@ describe('DiscountCode resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"discount_codes": [{"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}]})); + queueMockResponse(JSON.stringify({"discount_codes": [{"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}]})); await shopify.rest.DiscountCode.all({ session: session, @@ -67,7 +67,7 @@ describe('DiscountCode resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "WINTERSALE20OFF", "usage_count": 0, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:22:08-04:00"}})); + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "WINTERSALE20OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:31-05:00"}})); const discount_code = new shopify.rest.DiscountCode({session: session}); discount_code.price_rule_id = 507328175; @@ -86,7 +86,7 @@ describe('DiscountCode resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}})); + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}})); await shopify.rest.DiscountCode.find({ session: session, @@ -141,7 +141,7 @@ describe('DiscountCode resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 989355119, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2022-10-03T12:22:11-04:00", "updated_at": "2022-10-03T12:22:11-04:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 989355119, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2023-01-03T12:38:25-05:00", "updated_at": "2023-01-03T12:38:25-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); const discount_code = new shopify.rest.DiscountCode({session: session}); discount_code.price_rule_id = 507328175; @@ -160,7 +160,7 @@ describe('DiscountCode resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 173232803, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 173232803, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); await shopify.rest.DiscountCode.get_all({ session: session, diff --git a/rest/admin/__tests__/2022-04/draft_order.test.ts b/rest/admin/__tests__/2022-04/draft_order.test.ts index d49567e64..9e4399515 100644 --- a/rest/admin/__tests__/2022-04/draft_order.test.ts +++ b/rest/admin/__tests__/2022-04/draft_order.test.ts @@ -31,29 +31,7 @@ describe('DraftOrder resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920475, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:19:47-04:00", "updated_at": "2022-10-03T12:19:47-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630380, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630380"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/d0730281ac9692b04a064b4bac5f23bc", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920475", "customer": null}})); - - const draft_order = new shopify.rest.DraftOrder({session: session}); - draft_order.line_items = [ - { - "variant_id": 447654529, - "quantity": 1 - } - ]; - await draft_order.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-04/draft_orders.json', - query: '', - headers, - data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } - }).toMatchMadeHttpRequest(); - }); - - it('test_2', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920476, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:19:50-04:00", "updated_at": "2022-10-03T12:19:50-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630381, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630381"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/227d2bfd5f2da805a987c89fd317c33f", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "40.00", "subtotal_price": "40.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920476", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920479, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:43-05:00", "updated_at": "2023-01-03T12:58:43-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630384, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630384"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/b21e68f2f1e19263509b19a8286d2d09", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "30.00", "subtotal_price": "30.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920479", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -63,6 +41,13 @@ describe('DraftOrder resource', () => { "quantity": 2 } ]; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "fixed_amount", + "value": "10.0", + "amount": "10.00", + "title": "Custom" + }; draft_order.customer = { "id": 207119551 }; @@ -75,12 +60,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-04/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "customer": {"id": 207119551}, "use_customer_default_address": true} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.00", "title": "Custom"}, "customer": {"id": 207119551}, "use_customer_default_address": true} } }).toMatchMadeHttpRequest(); }); - it('test_3', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920477, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:00-04:00", "updated_at": "2022-10-03T12:20:00-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630382, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630382"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/81affa4929f868a98b2231f89ab48a24", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "tags": "", "note_attributes": [], "total_price": "11.30", "subtotal_price": "10.00", "total_tax": "1.30", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "11.30", "currency_code": "USD"}, "presentment_money": {"amount": "11.30", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "1.30", "currency_code": "USD"}, "presentment_money": {"amount": "1.30", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920477", "customer": null}})); + it('test_2', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920478, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:39-05:00", "updated_at": "2023-01-03T12:58:39-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630383, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "2.00", "value_type": "percentage"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630383"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/d3f9ba3d1a9c83f93adf079a7f05d693", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "tags": "", "note_attributes": [], "total_price": "20.34", "subtotal_price": "18.00", "total_tax": "2.34", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "20.34", "currency_code": "USD"}, "presentment_money": {"amount": "20.34", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "18.00", "currency_code": "USD"}, "presentment_money": {"amount": "18.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "2.34", "currency_code": "USD"}, "presentment_money": {"amount": "2.34", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "2.00", "currency_code": "USD"}, "presentment_money": {"amount": "2.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920478"}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -90,9 +75,9 @@ describe('DraftOrder resource', () => { "quantity": 1, "applied_discount": { "description": "Custom discount", - "value_type": "fixed_amount", + "value_type": "percentage", "value": "10.0", - "amount": "10.0", + "amount": "2.0", "title": "Custom" } } @@ -105,12 +90,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-04/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.0", "title": "Custom"}}]} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "2.0", "title": "Custom"}}]} } }).toMatchMadeHttpRequest(); }); - it('test_4', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920478, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:01-04:00", "updated_at": "2022-10-03T12:20:01-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630383, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630383"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/58c3ff8f12f0a0f8a552f36dec441b0a", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "30.00", "subtotal_price": "30.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920478", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + it('test_3', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920477, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:31-05:00", "updated_at": "2023-01-03T12:58:31-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630382, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630382"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/17d301f9579f7982e4d1f75dd2b3269c", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "40.00", "subtotal_price": "40.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920477", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -120,13 +105,6 @@ describe('DraftOrder resource', () => { "quantity": 2 } ]; - draft_order.applied_discount = { - "description": "Custom discount", - "value_type": "fixed_amount", - "value": "10.0", - "amount": "10.00", - "title": "Custom" - }; draft_order.customer = { "id": 207119551 }; @@ -139,12 +117,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-04/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.00", "title": "Custom"}, "customer": {"id": 207119551}, "use_customer_default_address": true} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "customer": {"id": 207119551}, "use_customer_default_address": true} } }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920479, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:03-04:00", "updated_at": "2022-10-03T12:20:03-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630384, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630384"}], "shipping_address": null, "billing_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/b351a137cc201ae891ddcda59a58179e", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920479", "customer": {"id": 1073339456, "email": null, "accepts_marketing": false, "created_at": "2022-10-03T12:20:03-04:00", "updated_at": "2022-10-03T12:20:03-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-10-03T12:20:03-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317287, "customer_id": 1073339456, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + it('test_4', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920475, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:23-05:00", "updated_at": "2023-01-03T12:58:23-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630380, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630380"}], "shipping_address": null, "billing_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/5f465084cd7442780b87241fed885a5e", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920475", "customer": {"id": 1073339480, "email": null, "accepts_marketing": false, "created_at": "2023-01-03T12:58:23-05:00", "updated_at": "2023-01-03T12:58:23-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:58:23-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339480", "default_address": {"id": 1053317317, "customer_id": 1073339480, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -175,8 +153,8 @@ describe('DraftOrder resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920480, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:10-04:00", "updated_at": "2022-10-03T12:20:10-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630385, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630385"}], "shipping_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/8e652af09741964f24a0f2b12c70e416", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920480", "customer": {"id": 1073339457, "email": null, "accepts_marketing": false, "created_at": "2022-10-03T12:20:10-04:00", "updated_at": "2022-10-03T12:20:10-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-10-03T12:20:10-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339457", "default_address": {"id": 1053317289, "customer_id": 1073339457, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + it('test_5', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920476, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:25-05:00", "updated_at": "2023-01-03T12:58:25-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630381, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630381"}], "shipping_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/a9d2db17815b237bbc13d6ecd39d8f11", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920476", "customer": {"id": 1073339481, "email": null, "accepts_marketing": false, "created_at": "2023-01-03T12:58:25-05:00", "updated_at": "2023-01-03T12:58:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:58:25-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339481", "default_address": {"id": 1053317318, "customer_id": 1073339481, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -207,8 +185,8 @@ describe('DraftOrder resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920481, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:14-04:00", "updated_at": "2022-10-03T12:20:14-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630386, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "2.00", "value_type": "percentage"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630386"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/45664b5ac2738c15446732395e47b6a1", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "tags": "", "note_attributes": [], "total_price": "20.34", "subtotal_price": "18.00", "total_tax": "2.34", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "20.34", "currency_code": "USD"}, "presentment_money": {"amount": "20.34", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "18.00", "currency_code": "USD"}, "presentment_money": {"amount": "18.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "2.34", "currency_code": "USD"}, "presentment_money": {"amount": "2.34", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "2.00", "currency_code": "USD"}, "presentment_money": {"amount": "2.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920481", "customer": null}})); + it('test_6', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920481, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:56-05:00", "updated_at": "2023-01-03T12:58:56-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630386, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630386"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/46a7191808bee9d2bb0979533fa3b4b4", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "tags": "", "note_attributes": [], "total_price": "11.30", "subtotal_price": "10.00", "total_tax": "1.30", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "11.30", "currency_code": "USD"}, "presentment_money": {"amount": "11.30", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "1.30", "currency_code": "USD"}, "presentment_money": {"amount": "1.30", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920481"}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -218,9 +196,9 @@ describe('DraftOrder resource', () => { "quantity": 1, "applied_discount": { "description": "Custom discount", - "value_type": "percentage", + "value_type": "fixed_amount", "value": "10.0", - "amount": "2.0", + "amount": "10.0", "title": "Custom" } } @@ -233,12 +211,34 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-04/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "2.0", "title": "Custom"}}]} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.0", "title": "Custom"}}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920480, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:45-05:00", "updated_at": "2023-01-03T12:58:45-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630385, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630385"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/42fb27c2a95082c0217255df38363371", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920480"}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D4", "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D4", "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869", "customer": null}]})); + queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D4", "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D4", "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869"}]})); await shopify.rest.DraftOrder.all({ session: session, @@ -255,11 +255,17 @@ describe('DraftOrder resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "Customer contacted us about a custom engraving on this iPod", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:19:57-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "194.00", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:49-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "19.90", "value_type": "percentage"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "179.10", "subtotal_price": "179.10", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "19.90", "currency_code": "USD"}, "presentment_money": {"amount": "19.90", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - draft_order.note = "Customer contacted us about a custom engraving on this iPod"; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "percentage", + "value": "10.0", + "amount": "19.90", + "title": "Custom" + }; await draft_order.save({}); expect({ @@ -268,22 +274,16 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-04/draft_orders/994118539.json', query: '', headers, - data: { "draft_order": {"note": "Customer contacted us about a custom engraving on this iPod"} } + data: { "draft_order": {"applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "19.90", "title": "Custom"}} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:20:17-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "19.90", "value_type": "percentage"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "179.10", "subtotal_price": "179.10", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "19.90", "currency_code": "USD"}, "presentment_money": {"amount": "19.90", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "Customer contacted us about a custom engraving on this iPod", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:47-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "194.00", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - draft_order.applied_discount = { - "description": "Custom discount", - "value_type": "percentage", - "value": "10.0", - "amount": "19.90", - "title": "Custom" - }; + draft_order.note = "Customer contacted us about a custom engraving on this iPod"; await draft_order.save({}); expect({ @@ -292,12 +292,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-04/draft_orders/994118539.json', query: '', headers, - data: { "draft_order": {"applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "19.90", "title": "Custom"}} } + data: { "draft_order": {"note": "Customer contacted us about a custom engraving on this iPod"} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); await shopify.rest.DraftOrder.find({ session: session, @@ -350,12 +350,12 @@ describe('DraftOrder resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "bob.norman@mail.example.com", "from": "j.smith@example.com", "subject": "Draft Order #D2", "custom_message": "", "bcc": []}})); + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!", "bcc": ["j.smith@example.com"]}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; await draft_order.send_invoice({ - body: {"draft_order_invoice": {}}, + body: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}}, }); expect({ @@ -364,17 +364,17 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-04/draft_orders/994118539/send_invoice.json', query: '', headers, - data: {"draft_order_invoice": {}} + data: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}} }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!", "bcc": ["j.smith@example.com"]}})); + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "bob.norman@mail.example.com", "from": "j.smith@example.com", "subject": "Draft Order #D2", "custom_message": "", "bcc": []}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; await draft_order.send_invoice({ - body: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}}, + body: {"draft_order_invoice": {}}, }); expect({ @@ -383,41 +383,41 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-04/draft_orders/994118539/send_invoice.json', query: '', headers, - data: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}} + data: {"draft_order_invoice": {}} }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"email": "bob.norman@mail.example.com", "id": 994118539, "note": "rush order", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:19:56-04:00", "tax_exempt": false, "completed_at": "2022-10-03T12:19:56-04:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459962, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": false}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:20-05:00", "tax_exempt": false, "completed_at": "2023-01-03T12:58:20-05:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459975, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:20-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 2, "state": "disabled", "total_spent": "405.90", "last_order_id": 1073459975, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1002", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317316, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - await draft_order.complete({ - payment_pending: "true", - }); + await draft_order.complete({}); expect({ method: 'PUT', domain, path: '/admin/api/2022-04/draft_orders/994118539/complete.json', - query: 'payment_pending=true', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"email": "bob.norman@mail.example.com", "id": 994118539, "note": "rush order", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:20:08-04:00", "tax_exempt": false, "completed_at": "2022-10-03T12:20:08-04:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459963, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": false}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:36-05:00", "tax_exempt": false, "completed_at": "2023-01-03T12:58:36-05:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459976, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 2, "state": "disabled", "total_spent": "405.90", "last_order_id": 1073459976, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1002", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317319, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - await draft_order.complete({}); + await draft_order.complete({ + payment_pending: "true", + }); expect({ method: 'PUT', domain, path: '/admin/api/2022-04/draft_orders/994118539/complete.json', - query: '', + query: 'payment_pending=true', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-04/fulfillment.test.ts b/rest/admin/__tests__/2022-04/fulfillment.test.ts index da4084413..0ca436d25 100644 --- a/rest/admin/__tests__/2022-04/fulfillment.test.ts +++ b/rest/admin/__tests__/2022-04/fulfillment.test.ts @@ -31,124 +31,151 @@ describe('Fulfillment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019884, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:18-04:00", "service": "shipwire-app", "updated_at": "2022-10-21T08:57:18-04:00", "tracking_company": "TNT", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "shipwire-app", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shipwire-app", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789", "tracking_urls": ["https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019884"}]})); + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}]})); await shopify.rest.Fulfillment.all({ session: session, order_id: 450789469, - since_id: "255858046", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/orders/450789469/fulfillments.json', - query: 'since_id=255858046', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillments": [{"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:56:20-04:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}]})); + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019883, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:45-05:00", "service": "shipwire-app", "updated_at": "2023-01-03T12:29:45-05:00", "tracking_company": "TNT", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "shipwire-app", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shipwire-app", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789", "tracking_urls": ["https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019883"}]})); await shopify.rest.Fulfillment.all({ session: session, order_id: 450789469, + since_id: "255858046", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/orders/450789469/fulfillments.json', - query: '', + query: 'since_id=255858046', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019901, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:56:20-04:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823190, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823190", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019901"}]})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019866, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:40-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:40-05:00", "tracking_company": null, "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019866"}})); - await shopify.rest.Fulfillment.all({ - session: session, - fulfillment_order_id: 1046000823, - }); + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.order_id = 450789469; + fulfillment.location_id = 655441491; + fulfillment.tracking_number = null; + fulfillment.line_items = [ + { + "id": 518995019 + } + ]; + await fulfillment.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000823/fulfillments.json', + path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: undefined + data: { "fulfillment": {"location_id": 655441491, "tracking_number": null, "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019882, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:42-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:42-05:00", "tracking_company": "TNT", "shipment_status": null, "location_id": 487838322, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}, {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}, {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "https://shipping.xyz/track.php?num=123456789", "tracking_urls": ["https://shipping.xyz/track.php?num=123456789", "https://anothershipper.corp/track.php?code=abc"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019882"}})); - await shopify.rest.Fulfillment.count({ - session: session, - order_id: 450789469, - }); + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.order_id = 450789469; + fulfillment.location_id = 487838322; + fulfillment.tracking_number = "123456789"; + fulfillment.tracking_urls = [ + "https://shipping.xyz/track.php?num=123456789", + "https://anothershipper.corp/track.php?code=abc" + ]; + fulfillment.notify_customer = true; + await fulfillment.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/orders/450789469/fulfillments/count.json', + path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: undefined + data: { "fulfillment": {"location_id": 487838322, "tracking_number": "123456789", "tracking_urls": ["https://shipping.xyz/track.php?num=123456789", "https://anothershipper.corp/track.php?code=abc"], "notify_customer": true} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:56:20-04:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019867, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:43-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:43-05:00", "tracking_company": "Jack Black Pack, Stack and Track", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": null, "tracking_numbers": [], "tracking_url": "http://www.packagetrackr.com/track/somecarrier/1234567", "tracking_urls": ["http://www.packagetrackr.com/track/somecarrier/1234567"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019867"}})); - await shopify.rest.Fulfillment.find({ - session: session, - order_id: 450789469, - id: 255858046, - }); + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.order_id = 450789469; + fulfillment.location_id = 655441491; + fulfillment.tracking_url = "http://www.packagetrackr.com/track/somecarrier/1234567"; + fulfillment.tracking_company = "Jack Black Pack, Stack and Track"; + fulfillment.line_items = [ + { + "id": 518995019 + } + ]; + await fulfillment.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/orders/450789469/fulfillments/255858046.json', + path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: undefined + data: { "fulfillment": {"location_id": 655441491, "tracking_url": "http://www.packagetrackr.com/track/somecarrier/1234567", "tracking_company": "Jack Black Pack, Stack and Track", "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"location_id": 655441491, "id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:45-04:00", "tracking_company": "USPS", "shipment_status": null, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "987654321", "tracking_numbers": ["987654321"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=987654321", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=987654321"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019875, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:13-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:13-05:00", "tracking_company": "Deutsche Post", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "ee179e6e5b36a02451ec5376cc7edcb2", "tracking_numbers": ["ee179e6e5b36a02451ec5376cc7edcb2", "011a96f842b208c5322f2bf4ebf288cd", "7ecb946e0ea55b5da2c5d7346be6a280"], "tracking_url": "https://www.deutschepost.de/de/s/sendungsverfolgung/verfolgen.html?piececode=ee179e6e5b36a02451ec5376cc7edcb2", "tracking_urls": ["https://www.deutschepost.de/de/s/sendungsverfolgung/verfolgen.html?piececode=ee179e6e5b36a02451ec5376cc7edcb2", "https://www.deutschepost.de/de/s/sendungsverfolgung/verfolgen.html?piececode=011a96f842b208c5322f2bf4ebf288cd", "https://www.deutschepost.de/de/s/sendungsverfolgung/verfolgen.html?piececode=7ecb946e0ea55b5da2c5d7346be6a280"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019875"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; - fulfillment.id = 255858046; - fulfillment.tracking_number = "987654321"; + fulfillment.location_id = 655441491; + fulfillment.tracking_numbers = [ + "ee179e6e5b36a02451ec5376cc7edcb2", + "011a96f842b208c5322f2bf4ebf288cd", + "7ecb946e0ea55b5da2c5d7346be6a280" + ]; + fulfillment.line_items = [ + { + "id": 518995019 + } + ]; await fulfillment.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/orders/450789469/fulfillments/255858046.json', + path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: { "fulfillment": {"tracking_number": "987654321"} } + data: { "fulfillment": {"location_id": 655441491, "tracking_numbers": ["ee179e6e5b36a02451ec5376cc7edcb2", "011a96f842b208c5322f2bf4ebf288cd", "7ecb946e0ea55b5da2c5d7346be6a280"], "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019886, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:26-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:26-04:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "CJ274101086US", "tracking_numbers": ["CJ274101086US"], "tracking_url": "http://www.custom-tracking.com/?tracking_number=CJ274101086US", "tracking_urls": ["http://www.custom-tracking.com/?tracking_number=CJ274101086US"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019886"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019880, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:37-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:37-05:00", "tracking_company": "Chinese Post", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "RR123456789CN", "tracking_numbers": ["RR123456789CN"], "tracking_url": "http://www.track-chinapost.com/result_china.php?order_no=RR123456789CN", "tracking_urls": ["http://www.track-chinapost.com/result_china.php?order_no=RR123456789CN"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019880"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; fulfillment.location_id = 655441491; - fulfillment.tracking_number = "CJ274101086US"; - fulfillment.tracking_url = "http://www.custom-tracking.com/?tracking_number=CJ274101086US"; + fulfillment.tracking_number = "RR123456789CN"; + fulfillment.tracking_company = "Chinese Post"; fulfillment.line_items = [ { "id": 518995019 @@ -162,22 +189,23 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_number": "CJ274101086US", "tracking_url": "http://www.custom-tracking.com/?tracking_number=CJ274101086US", "line_items": [{"id": 518995019}]} } + data: { "fulfillment": {"location_id": 655441491, "tracking_number": "RR123456789CN", "tracking_company": "Chinese Post", "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019890, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:37-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:37-04:00", "tracking_company": "TNT", "shipment_status": null, "location_id": 487838322, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}, {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}, {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "https://shipping.xyz/track.php?num=123456789", "tracking_urls": ["https://shipping.xyz/track.php?num=123456789", "https://anothershipper.corp/track.php?code=abc"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019890"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019873, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:04-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:04-05:00", "tracking_company": "Custom Tracking Company", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1234567", "tracking_numbers": ["1234567"], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019873"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; - fulfillment.location_id = 487838322; - fulfillment.tracking_number = "123456789"; - fulfillment.tracking_urls = [ - "https://shipping.xyz/track.php?num=123456789", - "https://anothershipper.corp/track.php?code=abc" + fulfillment.location_id = 655441491; + fulfillment.tracking_number = "1234567"; + fulfillment.tracking_company = "Custom Tracking Company"; + fulfillment.line_items = [ + { + "id": 518995019 + } ]; - fulfillment.notify_customer = true; await fulfillment.save({}); expect({ @@ -186,18 +214,18 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: { "fulfillment": {"location_id": 487838322, "tracking_number": "123456789", "tracking_urls": ["https://shipping.xyz/track.php?num=123456789", "https://anothershipper.corp/track.php?code=abc"], "notify_customer": true} } + data: { "fulfillment": {"location_id": 655441491, "tracking_number": "1234567", "tracking_company": "Custom Tracking Company", "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019891, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:40-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:40-04:00", "tracking_company": "Jack Black Pack, Stack and Track", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": null, "tracking_numbers": [], "tracking_url": "http://www.packagetrackr.com/track/somecarrier/1234567", "tracking_urls": ["http://www.packagetrackr.com/track/somecarrier/1234567"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019891"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019872, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:59-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:59-05:00", "tracking_company": "4PX", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "http://track.4px.com", "tracking_urls": ["http://track.4px.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019872"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; fulfillment.location_id = 655441491; - fulfillment.tracking_url = "http://www.packagetrackr.com/track/somecarrier/1234567"; - fulfillment.tracking_company = "Jack Black Pack, Stack and Track"; + fulfillment.tracking_number = "123456789"; + fulfillment.tracking_company = "4PX"; fulfillment.line_items = [ { "id": 518995019 @@ -211,18 +239,18 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_url": "http://www.packagetrackr.com/track/somecarrier/1234567", "tracking_company": "Jack Black Pack, Stack and Track", "line_items": [{"id": 518995019}]} } + data: { "fulfillment": {"location_id": 655441491, "tracking_number": "123456789", "tracking_company": "4PX", "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019892, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:43-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:43-04:00", "tracking_company": "Custom Tracking Company", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1234567", "tracking_numbers": ["1234567"], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019892"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019878, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:27-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:27-05:00", "tracking_company": "fed ex", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789010", "tracking_numbers": ["123456789010"], "tracking_url": "https://www.fedex.com/fedextrack/?trknbr=123456789010", "tracking_urls": ["https://www.fedex.com/fedextrack/?trknbr=123456789010"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019878"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; fulfillment.location_id = 655441491; - fulfillment.tracking_number = "1234567"; - fulfillment.tracking_company = "Custom Tracking Company"; + fulfillment.tracking_number = "123456789010"; + fulfillment.tracking_company = "fed ex"; fulfillment.line_items = [ { "id": 518995019 @@ -236,21 +264,19 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_number": "1234567", "tracking_company": "Custom Tracking Company", "line_items": [{"id": 518995019}]} } + data: { "fulfillment": {"location_id": 655441491, "tracking_number": "123456789010", "tracking_company": "fed ex", "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019895, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:54-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:54-04:00", "tracking_company": "Deutsche Post", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "46c5d6fd910bc4741617b903e0034a91", "tracking_numbers": ["46c5d6fd910bc4741617b903e0034a91", "5bbe96d001886e29a051094a2dff2eda", "5fd83253335280e71610dbe096f35f85"], "tracking_url": "https://www.deutschepost.de/de/s/sendungsverfolgung/verfolgen.html?piececode=46c5d6fd910bc4741617b903e0034a91", "tracking_urls": ["https://www.deutschepost.de/de/s/sendungsverfolgung/verfolgen.html?piececode=46c5d6fd910bc4741617b903e0034a91", "https://www.deutschepost.de/de/s/sendungsverfolgung/verfolgen.html?piececode=5bbe96d001886e29a051094a2dff2eda", "https://www.deutschepost.de/de/s/sendungsverfolgung/verfolgen.html?piececode=5fd83253335280e71610dbe096f35f85"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019895"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019881, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:40-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:40-05:00", "tracking_company": "fed ex", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789010", "tracking_numbers": ["123456789010"], "tracking_url": "https://www.new-fedex-tracking.com/?number=123456789010", "tracking_urls": ["https://www.new-fedex-tracking.com/?number=123456789010"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019881"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; fulfillment.location_id = 655441491; - fulfillment.tracking_numbers = [ - "46c5d6fd910bc4741617b903e0034a91", - "5bbe96d001886e29a051094a2dff2eda", - "5fd83253335280e71610dbe096f35f85" - ]; + fulfillment.tracking_number = "123456789010"; + fulfillment.tracking_company = "fed ex"; + fulfillment.tracking_url = "https://www.new-fedex-tracking.com/?number=123456789010"; fulfillment.line_items = [ { "id": 518995019 @@ -264,18 +290,18 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_numbers": ["46c5d6fd910bc4741617b903e0034a91", "5bbe96d001886e29a051094a2dff2eda", "5fd83253335280e71610dbe096f35f85"], "line_items": [{"id": 518995019}]} } + data: { "fulfillment": {"location_id": 655441491, "tracking_number": "123456789010", "tracking_company": "fed ex", "tracking_url": "https://www.new-fedex-tracking.com/?number=123456789010", "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019896, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:58-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:58-04:00", "tracking_company": "Chinese Post", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "RR123456789CN", "tracking_numbers": ["RR123456789CN"], "tracking_url": "http://www.track-chinapost.com/result_china.php?order_no=RR123456789CN", "tracking_urls": ["http://www.track-chinapost.com/result_china.php?order_no=RR123456789CN"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019896"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019884, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:49-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:49-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "CJ274101086US", "tracking_numbers": ["CJ274101086US"], "tracking_url": "http://www.custom-tracking.com/?tracking_number=CJ274101086US", "tracking_urls": ["http://www.custom-tracking.com/?tracking_number=CJ274101086US"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019884"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; fulfillment.location_id = 655441491; - fulfillment.tracking_number = "RR123456789CN"; - fulfillment.tracking_company = "Chinese Post"; + fulfillment.tracking_number = "CJ274101086US"; + fulfillment.tracking_url = "http://www.custom-tracking.com/?tracking_number=CJ274101086US"; fulfillment.line_items = [ { "id": 518995019 @@ -289,12 +315,12 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_number": "RR123456789CN", "tracking_company": "Chinese Post", "line_items": [{"id": 518995019}]} } + data: { "fulfillment": {"location_id": 655441491, "tracking_number": "CJ274101086US", "tracking_url": "http://www.custom-tracking.com/?tracking_number=CJ274101086US", "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019897, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:58:01-04:00", "service": "manual", "updated_at": "2022-10-21T08:58:01-04:00", "tracking_company": null, "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019897"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019879, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:34-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:34-05:00", "tracking_company": null, "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019879"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; @@ -302,8 +328,7 @@ describe('Fulfillment resource', () => { fulfillment.tracking_number = null; fulfillment.line_items = [ { - "id": 518995019, - "quantity": 1 + "id": 518995019 } ]; await fulfillment.save({}); @@ -314,21 +339,21 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_number": null, "line_items": [{"id": 518995019, "quantity": 1}]} } + data: { "fulfillment": {"location_id": 655441491, "tracking_number": null, "line_items": [{"id": 518995019}]} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019898, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:58:04-04:00", "service": "manual", "updated_at": "2022-10-21T08:58:04-04:00", "tracking_company": "4PX", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "http://track.4px.com", "tracking_urls": ["http://track.4px.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019898"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019877, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:21-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:21-05:00", "tracking_company": null, "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019877"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; fulfillment.location_id = 655441491; - fulfillment.tracking_number = "123456789"; - fulfillment.tracking_company = "4PX"; + fulfillment.tracking_number = null; fulfillment.line_items = [ { - "id": 518995019 + "id": 518995019, + "quantity": 1 } ]; await fulfillment.save({}); @@ -339,111 +364,86 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/orders/450789469/fulfillments.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_number": "123456789", "tracking_company": "4PX", "line_items": [{"id": 518995019}]} } + data: { "fulfillment": {"location_id": 655441491, "tracking_number": null, "line_items": [{"id": 518995019, "quantity": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019899, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:58:07-04:00", "service": "manual", "updated_at": "2022-10-21T08:58:07-04:00", "tracking_company": "fed ex", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789010", "tracking_numbers": ["123456789010"], "tracking_url": "https://www.fedex.com/fedextrack/?trknbr=123456789010", "tracking_urls": ["https://www.fedex.com/fedextrack/?trknbr=123456789010"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019899"}})); + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019874, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823194, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823194", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019874"}]})); - const fulfillment = new shopify.rest.Fulfillment({session: session}); - fulfillment.order_id = 450789469; - fulfillment.location_id = 655441491; - fulfillment.tracking_number = "123456789010"; - fulfillment.tracking_company = "fed ex"; - fulfillment.line_items = [ - { - "id": 518995019 - } - ]; - await fulfillment.save({}); + await shopify.rest.Fulfillment.all({ + session: session, + fulfillment_order_id: 1046000790, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/orders/450789469/fulfillments.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000790/fulfillments.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_number": "123456789010", "tracking_company": "fed ex", "line_items": [{"id": 518995019}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019900, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:58:13-04:00", "service": "manual", "updated_at": "2022-10-21T08:58:13-04:00", "tracking_company": null, "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019900"}})); + queueMockResponse(JSON.stringify({"count": 1})); - const fulfillment = new shopify.rest.Fulfillment({session: session}); - fulfillment.order_id = 450789469; - fulfillment.location_id = 655441491; - fulfillment.tracking_number = null; - fulfillment.line_items = [ - { - "id": 518995019 - } - ]; - await fulfillment.save({}); + await shopify.rest.Fulfillment.count({ + session: session, + order_id: 450789469, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/orders/450789469/fulfillments.json', + path: '/admin/api/2022-04/orders/450789469/fulfillments/count.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_number": null, "line_items": [{"id": 518995019}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019902, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:58:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:58:20-04:00", "tracking_company": "fed ex", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789010", "tracking_numbers": ["123456789010"], "tracking_url": "https://www.new-fedex-tracking.com/?number=123456789010", "tracking_urls": ["https://www.new-fedex-tracking.com/?number=123456789010"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019902"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); - const fulfillment = new shopify.rest.Fulfillment({session: session}); - fulfillment.order_id = 450789469; - fulfillment.location_id = 655441491; - fulfillment.tracking_number = "123456789010"; - fulfillment.tracking_company = "fed ex"; - fulfillment.tracking_url = "https://www.new-fedex-tracking.com/?number=123456789010"; - fulfillment.line_items = [ - { - "id": 518995019 - } - ]; - await fulfillment.save({}); + await shopify.rest.Fulfillment.find({ + session: session, + order_id: 450789469, + id: 255858046, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/orders/450789469/fulfillments.json', + path: '/admin/api/2022-04/orders/450789469/fulfillments/255858046.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_number": "123456789010", "tracking_company": "fed ex", "tracking_url": "https://www.new-fedex-tracking.com/?number=123456789010", "line_items": [{"id": 518995019}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019903, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:58:26-04:00", "service": "manual", "updated_at": "2022-10-21T08:58:26-04:00", "tracking_company": null, "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019903"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"location_id": 655441491, "id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:01-05:00", "tracking_company": "USPS", "shipment_status": null, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "987654321", "tracking_numbers": ["987654321"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=987654321", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=987654321"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; - fulfillment.location_id = 655441491; - fulfillment.tracking_number = null; - fulfillment.line_items = [ - { - "id": 518995019 - } - ]; + fulfillment.id = 255858046; + fulfillment.tracking_number = "987654321"; await fulfillment.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/orders/450789469/fulfillments.json', + path: '/admin/api/2022-04/orders/450789469/fulfillments/255858046.json', query: '', headers, - data: { "fulfillment": {"location_id": 655441491, "tracking_number": null, "line_items": [{"id": 518995019}]} } + data: { "fulfillment": {"tracking_number": "987654321"} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019888, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:29-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:29-04:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823185, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019888"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019869, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:52-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:52-05:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823189, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823189", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019869"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.message = "The package was shipped this morning."; @@ -455,7 +455,13 @@ describe('Fulfillment resource', () => { }; fulfillment.line_items_by_fulfillment_order = [ { - "fulfillment_order_id": 1046000807 + "fulfillment_order_id": 1046000785, + "fulfillment_order_line_items": [ + { + "id": 1058737495, + "quantity": 1 + } + ] } ]; await fulfillment.save({}); @@ -466,12 +472,12 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/fulfillments.json', query: '', headers, - data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000807}]} } + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000785, "fulfillment_order_line_items": [{"id": 1058737495, "quantity": 1}]}]} } }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019894, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:51-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:51-04:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823189, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823189", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019894"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019865, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:37-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:37-05:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823187, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823187", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019865"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.message = "The package was shipped this morning."; @@ -483,13 +489,7 @@ describe('Fulfillment resource', () => { }; fulfillment.line_items_by_fulfillment_order = [ { - "fulfillment_order_id": 1046000813, - "fulfillment_order_line_items": [ - { - "id": 1058737556, - "quantity": 1 - } - ] + "fulfillment_order_id": 1046000780 } ]; await fulfillment.save({}); @@ -500,15 +500,15 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-04/fulfillments.json', query: '', headers, - data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000813, "fulfillment_order_line_items": [{"id": 1058737556, "quantity": 1}]}]} } + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000780}]} } }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"tracking_company": "my-company", "location_id": 24826418, "id": 1069019889, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:33-04:00", "shipment_status": null, "line_items": [{"id": 1071823186, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823186", "tax_lines": []}], "tracking_number": "1111", "tracking_numbers": ["1111"], "tracking_url": "http://www.my-url.com", "tracking_urls": ["http://www.my-url.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019889"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"tracking_company": "my-company", "location_id": 24826418, "id": 1069019871, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:57-05:00", "shipment_status": null, "line_items": [{"id": 1071823192, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823192", "tax_lines": []}], "tracking_number": "1111", "tracking_numbers": ["1111"], "tracking_url": "http://www.my-url.com", "tracking_urls": ["http://www.my-url.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019871"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); - fulfillment.id = 1069019889; + fulfillment.id = 1069019871; await fulfillment.update_tracking({ body: {"fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com", "company": "my-company"}}}, }); @@ -516,7 +516,7 @@ describe('Fulfillment resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillments/1069019889/update_tracking.json', + path: '/admin/api/2022-04/fulfillments/1069019871/update_tracking.json', query: '', headers, data: { "fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com", "company": "my-company"}} } @@ -524,7 +524,7 @@ describe('Fulfillment resource', () => { }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"status": "success", "location_id": 655441491, "id": 255858046, "order_id": 450789469, "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:58:23-04:00", "tracking_company": "USPS", "shipment_status": null, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"status": "success", "location_id": 655441491, "id": 255858046, "order_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:31-05:00", "tracking_company": "USPS", "shipment_status": null, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; @@ -542,7 +542,7 @@ describe('Fulfillment resource', () => { }); it('test_23', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"status": "open", "location_id": 655441491, "id": 255858046, "order_id": 450789469, "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:58:11-04:00", "tracking_company": "USPS", "shipment_status": null, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"status": "open", "location_id": 655441491, "id": 255858046, "order_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:50-05:00", "tracking_company": "USPS", "shipment_status": null, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; @@ -560,7 +560,7 @@ describe('Fulfillment resource', () => { }); it('test_24', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 655441491, "id": 255858046, "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:58:30-04:00", "tracking_company": "USPS", "shipment_status": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 655441491, "id": 255858046, "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:29:25-05:00", "tracking_company": "USPS", "shipment_status": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.order_id = 450789469; @@ -578,16 +578,16 @@ describe('Fulfillment resource', () => { }); it('test_25', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 24826418, "id": 1069019883, "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:13-04:00", "tracking_company": "UPS", "shipment_status": null, "line_items": [{"id": 1071823182, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019883"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 24826418, "id": 1069019870, "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:54-05:00", "tracking_company": "UPS", "shipment_status": null, "line_items": [{"id": 1071823190, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823190", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019870"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); - fulfillment.id = 1069019883; + fulfillment.id = 1069019870; await fulfillment.cancel({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillments/1069019883/cancel.json', + path: '/admin/api/2022-04/fulfillments/1069019870/cancel.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/fulfillment_event.test.ts b/rest/admin/__tests__/2022-04/fulfillment_event.test.ts index 70b0f36be..689697054 100644 --- a/rest/admin/__tests__/2022-04/fulfillment_event.test.ts +++ b/rest/admin/__tests__/2022-04/fulfillment_event.test.ts @@ -31,7 +31,7 @@ describe('FulfillmentEvent resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_events": [{"id": 944956394, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2022-10-03T13:13:46-04:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2022-10-03T13:13:46-04:00", "updated_at": "2022-10-03T13:13:46-04:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956394"}]})); + queueMockResponse(JSON.stringify({"fulfillment_events": [{"id": 944956391, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:58:57-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:58:57-05:00", "updated_at": "2023-01-03T12:58:57-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956391"}]})); await shopify.rest.FulfillmentEvent.all({ session: session, @@ -50,7 +50,7 @@ describe('FulfillmentEvent resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956392, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2022-10-03T13:13:41-04:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2022-10-03T13:13:41-04:00", "updated_at": "2022-10-03T13:13:41-04:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956392"}})); + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956392, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:59:00-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:59:00-05:00", "updated_at": "2023-01-03T12:59:00-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956392"}})); const fulfillment_event = new shopify.rest.FulfillmentEvent({session: session}); fulfillment_event.order_id = 450789469; @@ -69,7 +69,7 @@ describe('FulfillmentEvent resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956393, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2022-10-03T13:13:43-04:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2022-10-03T13:13:43-04:00", "updated_at": "2022-10-03T13:13:43-04:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956393"}})); + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956393, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:59:00-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:59:00-05:00", "updated_at": "2023-01-03T12:59:00-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956393"}})); await shopify.rest.FulfillmentEvent.find({ session: session, @@ -95,13 +95,13 @@ describe('FulfillmentEvent resource', () => { session: session, order_id: 450789469, fulfillment_id: 255858046, - id: 944956391, + id: 944956394, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/orders/450789469/fulfillments/255858046/events/944956391.json', + path: '/admin/api/2022-04/orders/450789469/fulfillments/255858046/events/944956394.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/fulfillment_order.test.ts b/rest/admin/__tests__/2022-04/fulfillment_order.test.ts index 091afa1a2..16370c4e1 100644 --- a/rest/admin/__tests__/2022-04/fulfillment_order.test.ts +++ b/rest/admin/__tests__/2022-04/fulfillment_order.test.ts @@ -31,7 +31,7 @@ describe('FulfillmentOrder resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000840, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000840, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737539, "shop_id": 548380009, "fulfillment_order_id": 1046000840, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000823, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000815, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737562, "shop_id": 548380009, "fulfillment_order_id": 1046000823, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); await shopify.rest.FulfillmentOrder.all({ session: session, @@ -49,17 +49,17 @@ describe('FulfillmentOrder resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000843, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000843, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000843, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000825, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000817, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737564, "shop_id": 548380009, "fulfillment_order_id": 1046000825, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); await shopify.rest.FulfillmentOrder.find({ session: session, - id: 1046000843, + id: 1046000825, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000843.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000825.json', query: '', headers, data: undefined @@ -67,16 +67,16 @@ describe('FulfillmentOrder resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000836, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000836, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "replacement_fulfillment_order": {"id": 1046000837, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000837, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737536, "shop_id": 548380009, "fulfillment_order_id": 1046000837, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000815, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000807, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "replacement_fulfillment_order": {"id": 1046000816, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000808, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737555, "shop_id": 548380009, "fulfillment_order_id": 1046000816, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000836; + fulfillment_order.id = 1046000815; await fulfillment_order.cancel({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000836/cancel.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000815/cancel.json', query: '', headers, data: undefined @@ -84,10 +84,10 @@ describe('FulfillmentOrder resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000849, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "closed", "status": "incomplete", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000849, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737548, "shop_id": 548380009, "fulfillment_order_id": 1046000849, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000819, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "closed", "status": "incomplete", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000811, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737558, "shop_id": 548380009, "fulfillment_order_id": 1046000819, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000849; + fulfillment_order.id = 1046000819; await fulfillment_order.close({ body: {"fulfillment_order": {"message": "Not enough inventory to complete this work."}}, }); @@ -95,7 +95,7 @@ describe('FulfillmentOrder resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000849/close.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000819/close.json', query: '', headers, data: { "fulfillment_order": {"message": "Not enough inventory to complete this work."} } @@ -103,10 +103,10 @@ describe('FulfillmentOrder resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000846, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 487838322, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000846, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737545, "shop_id": 548380009, "fulfillment_order_id": 1046000846, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "moved_fulfillment_order": {"id": 1046000847, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 655441491, "request_status": "unsubmitted", "status": "open", "supported_actions": ["create_fulfillment", "move"], "destination": {"id": 1046000847, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737546, "shop_id": 548380009, "fulfillment_order_id": 1046000847, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "country_code": "CA", "location_id": 655441491, "name": "50 Rideau Street", "phone": null, "province": "Ontario", "zip": "K1N 9J7"}, "merchant_requests": []}, "remaining_fulfillment_order": null})); + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000821, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 487838322, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000813, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737560, "shop_id": 548380009, "fulfillment_order_id": 1046000821, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "moved_fulfillment_order": {"id": 1046000822, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 655441491, "request_status": "unsubmitted", "status": "open", "supported_actions": ["create_fulfillment", "move"], "destination": {"id": 1046000814, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737561, "shop_id": 548380009, "fulfillment_order_id": 1046000822, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "country_code": "CA", "location_id": 655441491, "name": "50 Rideau Street", "phone": null, "province": "Ontario", "zip": "K1N 9J7"}, "merchant_requests": []}, "remaining_fulfillment_order": null})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000846; + fulfillment_order.id = 1046000821; await fulfillment_order.move({ body: {"fulfillment_order": {"new_location_id": 655441491}}, }); @@ -114,7 +114,7 @@ describe('FulfillmentOrder resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000846/move.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000821/move.json', query: '', headers, data: { "fulfillment_order": {"new_location_id": 655441491} } @@ -122,16 +122,16 @@ describe('FulfillmentOrder resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000845, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000845, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737544, "shop_id": 548380009, "fulfillment_order_id": 1046000845, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000828, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000820, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737567, "shop_id": 548380009, "fulfillment_order_id": 1046000828, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000845; + fulfillment_order.id = 1046000828; await fulfillment_order.open({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000845/open.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000828/open.json', query: '', headers, data: undefined @@ -139,29 +139,29 @@ describe('FulfillmentOrder resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000841, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "scheduled", "supported_actions": ["mark_as_open"], "destination": {"id": 1046000841, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000841, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": "2023-11-19T03:43:00-05:00", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000824, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "scheduled", "supported_actions": ["mark_as_open"], "destination": {"id": 1046000816, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737563, "shop_id": 548380009, "fulfillment_order_id": 1046000824, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": "2024-02-03T12:57:00-05:00", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000841; + fulfillment_order.id = 1046000824; await fulfillment_order.reschedule({ - body: {"fulfillment_order": {"new_fulfill_at": "2023-11-19 08:43 UTC"}}, + body: {"fulfillment_order": {"new_fulfill_at": "2024-02-03 17:57 UTC"}}, }); expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000841/reschedule.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000824/reschedule.json', query: '', headers, - data: { "fulfillment_order": {"new_fulfill_at": "2023-11-19 08:43 UTC"} } + data: { "fulfillment_order": {"new_fulfill_at": "2024-02-03 17:57 UTC"} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000848, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "on_hold", "supported_actions": ["release_hold"], "destination": {"id": 1046000848, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737547, "shop_id": 548380009, "fulfillment_order_id": 1046000848, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [{"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000826, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "on_hold", "supported_actions": ["release_hold"], "destination": {"id": 1046000818, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737565, "shop_id": 548380009, "fulfillment_order_id": 1046000826, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [{"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000848; + fulfillment_order.id = 1046000826; await fulfillment_order.hold({ body: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}}, }); @@ -169,7 +169,7 @@ describe('FulfillmentOrder resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000848/hold.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000826/hold.json', query: '', headers, data: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}} @@ -177,16 +177,16 @@ describe('FulfillmentOrder resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000839, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000839, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737538, "shop_id": 548380009, "fulfillment_order_id": 1046000839, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000820, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000812, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737559, "shop_id": 548380009, "fulfillment_order_id": 1046000820, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000839; + fulfillment_order.id = 1046000820; await fulfillment_order.release_hold({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000839/release_hold.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000820/release_hold.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/fulfillment_request.test.ts b/rest/admin/__tests__/2022-04/fulfillment_request.test.ts index 37bb6f39b..be69ee101 100644 --- a/rest/admin/__tests__/2022-04/fulfillment_request.test.ts +++ b/rest/admin/__tests__/2022-04/fulfillment_request.test.ts @@ -31,56 +31,56 @@ describe('FulfillmentRequest resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000798, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000795, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737501, "shop_id": 548380009, "fulfillment_order_id": 1046000798, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737502, "shop_id": 548380009, "fulfillment_order_id": 1046000798, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737503, "shop_id": 548380009, "fulfillment_order_id": 1046000798, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000799, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000796, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737504, "shop_id": 548380009, "fulfillment_order_id": 1046000799, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737505, "shop_id": 548380009, "fulfillment_order_id": 1046000799, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2022-10-03T13:19:53-04:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": {"id": 1046000800, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000797, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737506, "shop_id": 548380009, "fulfillment_order_id": 1046000800, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000809, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000801, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737541, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:15-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000809, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000801, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737541, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:15-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": null})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000798; + fulfillment_request.fulfillment_order_id = 1046000809; fulfillment_request.message = "Fulfill this ASAP please."; - fulfillment_request.fulfillment_order_line_items = [ - { - "id": 1058737501, - "quantity": 1 - }, - { - "id": 1058737502, - "quantity": 1 - } - ]; await fulfillment_request.save({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000798/fulfillment_request.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000809/fulfillment_request.json', query: '', headers, - data: { "fulfillment_request": {"message": "Fulfill this ASAP please.", "fulfillment_order_line_items": [{"id": 1058737501, "quantity": 1}, {"id": 1058737502, "quantity": 1}]} } + data: { "fulfillment_request": {"message": "Fulfill this ASAP please."} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000803, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737513, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737514, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737515, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2022-10-03T13:20:20-04:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000803, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737513, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737514, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737515, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2022-10-03T13:20:20-04:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": null})); + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000812, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000804, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737549, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737550, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737551, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000813, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000805, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737552, "shop_id": 548380009, "fulfillment_order_id": 1046000813, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737553, "shop_id": 548380009, "fulfillment_order_id": 1046000813, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:27-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": {"id": 1046000814, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000806, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737554, "shop_id": 548380009, "fulfillment_order_id": 1046000814, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000803; + fulfillment_request.fulfillment_order_id = 1046000812; fulfillment_request.message = "Fulfill this ASAP please."; + fulfillment_request.fulfillment_order_line_items = [ + { + "id": 1058737549, + "quantity": 1 + }, + { + "id": 1058737550, + "quantity": 1 + } + ]; await fulfillment_request.save({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000803/fulfillment_request.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000812/fulfillment_request.json', query: '', headers, - data: { "fulfillment_request": {"message": "Fulfill this ASAP please."} } + data: { "fulfillment_request": {"message": "Fulfill this ASAP please.", "fulfillment_order_line_items": [{"id": 1058737549, "quantity": 1}, {"id": 1058737550, "quantity": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000801, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "accepted", "status": "in_progress", "supported_actions": ["request_cancellation", "create_fulfillment"], "destination": {"id": 1046000798, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737507, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737508, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737509, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000810, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "accepted", "status": "in_progress", "supported_actions": ["request_cancellation", "create_fulfillment"], "destination": {"id": 1046000802, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737543, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737544, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737545, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000801; + fulfillment_request.fulfillment_order_id = 1046000810; await fulfillment_request.accept({ body: {"fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."}}, }); @@ -88,7 +88,7 @@ describe('FulfillmentRequest resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000801/fulfillment_request/accept.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000810/fulfillment_request/accept.json', query: '', headers, data: { "fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."} } @@ -96,21 +96,21 @@ describe('FulfillmentRequest resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000802, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "rejected", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000799, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737510, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737511, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737512, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000811, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "rejected", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000803, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737546, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737547, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737548, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000802; + fulfillment_request.fulfillment_order_id = 1046000811; await fulfillment_request.reject({ - body: {"fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737510, "message": "Not enough inventory."}]}}, + body: {"fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737546, "message": "Not enough inventory."}]}}, }); expect({ method: 'POST', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000802/fulfillment_request/reject.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000811/fulfillment_request/reject.json', query: '', headers, - data: { "fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737510, "message": "Not enough inventory."}]} } + data: { "fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737546, "message": "Not enough inventory."}]} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/fulfillment_service.test.ts b/rest/admin/__tests__/2022-04/fulfillment_service.test.ts index c2dbc1473..843bca31a 100644 --- a/rest/admin/__tests__/2022-04/fulfillment_service.test.ts +++ b/rest/admin/__tests__/2022-04/fulfillment_service.test.ts @@ -66,7 +66,7 @@ describe('FulfillmentService resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 1061774523, "name": "Jupiter Fulfillment", "email": null, "service_name": "Jupiter Fulfillment", "handle": "jupiter-fulfillment", "fulfillment_orders_opt_in": false, "include_pending_stock": false, "provider_id": null, "location_id": 1072404578, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/1061774523"}})); + queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 1061774487, "name": "Jupiter Fulfillment", "email": null, "service_name": "Jupiter Fulfillment", "handle": "jupiter-fulfillment", "fulfillment_orders_opt_in": false, "include_pending_stock": false, "provider_id": null, "location_id": 1072404542, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/1061774487"}})); const fulfillment_service = new shopify.rest.FulfillmentService({session: session}); fulfillment_service.name = "Jupiter Fulfillment"; diff --git a/rest/admin/__tests__/2022-04/gift_card.test.ts b/rest/admin/__tests__/2022-04/gift_card.test.ts index 7e770fa28..25146be5e 100644 --- a/rest/admin/__tests__/2022-04/gift_card.test.ts +++ b/rest/admin/__tests__/2022-04/gift_card.test.ts @@ -31,79 +31,42 @@ describe('GiftCard resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1035197676, "balance": "100.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}, {"id": 766118925, "balance": "25.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2021-10-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 766118925, "balance": "25.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2022-01-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); await shopify.rest.GiftCard.all({ session: session, + status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/gift_cards.json', - query: '', + query: 'status=enabled', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"gift_cards": [{"id": 766118925, "balance": "25.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2021-10-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1035197676, "balance": "100.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}, {"id": 766118925, "balance": "25.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2022-01-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); await shopify.rest.GiftCard.all({ session: session, - status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/gift_cards.json', - query: 'status=enabled', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936316, "balance": "25.00", "created_at": "2022-10-03T12:50:53-04:00", "updated_at": "2022-10-03T12:50:53-04:00", "currency": "USD", "initial_value": "25.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "ce2g", "order_id": null, "code": "b72c6222b9chce2g"}})); - - const gift_card = new shopify.rest.GiftCard({session: session}); - gift_card.initial_value = 25.0; - await gift_card.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-04/gift_cards.json', - query: '', - headers, - data: { "gift_card": {"initial_value": 25.0} } - }).toMatchMadeHttpRequest(); - }); - - it('test_4', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936319, "balance": "100.00", "created_at": "2022-10-03T12:51:09-04:00", "updated_at": "2022-10-03T12:51:09-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": "This is a note", "expires_on": null, "template_suffix": "gift_cards.birthday.liquid", "last_characters": "mnop", "order_id": null, "code": "abcdefghijklmnop"}})); - - const gift_card = new shopify.rest.GiftCard({session: session}); - gift_card.note = "This is a note"; - gift_card.initial_value = 100.0; - gift_card.code = "ABCD EFGH IJKL MNOP"; - gift_card.template_suffix = "gift_cards.birthday.liquid"; - await gift_card.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-04/gift_cards.json', - query: '', - headers, - data: { "gift_card": {"note": "This is a note", "initial_value": 100.0, "code": "ABCD EFGH IJKL MNOP", "template_suffix": "gift_cards.birthday.liquid"} } - }).toMatchMadeHttpRequest(); - }); - - it('test_5', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"id": 1035197676, "balance": "100.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}})); + queueMockResponse(JSON.stringify({"gift_card": {"id": 1035197676, "balance": "100.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}})); await shopify.rest.GiftCard.find({ session: session, @@ -120,12 +83,12 @@ describe('GiftCard resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"note": "Updating with a new note", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:58-04:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + it('test_4', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"expires_on": "2020-01-01", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:02-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "last_characters": "0d0d", "order_id": null}})); const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; - gift_card.note = "Updating with a new note"; + gift_card.expires_on = "2020-01-01"; await gift_card.save({}); expect({ @@ -134,16 +97,16 @@ describe('GiftCard resource', () => { path: '/admin/api/2022-04/gift_cards/1035197676.json', query: '', headers, - data: { "gift_card": {"note": "Updating with a new note"} } + data: { "gift_card": {"expires_on": "2020-01-01"} } }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"expires_on": "2020-01-01", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:51:03-04:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "last_characters": "0d0d", "order_id": null}})); + it('test_5', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"note": "Updating with a new note", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:10-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; - gift_card.expires_on = "2020-01-01"; + gift_card.note = "Updating with a new note"; await gift_card.save({}); expect({ @@ -152,47 +115,84 @@ describe('GiftCard resource', () => { path: '/admin/api/2022-04/gift_cards/1035197676.json', query: '', headers, - data: { "gift_card": {"expires_on": "2020-01-01"} } + data: { "gift_card": {"note": "Updating with a new note"} } }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { + it('test_6', async () => { queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.GiftCard.count({ session: session, - status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/gift_cards/count.json', - query: 'status=enabled', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_9', async () => { + it('test_7', async () => { queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.GiftCard.count({ session: session, + status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/gift_cards/count.json', - query: '', + query: 'status=enabled', headers, data: undefined }).toMatchMadeHttpRequest(); }); + it('test_8', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936318, "balance": "100.00", "created_at": "2023-01-03T12:30:11-05:00", "updated_at": "2023-01-03T12:30:11-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": "This is a note", "expires_on": null, "template_suffix": "gift_cards.birthday.liquid", "last_characters": "mnop", "order_id": null, "code": "abcdefghijklmnop"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.note = "This is a note"; + gift_card.initial_value = 100.0; + gift_card.code = "ABCD EFGH IJKL MNOP"; + gift_card.template_suffix = "gift_cards.birthday.liquid"; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"note": "This is a note", "initial_value": 100.0, "code": "ABCD EFGH IJKL MNOP", "template_suffix": "gift_cards.birthday.liquid"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936317, "balance": "25.00", "created_at": "2023-01-03T12:30:08-05:00", "updated_at": "2023-01-03T12:30:08-05:00", "currency": "USD", "initial_value": "25.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "fc53", "order_id": null, "code": "58he9ffdhhc4fc53"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.initial_value = 25.0; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"initial_value": 25.0} } + }).toMatchMadeHttpRequest(); + }); + it('test_10', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"disabled_at": "2022-10-03T12:50:50-04:00", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:50-04:00", "currency": "USD", "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + queueMockResponse(JSON.stringify({"gift_card": {"disabled_at": "2023-01-03T12:30:07-05:00", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:07-05:00", "currency": "USD", "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; @@ -211,7 +211,7 @@ describe('GiftCard resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1063936318, "balance": "10.00", "created_at": "2022-10-03T12:51:07-04:00", "updated_at": "2022-10-03T12:51:07-04:00", "currency": "USD", "initial_value": "10.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "mnop", "order_id": null}]})); + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1063936316, "balance": "10.00", "created_at": "2023-01-03T12:30:02-05:00", "updated_at": "2023-01-03T12:30:02-05:00", "currency": "USD", "initial_value": "10.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "mnop", "order_id": null}]})); await shopify.rest.GiftCard.search({ session: session, diff --git a/rest/admin/__tests__/2022-04/gift_card_adjustment.test.ts b/rest/admin/__tests__/2022-04/gift_card_adjustment.test.ts index ea9552060..4bd192936 100644 --- a/rest/admin/__tests__/2022-04/gift_card_adjustment.test.ts +++ b/rest/admin/__tests__/2022-04/gift_card_adjustment.test.ts @@ -31,7 +31,7 @@ describe('GiftCardAdjustment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"adjustments": [{"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}]})); + queueMockResponse(JSON.stringify({"adjustments": [{"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}]})); await shopify.rest.GiftCardAdjustment.all({ session: session, @@ -49,12 +49,13 @@ describe('GiftCardAdjustment resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273909, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-04-03T13:10:51-04:00", "created_at": "2022-10-03T13:10:51-04:00", "updated_at": "2022-10-03T13:10:51-04:00", "note": null, "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273912, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2023-01-03T12:44:55-05:00", "created_at": "2023-01-03T12:44:55-05:00", "updated_at": "2023-01-03T12:44:55-05:00", "note": null, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; gift_card_adjustment.amount = 10.0; - gift_card_adjustment.processed_at = "2022-04-03T13:10:51-04:00"; + gift_card_adjustment.remote_transaction_ref = "gift_card_app_transaction_193402"; + gift_card_adjustment.remote_transaction_url = "http://example.com/my-gift-card-app/gift_card_adjustments/193402"; await gift_card_adjustment.save({}); expect({ @@ -63,12 +64,12 @@ describe('GiftCardAdjustment resource', () => { path: '/admin/api/2022-04/gift_cards/1035197676/adjustments.json', query: '', headers, - data: { "adjustment": {"amount": 10.0, "processed_at": "2022-04-03T13:10:51-04:00"} } + data: { "adjustment": {"amount": 10.0, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273910, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-10-03T13:10:53-04:00", "created_at": "2022-10-03T13:10:53-04:00", "updated_at": "2022-10-03T13:10:53-04:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273911, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2023-01-03T12:44:54-05:00", "created_at": "2023-01-03T12:44:54-05:00", "updated_at": "2023-01-03T12:44:54-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; @@ -87,7 +88,7 @@ describe('GiftCardAdjustment resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273911, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "-20.00", "processed_at": "2022-10-03T13:10:54-04:00", "created_at": "2022-10-03T13:10:54-04:00", "updated_at": "2022-10-03T13:10:54-04:00", "note": "Customer spent $20 via external service", "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273913, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "-20.00", "processed_at": "2023-01-03T12:44:57-05:00", "created_at": "2023-01-03T12:44:57-05:00", "updated_at": "2023-01-03T12:44:57-05:00", "note": "Customer spent $20 via external service", "remote_transaction_ref": null, "remote_transaction_url": null}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; @@ -106,13 +107,12 @@ describe('GiftCardAdjustment resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273912, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-10-03T13:10:57-04:00", "created_at": "2022-10-03T13:10:57-04:00", "updated_at": "2022-10-03T13:10:57-04:00", "note": null, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273910, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-07-03T12:44:50-04:00", "created_at": "2023-01-03T12:44:50-05:00", "updated_at": "2023-01-03T12:44:50-05:00", "note": null, "remote_transaction_ref": null, "remote_transaction_url": null}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; gift_card_adjustment.amount = 10.0; - gift_card_adjustment.remote_transaction_ref = "gift_card_app_transaction_193402"; - gift_card_adjustment.remote_transaction_url = "http://example.com/my-gift-card-app/gift_card_adjustments/193402"; + gift_card_adjustment.processed_at = "2022-07-03T12:44:50-04:00"; await gift_card_adjustment.save({}); expect({ @@ -121,12 +121,12 @@ describe('GiftCardAdjustment resource', () => { path: '/admin/api/2022-04/gift_cards/1035197676/adjustments.json', query: '', headers, - data: { "adjustment": {"amount": 10.0, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"} } + data: { "adjustment": {"amount": 10.0, "processed_at": "2022-07-03T12:44:50-04:00"} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); await shopify.rest.GiftCardAdjustment.find({ session: session, diff --git a/rest/admin/__tests__/2022-04/image.test.ts b/rest/admin/__tests__/2022-04/image.test.ts index 9afffdefd..e9e6f2c2a 100644 --- a/rest/admin/__tests__/2022-04/image.test.ts +++ b/rest/admin/__tests__/2022-04/image.test.ts @@ -31,290 +31,290 @@ describe('Image resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"images": [{"id": 1001473895, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:29-04:00", "updated_at": "2022-10-03T12:20:29-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814029", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473895"}]})); + queueMockResponse(JSON.stringify({"images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]})); await shopify.rest.Image.all({ session: session, product_id: 632910392, - since_id: "850703190", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products/632910392/images.json', - query: 'since_id=850703190', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]})); + queueMockResponse(JSON.stringify({"images": [{"id": 1001473900, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:38:59-05:00", "updated_at": "2023-01-03T12:38:59-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767539", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473900"}]})); await shopify.rest.Image.all({ session: session, product_id: 632910392, + since_id: "850703190", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products/632910392/images.json', - query: '', + query: 'since_id=850703190', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"count": 3})); + queueMockResponse(JSON.stringify({"image": {"width": 110, "height": 140, "position": 1, "alt": null, "id": 1001473901, "product_id": 632910392, "created_at": "2023-01-03T12:39:02-05:00", "updated_at": "2023-01-03T12:39:02-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767542", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473901"}})); - await shopify.rest.Image.count({ - session: session, - product_id: 632910392, - }); + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPc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ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392/images/count.json', + path: '/admin/api/2022-04/products/632910392/images.json', query: '', headers, - data: undefined + data: { "image": {"position": 1, "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+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80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"count": 0})); + queueMockResponse(JSON.stringify({"image": {"id": 1001473905, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:39:23-05:00", "updated_at": "2023-01-03T12:39:23-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767563", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473905"}})); - await shopify.rest.Image.count({ - session: session, - product_id: 632910392, - since_id: "850703190", - }); + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.variant_ids = [ + 808950810, + 457924702 + ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZRPLIgMZUeJ+jKvrAlK6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qva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392/images/count.json', - query: 'since_id=850703190', + path: '/admin/api/2022-04/products/632910392/images.json', + query: '', headers, - data: undefined + data: { "image": {"variant_ids": [808950810, 457924702], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0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Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"image": {"position": 1, "width": 110, "height": 140, "alt": null, "id": 1001473903, "product_id": 632910392, "created_at": "2023-01-03T12:39:08-05:00", "updated_at": "2023-01-03T12:39:08-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767548", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473903"}})); - await shopify.rest.Image.find({ - session: session, - product_id: 632910392, - id: 850703190, - }); + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKF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p1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392/images/850703190.json', + path: '/admin/api/2022-04/products/632910392/images.json', query: '', headers, - data: undefined + data: { "image": {"position": 1, "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4k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4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 2, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:20:39-04:00", "alt": "new alt tag content", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664814039", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"image": {"id": 1001473904, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:39:10-05:00", "updated_at": "2023-01-03T12:39:10-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-c155h.gif?v=1672767550", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473904"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.id = 850703190; - image.position = 2; - image.alt = "new alt tag content"; + image.src = "http://example.com/rails_logo.gif"; await image.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392/images/850703190.json', + path: '/admin/api/2022-04/products/632910392/images.json', query: '', headers, - data: { "image": {"position": 2, "alt": "new alt tag content"} } + data: { "image": {"src": "http://example.com/rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"image": {"updated_at": "2022-10-03T12:20:45-04:00", "id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664814045", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"image": {"id": 1001473896, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:38:46-05:00", "updated_at": "2023-01-03T12:38:46-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767526", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473896"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.id = 850703190; - image.metafields = [ - { - "key": "my_new_metafield", - "value": "my_new_value", - "type": "single_line_text_field", - "namespace": "tags" - } - ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL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uMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; await image.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392/images/850703190.json', + path: '/admin/api/2022-04/products/632910392/images.json', query: '', headers, - data: { "image": {"metafields": [{"key": "my_new_metafield", "value": "my_new_value", "type": "single_line_text_field", "namespace": "tags"}]} } + data: { "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZI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eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"count": 3})); - const image = new shopify.rest.Image({session: session}); - image.product_id = 632910392; - image.id = 850703190; - image.variant_ids = [ - 808950810, - 457924702 - ]; - await image.save({}); + await shopify.rest.Image.count({ + session: session, + product_id: 632910392, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-04/products/632910392/images/850703190.json', + path: '/admin/api/2022-04/products/632910392/images/count.json', query: '', headers, - data: { "image": {"variant_ids": [808950810, 457924702]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"count": 0})); - await shopify.rest.Image.delete({ + await shopify.rest.Image.count({ session: session, product_id: 632910392, - id: 850703190, + since_id: "850703190", }); expect({ - method: 'DELETE', + method: 'GET', domain, - path: '/admin/api/2022-04/products/632910392/images/850703190.json', - query: '', + path: '/admin/api/2022-04/products/632910392/images/count.json', + query: 'since_id=850703190', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 1001473896, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:33-04:00", "updated_at": "2022-10-03T12:20:33-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20221003-23488-mgiwm9.gif?v=1664814033", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473896"}})); + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); - const image = new shopify.rest.Image({session: session}); - image.product_id = 632910392; - image.src = "http://example.com/rails_logo.gif"; - await image.save({}); + await shopify.rest.Image.find({ + session: session, + product_id: 632910392, + id: 850703190, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/products/632910392/images.json', + path: '/admin/api/2022-04/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"src": "http://example.com/rails_logo.gif"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 1001473897, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:36-04:00", "updated_at": "2022-10-03T12:20:36-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814036", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473897"}})); + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:53-05:00", "alt": "new alt tag content", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672767533", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaY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hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; + image.id = 850703190; + image.position = 2; + image.alt = "new alt tag content"; await image.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products/632910392/images.json', + path: '/admin/api/2022-04/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZI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Fq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: { "image": {"position": 2, "alt": "new alt tag content"} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 1001473899, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:47-04:00", "updated_at": "2022-10-03T12:20:47-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814047", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473899"}})); + queueMockResponse(JSON.stringify({"image": {"updated_at": "2023-01-03T12:39:13-05:00", "id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672767553", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.variant_ids = [ - 808950810, - 457924702 + image.id = 850703190; + image.metafields = [ + { + "key": "my_new_metafield", + "value": "my_new_value", + "type": "single_line_text_field", + "namespace": "tags" + } ]; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis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zpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; await image.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products/632910392/images.json', + path: '/admin/api/2022-04/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"variant_ids": [808950810, 457924702], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9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m7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: { "image": {"metafields": [{"key": "my_new_metafield", "value": "my_new_value", "type": "single_line_text_field", "namespace": "tags"}]} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"image": {"position": 1, "width": 110, "height": 140, "alt": null, "id": 1001473900, "product_id": 632910392, "created_at": "2022-10-03T12:20:50-04:00", "updated_at": "2022-10-03T12:20:50-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814050", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473900"}})); + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.position = 1; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5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GDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; + image.id = 850703190; + image.variant_ids = [ + 808950810, + 457924702 + ]; await image.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products/632910392/images.json', + path: '/admin/api/2022-04/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"position": 1, "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLeb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ZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: { "image": {"variant_ids": [808950810, 457924702]} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"image": {"width": 110, "height": 140, "position": 1, "alt": null, "id": 1001473904, "product_id": 632910392, "created_at": "2022-10-03T12:21:03-04:00", "updated_at": "2022-10-03T12:21:03-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814063", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473904"}})); + queueMockResponse(JSON.stringify({})); - const image = new shopify.rest.Image({session: session}); - image.product_id = 632910392; - image.position = 1; - image.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9igg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Xe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; - await image.save({}); + await shopify.rest.Image.delete({ + session: session, + product_id: 632910392, + id: 850703190, + }); expect({ - method: 'POST', + method: 'DELETE', domain, - path: '/admin/api/2022-04/products/632910392/images.json', + path: '/admin/api/2022-04/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"position": 1, "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nP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aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: undefined }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/inventory_item.test.ts b/rest/admin/__tests__/2022-04/inventory_item.test.ts index ea061a34f..a87845db1 100644 --- a/rest/admin/__tests__/2022-04/inventory_item.test.ts +++ b/rest/admin/__tests__/2022-04/inventory_item.test.ts @@ -31,7 +31,7 @@ describe('InventoryItem resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"inventory_items": [{"id": 39072856, "sku": "IPOD2008GREEN", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/39072856"}, {"id": 457924702, "sku": "IPOD2008BLACK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/457924702"}, {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}]})); + queueMockResponse(JSON.stringify({"inventory_items": [{"id": 39072856, "sku": "IPOD2008GREEN", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/39072856"}, {"id": 457924702, "sku": "IPOD2008BLACK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/457924702"}, {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}]})); await shopify.rest.InventoryItem.all({ session: session, @@ -49,7 +49,7 @@ describe('InventoryItem resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); await shopify.rest.InventoryItem.find({ session: session, @@ -67,7 +67,7 @@ describe('InventoryItem resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "new sku", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:11:09-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "new sku", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:07-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); const inventory_item = new shopify.rest.InventoryItem({session: session}); inventory_item.id = 808950810; @@ -85,7 +85,7 @@ describe('InventoryItem resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); const inventory_item = new shopify.rest.InventoryItem({session: session}); inventory_item.id = 808950810; diff --git a/rest/admin/__tests__/2022-04/inventory_level.test.ts b/rest/admin/__tests__/2022-04/inventory_level.test.ts index 6ff4f31bf..4669b8225 100644 --- a/rest/admin/__tests__/2022-04/inventory_level.test.ts +++ b/rest/admin/__tests__/2022-04/inventory_level.test.ts @@ -31,7 +31,7 @@ describe('InventoryLevel resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 655441491, "available": 2, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 655441491, "available": 4, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 655441491, "available": 2, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 655441491, "available": 4, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); await shopify.rest.InventoryLevel.all({ session: session, @@ -49,44 +49,44 @@ describe('InventoryLevel resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}]})); await shopify.rest.InventoryLevel.all({ session: session, - inventory_item_ids: "808950810,39072856", - location_ids: "655441491,487838322", + inventory_item_ids: "808950810", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/inventory_levels.json', - query: 'inventory_item_ids=808950810%2C39072856&location_ids=655441491%2C487838322', + query: 'inventory_item_ids=808950810', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); await shopify.rest.InventoryLevel.all({ session: session, - inventory_item_ids: "808950810", + inventory_item_ids: "808950810,39072856", + location_ids: "655441491,487838322", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/inventory_levels.json', - query: 'inventory_item_ids=808950810', + query: 'inventory_item_ids=808950810%2C39072856&location_ids=655441491%2C487838322', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 6, "updated_at": "2022-10-03T13:14:39-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 6, "updated_at": "2023-01-03T13:03:33-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); const inventory_level = new shopify.rest.InventoryLevel({session: session}); @@ -124,7 +124,7 @@ describe('InventoryLevel resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 457924702, "location_id": 844681632, "available": 0, "updated_at": "2022-10-03T13:14:35-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702"}})); + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 457924702, "location_id": 844681632, "available": 0, "updated_at": "2023-01-03T13:03:42-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702"}})); const inventory_level = new shopify.rest.InventoryLevel({session: session}); @@ -143,7 +143,7 @@ describe('InventoryLevel resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 42, "updated_at": "2022-10-03T13:14:50-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 42, "updated_at": "2023-01-03T13:03:52-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); const inventory_level = new shopify.rest.InventoryLevel({session: session}); diff --git a/rest/admin/__tests__/2022-04/location.test.ts b/rest/admin/__tests__/2022-04/location.test.ts index 34d8fd129..78c6b41e1 100644 --- a/rest/admin/__tests__/2022-04/location.test.ts +++ b/rest/admin/__tests__/2022-04/location.test.ts @@ -31,7 +31,7 @@ describe('Location resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"locations": [{"id": 655441491, "name": "50 Rideau Street", "address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "zip": "K1N 9J7", "province": "Ontario", "country": "CA", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "CA", "country_name": "Canada", "province_code": "ON", "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/655441491", "localized_country_name": "Canada", "localized_province_name": "Ontario"}, {"id": 24826418, "name": "Apple Api Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/24826418", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 844681632, "name": "Apple Cupertino", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/844681632", "localized_country_name": "United States", "localized_province_name": null}, {"id": 611870435, "name": "Apple Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/611870435", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322", "localized_country_name": "United States", "localized_province_name": null}]})); + queueMockResponse(JSON.stringify({"locations": [{"id": 655441491, "name": "50 Rideau Street", "address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "zip": "K1N 9J7", "province": "Ontario", "country": "CA", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "CA", "country_name": "Canada", "province_code": "ON", "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/655441491", "localized_country_name": "Canada", "localized_province_name": "Ontario"}, {"id": 24826418, "name": "Apple Api Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/24826418", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 844681632, "name": "Apple Cupertino", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/844681632", "localized_country_name": "United States", "localized_province_name": null}, {"id": 611870435, "name": "Apple Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/611870435", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322", "localized_country_name": "United States", "localized_province_name": null}]})); await shopify.rest.Location.all({ session: session, @@ -48,7 +48,7 @@ describe('Location resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"location": {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322"}})); + queueMockResponse(JSON.stringify({"location": {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322"}})); await shopify.rest.Location.find({ session: session, @@ -83,7 +83,7 @@ describe('Location resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 487838322, "available": 18, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 487838322, "available": 36, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 487838322, "available": 18, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 487838322, "available": 36, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}]})); await shopify.rest.Location.inventory_levels({ session: session, diff --git a/rest/admin/__tests__/2022-04/locations_for_move.test.ts b/rest/admin/__tests__/2022-04/locations_for_move.test.ts index 194e38b6d..c8c9cac03 100644 --- a/rest/admin/__tests__/2022-04/locations_for_move.test.ts +++ b/rest/admin/__tests__/2022-04/locations_for_move.test.ts @@ -35,13 +35,13 @@ describe('LocationsForMove resource', () => { await shopify.rest.LocationsForMove.all({ session: session, - fulfillment_order_id: 1046000830, + fulfillment_order_id: 1046000829, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/fulfillment_orders/1046000830/locations_for_move.json', + path: '/admin/api/2022-04/fulfillment_orders/1046000829/locations_for_move.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/marketing_event.test.ts b/rest/admin/__tests__/2022-04/marketing_event.test.ts index c0e8a2abf..aa2c6eb22 100644 --- a/rest/admin/__tests__/2022-04/marketing_event.test.ts +++ b/rest/admin/__tests__/2022-04/marketing_event.test.ts @@ -31,7 +31,7 @@ describe('MarketingEvent resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"marketing_events": [{"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2022-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}]})); + queueMockResponse(JSON.stringify({"marketing_events": [{"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2023-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}]})); await shopify.rest.MarketingEvent.all({ session: session, @@ -48,11 +48,11 @@ describe('MarketingEvent resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"marketing_event": {"id": 1069063883, "event_type": "ad", "remote_id": null, "started_at": "2022-12-15T00:00:00-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": null, "currency": null, "manage_url": null, "preview_url": null, "utm_campaign": "Christmas2022", "utm_source": "facebook", "utm_medium": "cpc", "budget_type": null, "description": null, "marketing_channel": "social", "paid": true, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": 1063897333, "admin_graphql_api_id": "gid://shopify/MarketingEvent/1069063883", "marketed_resources": []}})); + queueMockResponse(JSON.stringify({"marketing_event": {"id": 1069063883, "event_type": "ad", "remote_id": null, "started_at": "2023-12-14T19:00:00-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": null, "currency": null, "manage_url": null, "preview_url": null, "utm_campaign": "Christmas2023", "utm_source": "facebook", "utm_medium": "cpc", "budget_type": null, "description": null, "marketing_channel": "social", "paid": true, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": 1063897333, "admin_graphql_api_id": "gid://shopify/MarketingEvent/1069063883", "marketed_resources": []}})); const marketing_event = new shopify.rest.MarketingEvent({session: session}); - marketing_event.started_at = "2022-12-15"; - marketing_event.utm_campaign = "Christmas2022"; + marketing_event.started_at = "2023-12-15"; + marketing_event.utm_campaign = "Christmas2023"; marketing_event.utm_source = "facebook"; marketing_event.utm_medium = "cpc"; marketing_event.event_type = "ad"; @@ -67,7 +67,7 @@ describe('MarketingEvent resource', () => { path: '/admin/api/2022-04/marketing_events.json', query: '', headers, - data: { "marketing_event": {"started_at": "2022-12-15", "utm_campaign": "Christmas2022", "utm_source": "facebook", "utm_medium": "cpc", "event_type": "ad", "referring_domain": "facebook.com", "marketing_channel": "social", "paid": true} } + data: { "marketing_event": {"started_at": "2023-12-15", "utm_campaign": "Christmas2023", "utm_source": "facebook", "utm_medium": "cpc", "event_type": "ad", "referring_domain": "facebook.com", "marketing_channel": "social", "paid": true} } }).toMatchMadeHttpRequest(); }); @@ -89,7 +89,7 @@ describe('MarketingEvent resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"marketing_event": {"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2022-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + queueMockResponse(JSON.stringify({"marketing_event": {"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2023-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); await shopify.rest.MarketingEvent.find({ session: session, @@ -107,14 +107,14 @@ describe('MarketingEvent resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"marketing_event": {"started_at": "2022-02-01T19:00:00-05:00", "ended_at": "2022-02-02T19:00:00-05:00", "scheduled_to_end_at": "2022-02-03T19:00:00-05:00", "remote_id": "1000:2000", "currency": "CAD", "budget": "11.1", "budget_type": "daily", "id": 998730532, "event_type": "post", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + queueMockResponse(JSON.stringify({"marketing_event": {"started_at": "2023-02-01T19:00:00-05:00", "ended_at": "2023-02-02T19:00:00-05:00", "scheduled_to_end_at": "2023-02-03T19:00:00-05:00", "remote_id": "1000:2000", "currency": "CAD", "budget": "11.1", "budget_type": "daily", "id": 998730532, "event_type": "post", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); const marketing_event = new shopify.rest.MarketingEvent({session: session}); marketing_event.id = 998730532; marketing_event.remote_id = "1000:2000"; - marketing_event.started_at = "2022-02-02T00:00 +00:00"; - marketing_event.ended_at = "2022-02-03T00:00 +00:00"; - marketing_event.scheduled_to_end_at = "2022-02-04T00:00 +00:00"; + marketing_event.started_at = "2023-02-02T00:00 +00:00"; + marketing_event.ended_at = "2023-02-03T00:00 +00:00"; + marketing_event.scheduled_to_end_at = "2023-02-04T00:00 +00:00"; marketing_event.budget = "11.1"; marketing_event.budget_type = "daily"; marketing_event.currency = "CAD"; @@ -131,7 +131,7 @@ describe('MarketingEvent resource', () => { path: '/admin/api/2022-04/marketing_events/998730532.json', query: '', headers, - data: { "marketing_event": {"remote_id": "1000:2000", "started_at": "2022-02-02T00:00 +00:00", "ended_at": "2022-02-03T00:00 +00:00", "scheduled_to_end_at": "2022-02-04T00:00 +00:00", "budget": "11.1", "budget_type": "daily", "currency": "CAD", "utm_campaign": "other", "utm_source": "other", "utm_medium": "other", "event_type": "ad", "referring_domain": "instagram.com"} } + data: { "marketing_event": {"remote_id": "1000:2000", "started_at": "2023-02-02T00:00 +00:00", "ended_at": "2023-02-03T00:00 +00:00", "scheduled_to_end_at": "2023-02-04T00:00 +00:00", "budget": "11.1", "budget_type": "daily", "currency": "CAD", "utm_campaign": "other", "utm_source": "other", "utm_medium": "other", "event_type": "ad", "referring_domain": "instagram.com"} } }).toMatchMadeHttpRequest(); }); @@ -154,12 +154,12 @@ describe('MarketingEvent resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"engagements": [{"occurred_on": "2022-01-15", "fetched_at": null, "views_count": 0, "impressions_count": null, "clicks_count": 0, "favorites_count": 0, "comments_count": null, "shares_count": null, "ad_spend": "10.0", "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2022-01-16", "fetched_at": null, "views_count": 100, "impressions_count": null, "clicks_count": 50, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2022-01-17", "fetched_at": null, "views_count": 200, "impressions_count": null, "clicks_count": 100, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}]})); + queueMockResponse(JSON.stringify({"engagements": [{"occurred_on": "2023-01-15", "fetched_at": null, "views_count": 0, "impressions_count": null, "clicks_count": 0, "favorites_count": 0, "comments_count": null, "shares_count": null, "ad_spend": "10.0", "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2023-01-16", "fetched_at": null, "views_count": 100, "impressions_count": null, "clicks_count": 50, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2023-01-17", "fetched_at": null, "views_count": 200, "impressions_count": null, "clicks_count": 100, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}]})); const marketing_event = new shopify.rest.MarketingEvent({session: session}); marketing_event.id = 998730532; await marketing_event.engagements({ - body: {"engagements": [{"occurred_on": "2022-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2022-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2022-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]}, + body: {"engagements": [{"occurred_on": "2023-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2023-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2023-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]}, }); expect({ @@ -168,7 +168,7 @@ describe('MarketingEvent resource', () => { path: '/admin/api/2022-04/marketing_events/998730532/engagements.json', query: '', headers, - data: {"engagements": [{"occurred_on": "2022-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2022-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2022-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]} + data: {"engagements": [{"occurred_on": "2023-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2023-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2023-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]} }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/metafield.test.ts b/rest/admin/__tests__/2022-04/metafield.test.ts index 4d6a49166..10651ac61 100644 --- a/rest/admin/__tests__/2022-04/metafield.test.ts +++ b/rest/admin/__tests__/2022-04/metafield.test.ts @@ -49,25 +49,25 @@ describe('Metafield resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 51714266, "namespace": "my_namespace", "key": "my_key", "value": "Hello", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/51714266"}, {"id": 116539875, "namespace": "descriptors", "key": "subtitle", "value": "The best ipod", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/116539875"}, {"id": 263497237, "namespace": "installments", "key": "disable", "value": true, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/263497237"}, {"id": 273160493, "namespace": "facts", "key": "isbn", "value": "978-0-14-004259-7", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/273160493"}, {"id": 524118066, "namespace": "facts", "key": "ean", "value": "0123456789012", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/524118066"}, {"id": 543636738, "namespace": "reviews", "key": "rating_count", "value": 1, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/543636738"}, {"id": 572384404, "namespace": "reviews", "key": "rating", "value": "{\"value\": \"3.5\", \"scale_min\": \"1.0\", \"scale_max\": \"5.0\"}", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "rating", "admin_graphql_api_id": "gid://shopify/Metafield/572384404"}, {"id": 613330208, "namespace": "shopify_filter", "key": "display", "value": "retina", "description": "This field keeps track of the type of display", "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/613330208"}, {"id": 779326701, "namespace": "facts", "key": "upc", "value": "012345678901", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/779326701"}, {"id": 845366454, "namespace": "translations", "key": "title_fr", "value": "produit", "description": "French product title", "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/845366454"}, {"id": 861799889, "namespace": "my_other_fields", "key": "organic", "value": true, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/861799889"}, {"id": 870326793, "namespace": "descriptors", "key": "care_guide", "value": "Wash in cold water", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": null, "admin_graphql_api_id": "gid://shopify/Metafield/870326793"}, {"id": 908250163, "namespace": "my_other_fields", "key": "shipping_policy", "value": "Ships for free in Canada", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/908250163"}, {"id": 925288667, "namespace": "my_other_fields", "key": "year_released", "value": 2019, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/925288667"}, {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}, {"id": 1029402048, "namespace": "my_other_fields", "key": "ingredients", "value": "[\"apple\", \"music\", \"u2\"]", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "list.single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1029402048"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 519046726, "namespace": "notes", "key": "descriptionription", "value": "Collection description", "description": "Custom Collection notes", "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/519046726"}, {"id": 624849518, "namespace": "global", "key": "description_tag", "value": "Some seo description value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/624849518"}, {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "632910392", "owner_resource": "product"}, + metafield: {"owner_id": "482865238", "owner_resource": "collection"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/metafields.json', - query: 'metafield%5Bowner_id%5D=632910392&metafield%5Bowner_resource%5D=product', + query: 'metafield%5Bowner_id%5D=482865238&metafield%5Bowner_resource%5D=collection', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}]})); await shopify.rest.Metafield.all({ session: session, @@ -85,7 +85,7 @@ describe('Metafield resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}]})); await shopify.rest.Metafield.all({ session: session, @@ -103,7 +103,7 @@ describe('Metafield resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}]})); await shopify.rest.Metafield.all({ session: session, @@ -121,54 +121,54 @@ describe('Metafield resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 1063298188, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2022-10-03T12:17:58-04:00", "updated_at": "2022-10-03T12:17:58-04:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1063298188"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 51714266, "namespace": "my_namespace", "key": "my_key", "value": "Hello", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/51714266"}, {"id": 116539875, "namespace": "descriptors", "key": "subtitle", "value": "The best ipod", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/116539875"}, {"id": 263497237, "namespace": "installments", "key": "disable", "value": true, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/263497237"}, {"id": 273160493, "namespace": "facts", "key": "isbn", "value": "978-0-14-004259-7", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/273160493"}, {"id": 524118066, "namespace": "facts", "key": "ean", "value": "0123456789012", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/524118066"}, {"id": 543636738, "namespace": "reviews", "key": "rating_count", "value": 1, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/543636738"}, {"id": 572384404, "namespace": "reviews", "key": "rating", "value": "{\"value\": \"3.5\", \"scale_min\": \"1.0\", \"scale_max\": \"5.0\"}", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "rating", "admin_graphql_api_id": "gid://shopify/Metafield/572384404"}, {"id": 613330208, "namespace": "shopify_filter", "key": "display", "value": "retina", "description": "This field keeps track of the type of display", "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/613330208"}, {"id": 779326701, "namespace": "facts", "key": "upc", "value": "012345678901", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/779326701"}, {"id": 845366454, "namespace": "translations", "key": "title_fr", "value": "produit", "description": "French product title", "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/845366454"}, {"id": 861799889, "namespace": "my_other_fields", "key": "organic", "value": true, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/861799889"}, {"id": 870326793, "namespace": "descriptors", "key": "care_guide", "value": "Wash in cold water", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": null, "admin_graphql_api_id": "gid://shopify/Metafield/870326793"}, {"id": 908250163, "namespace": "my_other_fields", "key": "shipping_policy", "value": "Ships for free in Canada", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/908250163"}, {"id": 925288667, "namespace": "my_other_fields", "key": "year_released", "value": 2019, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/925288667"}, {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}, {"id": 1029402048, "namespace": "my_other_fields", "key": "ingredients", "value": "[\"apple\", \"music\", \"u2\"]", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "list.single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1029402048"}]})); await shopify.rest.Metafield.all({ session: session, - since_id: "721389482", + metafield: {"owner_id": "632910392", "owner_resource": "product"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/metafields.json', - query: 'since_id=721389482', + query: 'metafield%5Bowner_id%5D=632910392&metafield%5Bowner_resource%5D=product', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"metafields": []})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "674387490", "owner_resource": "article"}, + metafield: {"owner_id": "850703190", "owner_resource": "product_image"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/metafields.json', - query: 'metafield%5Bowner_id%5D=674387490&metafield%5Bowner_resource%5D=article', + query: 'metafield%5Bowner_id%5D=850703190&metafield%5Bowner_resource%5D=product_image', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 519046726, "namespace": "notes", "key": "descriptionription", "value": "Collection description", "description": "Custom Collection notes", "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/519046726"}, {"id": 624849518, "namespace": "global", "key": "description_tag", "value": "Some seo description value", "description": null, "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/624849518"}, {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}]})); + queueMockResponse(JSON.stringify({"metafields": []})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "482865238", "owner_resource": "collection"}, + metafield: {"owner_id": "49148385", "owner_resource": "variants"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/metafields.json', - query: 'metafield%5Bowner_id%5D=482865238&metafield%5Bowner_resource%5D=collection', + query: 'metafield%5Bowner_id%5D=49148385&metafield%5Bowner_resource%5D=variants', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -179,234 +179,447 @@ describe('Metafield resource', () => { await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "49148385", "owner_resource": "variants"}, + metafield: {"owner_id": "674387490", "owner_resource": "article"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/metafields.json', - query: 'metafield%5Bowner_id%5D=49148385&metafield%5Bowner_resource%5D=variants', + query: 'metafield%5Bowner_id%5D=674387490&metafield%5Bowner_resource%5D=article', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}]})); await shopify.rest.Metafield.all({ session: session, + metafield: {"owner_id": "450789469", "owner_resource": "order"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/metafields.json', - query: '', + query: 'metafield%5Bowner_id%5D=450789469&metafield%5Bowner_resource%5D=order', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "450789469", "owner_resource": "order"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/metafields.json', - query: 'metafield%5Bowner_id%5D=450789469&metafield%5Bowner_resource%5D=order', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 1069229006, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:53:15-05:00", "updated_at": "2023-01-03T12:53:15-05:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069229006"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "850703190", "owner_resource": "product_image"}, + since_id: "721389482", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/metafields.json', - query: 'metafield%5Bowner_id%5D=850703190&metafield%5Bowner_resource%5D=product_image', + query: 'since_id=721389482', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228998, "namespace": "my_fields", "key": "sponsor", "value": "Shopify", "description": null, "owner_id": 382285388, "created_at": "2023-01-03T12:52:48-05:00", "updated_at": "2023-01-03T12:52:48-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228998"}})); - await shopify.rest.Metafield.count({ - session: session, - page_id: 131092082, - }); + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.namespace = "my_fields"; + metafield.key = "sponsor"; + metafield.type = "single_line_text_field"; + metafield.value = "Shopify"; + await metafield.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/pages/131092082/metafields/count.json', + path: '/admin/api/2022-04/blogs/382285388/metafields.json', query: '', headers, - data: undefined + data: { "metafield": {"namespace": "my_fields", "key": "sponsor", "type": "single_line_text_field", "value": "Shopify"} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"count": 3})); + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228972, "namespace": "my_fields", "key": "discount", "value": "25%", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:50:28-05:00", "updated_at": "2023-01-03T12:50:28-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228972"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.namespace = "my_fields"; + metafield.key = "discount"; + metafield.type = "single_line_text_field"; + metafield.value = "25%"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/collections/482865238/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "discount", "type": "single_line_text_field", "value": "25%"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228983, "namespace": "discounts", "key": "special", "value": "yes", "description": null, "owner_id": 207119551, "created_at": "2023-01-03T12:51:01-05:00", "updated_at": "2023-01-03T12:51:01-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228983"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.namespace = "discounts"; + metafield.key = "special"; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/customers/207119551/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "discounts", "key": "special", "value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069229003, "namespace": "my_fields", "key": "purchase_order", "value": "97453", "description": null, "owner_id": 622762746, "created_at": "2023-01-03T12:53:03-05:00", "updated_at": "2023-01-03T12:53:03-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069229003"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "97453"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/draft_orders/622762746/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "97453"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228969, "namespace": "my_fields", "key": "subtitle", "value": "A subtitle for my page", "description": null, "owner_id": 131092082, "created_at": "2023-01-03T12:49:57-05:00", "updated_at": "2023-01-03T12:49:57-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228969"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.namespace = "my_fields"; + metafield.key = "subtitle"; + metafield.type = "single_line_text_field"; + metafield.value = "A subtitle for my page"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/pages/131092082/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "subtitle", "type": "single_line_text_field", "value": "A subtitle for my page"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228994, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:51:54-05:00", "updated_at": "2023-01-03T12:51:54-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228994"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.namespace = "inventory"; + metafield.key = "warehouse"; + metafield.value = 25; + metafield.type = "number_integer"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/products/632910392/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "inventory", "key": "warehouse", "value": 25, "type": "number_integer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228985, "namespace": "translaction", "key": "title_spanish", "value": "botas", "description": null, "owner_id": 850703190, "created_at": "2023-01-03T12:51:06-05:00", "updated_at": "2023-01-03T12:51:06-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228985"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.namespace = "translaction"; + metafield.key = "title_spanish"; + metafield.type = "single_line_text_field"; + metafield.value = "botas"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/product_images/850703190/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "translaction", "key": "title_spanish", "type": "single_line_text_field", "value": "botas"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228995, "namespace": "my_fields", "key": "liner_material", "value": "synthetic leather", "description": null, "owner_id": 49148385, "created_at": "2023-01-03T12:52:21-05:00", "updated_at": "2023-01-03T12:52:21-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228995"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.namespace = "my_fields"; + metafield.key = "liner_material"; + metafield.type = "single_line_text_field"; + metafield.value = "synthetic leather"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/variants/49148385/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "liner_material", "type": "single_line_text_field", "value": "synthetic leather"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228982, "namespace": "my_fields", "key": "category", "value": "outdoors", "description": null, "owner_id": 674387490, "created_at": "2023-01-03T12:50:58-05:00", "updated_at": "2023-01-03T12:50:58-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228982"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.namespace = "my_fields"; + metafield.key = "category"; + metafield.type = "single_line_text_field"; + metafield.value = "outdoors"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/articles/674387490/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "category", "type": "single_line_text_field", "value": "outdoors"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069229001, "namespace": "my_fields", "key": "purchase_order", "value": "123", "description": null, "owner_id": 450789469, "created_at": "2023-01-03T12:52:57-05:00", "updated_at": "2023-01-03T12:52:57-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069229001"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "123"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/orders/450789469/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "123"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228973, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:50:31-05:00", "updated_at": "2023-01-03T12:50:31-05:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228973"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.namespace = "inventory"; + metafield.key = "warehouse"; + metafield.value = 25; + metafield.type = "number_integer"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "inventory", "key": "warehouse", "value": 25, "type": "number_integer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + queueMockResponse(JSON.stringify({"count": 0})); await shopify.rest.Metafield.count({ session: session, - collection_id: 482865238, + blog_id: 382285388, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/collections/482865238/metafields/count.json', + path: '/admin/api/2022-04/blogs/382285388/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_15', async () => { - queueMockResponse(JSON.stringify({"count": 0})); + it('test_25', async () => { + queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.Metafield.count({ session: session, - variant_id: 49148385, + collection_id: 482865238, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/variants/49148385/metafields/count.json', + path: '/admin/api/2022-04/collections/482865238/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_16', async () => { + it('test_26', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - order_id: 450789469, + customer_id: 207119551, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/orders/450789469/metafields/count.json', + path: '/admin/api/2022-04/customers/207119551/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_17', async () => { + it('test_27', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, + draft_order_id: 622762746, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/metafields/count.json', + path: '/admin/api/2022-04/draft_orders/622762746/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_18', async () => { + it('test_28', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - draft_order_id: 622762746, + page_id: 131092082, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/draft_orders/622762746/metafields/count.json', + path: '/admin/api/2022-04/pages/131092082/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_19', async () => { - queueMockResponse(JSON.stringify({"count": 0})); + it('test_29', async () => { + queueMockResponse(JSON.stringify({"count": 16})); await shopify.rest.Metafield.count({ session: session, - blog_id: 382285388, + product_id: 632910392, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/blogs/382285388/metafields/count.json', + path: '/admin/api/2022-04/products/632910392/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_20', async () => { + it('test_30', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - customer_id: 207119551, + product_image_id: 850703190, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/customers/207119551/metafields/count.json', + path: '/admin/api/2022-04/product_images/850703190/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_21', async () => { - queueMockResponse(JSON.stringify({"count": 16})); + it('test_31', async () => { + queueMockResponse(JSON.stringify({"count": 0})); await shopify.rest.Metafield.count({ session: session, - product_id: 632910392, + variant_id: 49148385, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/products/632910392/metafields/count.json', + path: '/admin/api/2022-04/variants/49148385/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_22', async () => { + it('test_32', async () => { queueMockResponse(JSON.stringify({"count": 0})); await shopify.rest.Metafield.count({ @@ -424,64 +637,62 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_23', async () => { + it('test_33', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - product_image_id: 850703190, + order_id: 450789469, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/product_images/850703190/metafields/count.json', + path: '/admin/api/2022-04/orders/450789469/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_24', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 323119633, "namespace": "my_fields", "key": "color", "value": "Pink", "description": null, "owner_id": 808950810, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + it('test_34', async () => { + queueMockResponse(JSON.stringify({"count": 1})); - await shopify.rest.Metafield.find({ + await shopify.rest.Metafield.count({ session: session, - variant_id: 49148385, - id: 323119633, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/variants/49148385/metafields/323119633.json', + path: '/admin/api/2022-04/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_25', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + it('test_35', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 534526895, "namespace": "translation", "key": "title_fr", "value": "Le iPod", "description": "Blog French title translation", "owner_id": 241253187, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); await shopify.rest.Metafield.find({ session: session, - product_image_id: 850703190, - id: 625663657, + blog_id: 382285388, + id: 534526895, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/product_images/850703190/metafields/625663657.json', + path: '/admin/api/2022-04/blogs/382285388/metafields/534526895.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_26', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + it('test_36', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); await shopify.rest.Metafield.find({ session: session, @@ -499,8 +710,27 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_27', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + it('test_37', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + await shopify.rest.Metafield.find({ + session: session, + customer_id: 207119551, + id: 220591908, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2022-04/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_38', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); await shopify.rest.Metafield.find({ session: session, @@ -518,102 +748,103 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_28', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + it('test_39', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); await shopify.rest.Metafield.find({ session: session, - product_id: 632910392, - id: 1001077698, + page_id: 131092082, + id: 290519330, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/products/632910392/metafields/1001077698.json', + path: '/admin/api/2022-04/pages/131092082/metafields/290519330.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_29', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + it('test_40', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); await shopify.rest.Metafield.find({ session: session, - id: 721389482, + product_id: 632910392, + id: 1001077698, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/metafields/721389482.json', + path: '/admin/api/2022-04/products/632910392/metafields/1001077698.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_30', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + it('test_41', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); await shopify.rest.Metafield.find({ session: session, - customer_id: 207119551, - id: 220591908, + product_image_id: 850703190, + id: 625663657, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/customers/207119551/metafields/220591908.json', + path: '/admin/api/2022-04/product_images/850703190/metafields/625663657.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_31', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 534526895, "namespace": "translation", "key": "title_fr", "value": "Le iPod", "description": "Blog French title translation", "owner_id": 241253187, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + it('test_42', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 323119633, "namespace": "my_fields", "key": "color", "value": "Pink", "description": null, "owner_id": 808950810, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); await shopify.rest.Metafield.find({ session: session, - blog_id: 382285388, - id: 534526895, + variant_id: 49148385, + id: 323119633, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/blogs/382285388/metafields/534526895.json', + path: '/admin/api/2022-04/variants/49148385/metafields/323119633.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_32', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + it('test_43', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 838981074, "namespace": "translation", "key": "title_fr", "value": "Le Article", "description": "Article French title translation", "owner_id": 134645308, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); await shopify.rest.Metafield.find({ session: session, - page_id: 131092082, - id: 290519330, + article_id: 674387490, + id: 838981074, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/pages/131092082/metafields/290519330.json', + path: '/admin/api/2022-04/articles/674387490/metafields/838981074.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_33', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + it('test_44', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); await shopify.rest.Metafield.find({ session: session, @@ -631,64 +862,282 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_34', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 838981074, "namespace": "translation", "key": "title_fr", "value": "Le Article", "description": "Article French title translation", "owner_id": 134645308, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + it('test_45', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); await shopify.rest.Metafield.find({ session: session, - article_id: 674387490, - id: 838981074, + id: 721389482, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/articles/674387490/metafields/838981074.json', + path: '/admin/api/2022-04/metafields/721389482.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_35', async () => { + it('test_46', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated blog title", "owner_id": 241253187, "namespace": "translation", "key": "title_fr", "id": 534526895, "description": "Blog French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:53:17-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.id = 534526895; + metafield.value = "a translated blog title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/blogs/382285388/metafields/534526895.json', + query: '', + headers, + data: { "metafield": {"value": "a translated blog title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_47', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "seo title", "owner_id": 482865238, "namespace": "global", "key": "title_tag", "id": 1010236510, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:49:17-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.id = 1010236510; + metafield.value = "seo title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/collections/482865238/metafields/1010236510.json', + query: '', + headers, + data: { "metafield": {"value": "seo title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_48', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "yes", "owner_id": 207119551, "namespace": "discounts", "key": "returning_customer", "id": 220591908, "description": "Customer deserves discount", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:50:56-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.id = 220591908; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: { "metafield": {"value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_49', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "110000", "owner_id": 622762746, "namespace": "notes", "key": "note", "id": 106172460, "description": "This is for notes", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:51:31-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.id = 106172460; + metafield.value = "110000"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/draft_orders/622762746/metafields/106172460.json', + query: '', + headers, + data: { "metafield": {"value": "110000", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_50', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "An updated translation", "owner_id": 131092082, "namespace": "translation", "key": "title_fr", "id": 290519330, "description": "Page French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:39-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.id = 290519330; + metafield.value = "An updated translation"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/pages/131092082/metafields/290519330.json', + query: '', + headers, + data: { "metafield": {"value": "An updated translation", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_51', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "having fun", "owner_id": 632910392, "namespace": "my_fields", "key": "best_for", "id": 1001077698, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:51:25-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.id = 1001077698; + metafield.value = "having fun"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/products/632910392/metafields/1001077698.json', + query: '', + headers, + data: { "metafield": {"value": "having fun", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_52', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "translated description", "owner_id": 850703190, "namespace": "translation", "key": "title_fr", "id": 625663657, "description": "French product image title", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:31-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.id = 625663657; + metafield.value = "translated description"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/product_images/850703190/metafields/625663657.json', + query: '', + headers, + data: { "metafield": {"value": "translated description", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_53', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "Red", "owner_id": 808950810, "namespace": "my_fields", "key": "color", "id": 323119633, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:53:00-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.id = 323119633; + metafield.value = "Red"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/variants/49148385/metafields/323119633.json', + query: '', + headers, + data: { "metafield": {"value": "Red", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_54', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "something new", "owner_id": 548380009, "namespace": "affiliates", "key": "app_key", "id": 721389482, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:02-05:00", "owner_resource": "shop", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.id = 721389482; + metafield.value = "something new"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/metafields/721389482.json', + query: '', + headers, + data: { "metafield": {"value": "something new", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_55', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated title", "owner_id": 134645308, "namespace": "translation", "key": "title_fr", "id": 838981074, "description": "Article French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:50:36-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.id = 838981074; + metafield.value = "a translated title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/articles/674387490/metafields/838981074.json', + query: '', + headers, + data: { "metafield": {"value": "a translated title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_56', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "Provided a discount code", "owner_id": 450789469, "namespace": "notes", "key": "buyer", "id": 915396079, "description": "This field is for buyer notes", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:49:41-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.id = 915396079; + metafield.value = "Provided a discount code"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-04/orders/450789469/metafields/915396079.json', + query: '', + headers, + data: { "metafield": {"value": "Provided a discount code", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_57', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - product_image_id: 850703190, - id: 625663657, + blog_id: 382285388, + id: 534526895, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/product_images/850703190/metafields/625663657.json', + path: '/admin/api/2022-04/blogs/382285388/metafields/534526895.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_36', async () => { + it('test_58', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - draft_order_id: 622762746, - id: 106172460, + collection_id: 482865238, + id: 1010236510, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/draft_orders/622762746/metafields/106172460.json', + path: '/admin/api/2022-04/collections/482865238/metafields/1010236510.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_37', async () => { + it('test_59', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ @@ -707,120 +1156,121 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_38', async () => { + it('test_60', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - collection_id: 482865238, - id: 1010236510, + draft_order_id: 622762746, + id: 106172460, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/collections/482865238/metafields/1010236510.json', + path: '/admin/api/2022-04/draft_orders/622762746/metafields/106172460.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_39', async () => { + it('test_61', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - blog_id: 382285388, - id: 534526895, + page_id: 131092082, + id: 290519330, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/blogs/382285388/metafields/534526895.json', + path: '/admin/api/2022-04/pages/131092082/metafields/290519330.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_40', async () => { + it('test_62', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - id: 721389482, + product_id: 632910392, + id: 1001077698, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/metafields/721389482.json', + path: '/admin/api/2022-04/products/632910392/metafields/1001077698.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_41', async () => { + it('test_63', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - variant_id: 49148385, - id: 323119633, + product_image_id: 850703190, + id: 625663657, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/variants/49148385/metafields/323119633.json', + path: '/admin/api/2022-04/product_images/850703190/metafields/625663657.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_42', async () => { + it('test_64', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - page_id: 131092082, - id: 290519330, + variant_id: 49148385, + id: 323119633, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/pages/131092082/metafields/290519330.json', + path: '/admin/api/2022-04/variants/49148385/metafields/323119633.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_43', async () => { + it('test_65', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - product_id: 632910392, - id: 1001077698, + article_id: 674387490, + id: 838981074, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/products/632910392/metafields/1001077698.json', + path: '/admin/api/2022-04/articles/674387490/metafields/838981074.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_44', async () => { + it('test_66', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ @@ -839,19 +1289,18 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_45', async () => { + it('test_67', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - article_id: 674387490, - id: 838981074, + id: 721389482, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/articles/674387490/metafields/838981074.json', + path: '/admin/api/2022-04/metafields/721389482.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/mobile_platform_application.test.ts b/rest/admin/__tests__/2022-04/mobile_platform_application.test.ts index 25a42cce7..40e251682 100644 --- a/rest/admin/__tests__/2022-04/mobile_platform_application.test.ts +++ b/rest/admin/__tests__/2022-04/mobile_platform_application.test.ts @@ -31,7 +31,7 @@ describe('MobilePlatformApplication resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_applications": [{"id": 1066176058, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:58-05:00", "updated_at": "2022-11-29T17:07:58-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true}, {"id": 1066176059, "application_id": "com.example", "platform": "android", "created_at": "2022-11-29T17:07:58-05:00", "updated_at": "2022-11-29T17:07:58-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false}]})); + queueMockResponse(JSON.stringify({"mobile_platform_applications": [{"id": 1066175996, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:47-05:00", "updated_at": "2023-01-03T12:42:47-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}, {"id": 1066175997, "application_id": "com.example", "platform": "android", "created_at": "2023-01-03T12:42:47-05:00", "updated_at": "2023-01-03T12:42:47-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}]})); await shopify.rest.MobilePlatformApplication.all({ session: session, @@ -48,7 +48,7 @@ describe('MobilePlatformApplication resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176055, "application_id": "com.example", "platform": "android", "created_at": "2022-11-29T17:07:53-05:00", "updated_at": "2022-11-29T17:07:53-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176002, "application_id": "com.example", "platform": "android", "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:42:58-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); mobile_platform_application.platform = "android"; @@ -70,7 +70,7 @@ describe('MobilePlatformApplication resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176052, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:49-05:00", "updated_at": "2022-11-29T17:07:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176000, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:54-05:00", "updated_at": "2023-01-03T12:42:54-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); mobile_platform_application.platform = "ios"; @@ -90,17 +90,17 @@ describe('MobilePlatformApplication resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176053, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:49-05:00", "updated_at": "2022-11-29T17:07:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066175998, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:49-05:00", "updated_at": "2023-01-03T12:42:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); await shopify.rest.MobilePlatformApplication.find({ session: session, - id: 1066176053, + id: 1066175998, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/mobile_platform_applications/1066176053.json', + path: '/admin/api/2022-04/mobile_platform_applications/1066175998.json', query: '', headers, data: undefined @@ -108,52 +108,56 @@ describe('MobilePlatformApplication resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "id": 1066176057, "created_at": "2022-11-29T17:07:56-05:00", "updated_at": "2022-11-29T17:07:58-05:00"}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "id": 1066175999, "created_at": "2023-01-03T12:42:50-05:00", "updated_at": "2023-01-03T12:42:52-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); - mobile_platform_application.id = 1066176057; + mobile_platform_application.id = 1066175999; mobile_platform_application.application_id = "com.example.news.app"; mobile_platform_application.platform = "android"; - mobile_platform_application.created_at = "2022-11-29T17:07:56-05:00"; - mobile_platform_application.updated_at = "2022-11-29T17:07:56-05:00"; + mobile_platform_application.created_at = "2023-01-03T12:42:50-05:00"; + mobile_platform_application.updated_at = "2023-01-03T12:42:50-05:00"; mobile_platform_application.sha256_cert_fingerprints = [ "14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5" ]; mobile_platform_application.enabled_universal_or_app_links = true; mobile_platform_application.enabled_shared_webcredentials = false; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; await mobile_platform_application.save({}); expect({ method: 'PUT', domain, - path: '/admin/api/2022-04/mobile_platform_applications/1066176057.json', + path: '/admin/api/2022-04/mobile_platform_applications/1066175999.json', query: '', headers, - data: { "mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "created_at": "2022-11-29T17:07:56-05:00", "updated_at": "2022-11-29T17:07:56-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false} } + data: { "mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "created_at": "2023-01-03T12:42:50-05:00", "updated_at": "2023-01-03T12:42:50-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "id": 1066176054, "created_at": "2022-11-29T17:07:50-05:00", "updated_at": "2022-11-29T17:07:52-05:00"}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "id": 1066176003, "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:43:00-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); - mobile_platform_application.id = 1066176054; + mobile_platform_application.id = 1066176003; mobile_platform_application.application_id = "A1B2.ca.domain.app"; mobile_platform_application.platform = "ios"; - mobile_platform_application.created_at = "2022-11-29T17:07:50-05:00"; - mobile_platform_application.updated_at = "2022-11-29T17:07:50-05:00"; + mobile_platform_application.created_at = "2023-01-03T12:42:58-05:00"; + mobile_platform_application.updated_at = "2023-01-03T12:42:58-05:00"; mobile_platform_application.sha256_cert_fingerprints = []; mobile_platform_application.enabled_universal_or_app_links = true; mobile_platform_application.enabled_shared_webcredentials = true; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; await mobile_platform_application.save({}); expect({ method: 'PUT', domain, - path: '/admin/api/2022-04/mobile_platform_applications/1066176054.json', + path: '/admin/api/2022-04/mobile_platform_applications/1066176003.json', query: '', headers, - data: { "mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:50-05:00", "updated_at": "2022-11-29T17:07:50-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true} } + data: { "mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:42:58-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null} } }).toMatchMadeHttpRequest(); }); @@ -162,13 +166,13 @@ describe('MobilePlatformApplication resource', () => { await shopify.rest.MobilePlatformApplication.delete({ session: session, - id: 1066176056, + id: 1066176001, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-04/mobile_platform_applications/1066176056.json', + path: '/admin/api/2022-04/mobile_platform_applications/1066176001.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/order.test.ts b/rest/admin/__tests__/2022-04/order.test.ts index 91f3adaf6..7ef1b1a29 100644 --- a/rest/admin/__tests__/2022-04/order.test.ts +++ b/rest/admin/__tests__/2022-04/order.test.ts @@ -31,7 +31,7 @@ describe('Order resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -49,7 +49,7 @@ describe('Order resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -85,7 +85,7 @@ describe('Order resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -103,7 +103,7 @@ describe('Order resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "authorized", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:49-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "authorized", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:50-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -121,18 +121,18 @@ describe('Order resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 1073459967, "admin_graphql_api_id": "gid://shopify/Order/1073459967", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:13:16-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/81b17d6d6ffa8c0b72f0e55af850e748/authenticate?key=f4f59da955f9c30e59bab8cbe1d0ea6a", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:16-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "81b17d6d6ffa8c0b72f0e55af850e748", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_usd": "199.00", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:16-05:00", "user_id": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823177, "admin_graphql_api_id": "gid://shopify/LineItem/1071823177", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "refunds": [], "shipping_lines": []}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 1073459972, "admin_graphql_api_id": "gid://shopify/Order/1073459972", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:28:16-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/3598b8ae8cac731d0e7996f0d2d09e1d/authenticate?key=966f252275757105ae9b631628c76c1a", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:28:16-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "3598b8ae8cac731d0e7996f0d2d09e1d", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_usd": "199.00", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:16-05:00", "user_id": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823184, "admin_graphql_api_id": "gid://shopify/LineItem/1071823184", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "refunds": [], "shipping_lines": []}]})); await shopify.rest.Order.all({ session: session, - ids: "1073459967", + ids: "1073459972", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/orders.json', - query: 'ids=1073459967', + query: 'ids=1073459972', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -158,7 +158,7 @@ describe('Order resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); await shopify.rest.Order.find({ session: session, @@ -212,7 +212,7 @@ describe('Order resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": "2022-11-28T17:12:48-05:00", "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:48-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": "2023-01-03T12:26:44-05:00", "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:44-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -229,7 +229,7 @@ describe('Order resource', () => { }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:14:32-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:29-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -246,7 +246,7 @@ describe('Order resource', () => { }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -263,7 +263,7 @@ describe('Order resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "bogus", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:14:20-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361463, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "created_at": "2022-11-28T17:14:20-05:00", "note": null, "order_id": 450789469, "processed_at": "2022-11-28T17:14:20-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [], "transactions": [{"id": 1068278479, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278479", "amount": "10.00", "authorization": null, "created_at": "2022-11-28T17:14:20-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278478, "payment_id": "c901414060.3", "processed_at": "2022-11-28T17:14:20-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}], "refund_line_items": [{"id": 1058498308, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498309, "line_item_id": 518995019, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498310, "line_item_id": 703073504, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "bogus", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:21-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361462, "admin_graphql_api_id": "gid://shopify/Refund/929361462", "created_at": "2023-01-03T12:27:21-05:00", "note": null, "order_id": 450789469, "processed_at": "2023-01-03T12:27:21-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [], "transactions": [{"id": 1068278471, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278471", "amount": "10.00", "authorization": null, "created_at": "2023-01-03T12:27:21-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278470, "payment_id": "c901414060.3", "processed_at": "2023-01-03T12:27:21-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}], "refund_line_items": [{"id": 1058498307, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498308, "line_item_id": 518995019, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498309, "line_item_id": 703073504, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -282,12 +282,12 @@ describe('Order resource', () => { }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "gift_card", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus", "gift_card"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:48-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361462, "admin_graphql_api_id": "gid://shopify/Refund/929361462", "created_at": "2022-11-28T17:13:48-05:00", "note": "Customer made a mistake", "order_id": 450789469, "processed_at": "2022-11-28T17:13:48-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [{"id": 1030976842, "amount": "89.64", "amount_set": {"shop_money": {"amount": "89.64", "currency_code": "USD"}, "presentment_money": {"amount": "89.64", "currency_code": "USD"}}, "kind": "refund_discrepancy", "order_id": 450789469, "reason": "Refund discrepancy", "refund_id": 929361462, "tax_amount": "0.00", "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}], "transactions": [{"id": 1068278475, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278475", "amount": "10.00", "authorization": null, "created_at": "2022-11-28T17:13:47-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278473, "payment_id": "c901414060.4", "processed_at": "2022-11-28T17:13:47-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}, {"id": 1068278476, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278476", "amount": "100.00", "authorization": null, "created_at": "2022-11-28T17:13:47-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "gift_card", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 1068278474, "payment_id": "c901414060.5", "processed_at": "2022-11-28T17:13:47-05:00", "receipt": {"gift_card_id": 1035197676, "gift_card_last_characters": "0d0d"}, "source_name": "755357713", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 1058498307, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "gift_card", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus", "gift_card"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:49-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361463, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "created_at": "2023-01-03T12:27:49-05:00", "note": "Customer made a mistake", "order_id": 450789469, "processed_at": "2023-01-03T12:27:49-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [{"id": 1030976842, "amount": "89.64", "amount_set": {"shop_money": {"amount": "89.64", "currency_code": "USD"}, "presentment_money": {"amount": "89.64", "currency_code": "USD"}}, "kind": "refund_discrepancy", "order_id": 450789469, "reason": "Refund discrepancy", "refund_id": 929361463, "tax_amount": "0.00", "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}], "transactions": [{"id": 1068278477, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278477", "amount": "10.00", "authorization": null, "created_at": "2023-01-03T12:27:48-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278475, "payment_id": "c901414060.4", "processed_at": "2023-01-03T12:27:48-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}, {"id": 1068278478, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278478", "amount": "100.00", "authorization": null, "created_at": "2023-01-03T12:27:49-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "gift_card", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 1068278476, "payment_id": "c901414060.5", "processed_at": "2023-01-03T12:27:49-05:00", "receipt": {"gift_card_id": 1035197676, "gift_card_last_characters": "0d0d"}, "source_name": "755357713", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 1058498310, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; await order.cancel({ - body: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278473, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278474, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}}, + body: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278475, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278476, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}}, }); expect({ @@ -296,12 +296,12 @@ describe('Order resource', () => { path: '/admin/api/2022-04/orders/450789469/cancel.json', query: '', headers, - data: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278473, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278474, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}} + data: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278475, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278476, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}} }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459964, "admin_graphql_api_id": "gid://shopify/Order/1073459964", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:12:59-05:00", "currency": "EUR", "current_subtotal_price": "224.97", "current_subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "current_total_duties_set": null, "current_total_price": "238.47", "current_total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "current_total_tax": "13.50", "current_total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/a11600292b5e91907c5846e0cfb3ad6f/authenticate?key=497840c834d9e9f67f790e0b61be5505", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "EUR", "processed_at": "2022-11-28T17:12:59-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "224.97", "subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "tags": "", "tax_lines": [{"price": "13.50", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "a11600292b5e91907c5846e0cfb3ad6f", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_line_items_price": "224.97", "total_line_items_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "total_outstanding": "0.00", "total_price": "238.47", "total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_tax": "13.50", "total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:59-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 3, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1300, "name": "Big Brown Bear Boots", "price": "74.99", "price_set": {"shop_money": {"amount": "74.99", "currency_code": "EUR"}, "presentment_money": {"amount": "74.99", "currency_code": "EUR"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 3, "requires_shipping": true, "sku": null, "taxable": true, "title": "Big Brown Bear Boots", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "13.50", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "rate": 0.06, "title": "State tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459962, "admin_graphql_api_id": "gid://shopify/Order/1073459962", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:26:04-05:00", "currency": "EUR", "current_subtotal_price": "224.97", "current_subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "current_total_duties_set": null, "current_total_price": "238.47", "current_total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "current_total_tax": "13.50", "current_total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/319b6019f95405472f9713cef70a99a8/authenticate?key=e81d0103ae0eb50bf94365dca29df99f", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "EUR", "processed_at": "2023-01-03T12:26:04-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "224.97", "subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "tags": "", "tax_lines": [{"price": "13.50", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "319b6019f95405472f9713cef70a99a8", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_line_items_price": "224.97", "total_line_items_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "total_outstanding": "0.00", "total_price": "238.47", "total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_tax": "13.50", "total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:04-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823172, "admin_graphql_api_id": "gid://shopify/LineItem/1071823172", "fulfillable_quantity": 3, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1300, "name": "Big Brown Bear Boots", "price": "74.99", "price_set": {"shop_money": {"amount": "74.99", "currency_code": "EUR"}, "presentment_money": {"amount": "74.99", "currency_code": "EUR"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 3, "requires_shipping": true, "sku": null, "taxable": true, "title": "Big Brown Bear Boots", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "13.50", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "rate": 0.06, "title": "State tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -341,7 +341,7 @@ describe('Order resource', () => { }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459970, "admin_graphql_api_id": "gid://shopify/Order/1073459970", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2022-11-28T17:13:25-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "partially_paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/d11dd9362564953962cadfdddd0c0935/authenticate?key=efac2a267fb959addd217bdd2b351c7d", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:25-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "d11dd9362564953962cadfdddd0c0935", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "149.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:25-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339457, "email": "paul.norman@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:25-05:00", "updated_at": "2022-11-28T17:13:26-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:25-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339457", "default_address": {"id": 1053317288, "customer_id": 1073339457, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823182, "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459968, "admin_graphql_api_id": "gid://shopify/Order/1073459968", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2023-01-03T12:27:26-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "partially_paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/668a72716da908e6a2e789db29dbedd6/authenticate?key=c0faefec830fe2bad8902a643f111263", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:26-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "668a72716da908e6a2e789db29dbedd6", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "149.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:26-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339475, "email": "paul.norman@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:26-05:00", "updated_at": "2023-01-03T12:27:26-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:26-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339475", "default_address": {"id": 1053317307, "customer_id": 1073339475, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823178, "admin_graphql_api_id": "gid://shopify/LineItem/1071823178", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -397,7 +397,7 @@ describe('Order resource', () => { }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459966, "admin_graphql_api_id": "gid://shopify/Order/1073459966", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2022-11-28T17:13:12-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "pending", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/e4ba4f4434be3f23a5dc574958531a6b/authenticate?key=b6e7804ea89d507bc7e3d112e75a85d3", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:12-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "e4ba4f4434be3f23a5dc574958531a6b", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:12-05:00", "user_id": null, "billing_address": null, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:13:12-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823176, "admin_graphql_api_id": "gid://shopify/LineItem/1071823176", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459965, "admin_graphql_api_id": "gid://shopify/Order/1073459965", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2023-01-03T12:26:32-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "pending", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/c7b936bf26ad5a982dcfa44a5685c79d/authenticate?key=94ef0aea48ebaa2a5c5ca9e24d1e6636", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:26:32-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "c7b936bf26ad5a982dcfa44a5685c79d", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:32-05:00", "user_id": null, "billing_address": null, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:26:33-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823175, "admin_graphql_api_id": "gid://shopify/LineItem/1071823175", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -423,7 +423,7 @@ describe('Order resource', () => { }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459973, "admin_graphql_api_id": "gid://shopify/Order/1073459973", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2022-11-28T17:13:54-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/685d637f0424874611dfd0fb62f495a1/authenticate?key=f08e8c7e76d35afbc5147f84c7067379", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:54-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "685d637f0424874611dfd0fb62f495a1", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:54-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339460, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:54-05:00", "updated_at": "2022-11-28T17:13:54-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:54-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339460"}, "discount_applications": [], "fulfillments": [{"id": 1069019863, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019863", "created_at": "2022-11-28T17:13:55-05:00", "location_id": 24826418, "name": "#1002.1", "order_id": 1073459973, "origin_address": {}, "receipt": {}, "service": "shipwire-app", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2022-11-28T17:13:55-05:00", "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459973, "admin_graphql_api_id": "gid://shopify/Order/1073459973", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:28:24-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/db6850dd9d41e9787662d53205610280/authenticate?key=ef5e08b9b4f5dc44de217e892a73330b", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:28:24-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "db6850dd9d41e9787662d53205610280", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:24-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339477, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:28:24-05:00", "updated_at": "2023-01-03T12:28:24-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:28:24-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339477"}, "discount_applications": [], "fulfillments": [{"id": 1069019863, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019863", "created_at": "2023-01-03T12:28:25-05:00", "location_id": 24826418, "name": "#1002.1", "order_id": 1073459973, "origin_address": {}, "receipt": {}, "service": "shipwire-app", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2023-01-03T12:28:25-05:00", "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.email = "foo@example.com"; @@ -452,7 +452,7 @@ describe('Order resource', () => { }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459969, "admin_graphql_api_id": "gid://shopify/Order/1073459969", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:13:23-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/40b4ff84b38cfb28ae9a30426f47a3ad/authenticate?key=38925de427ae572efde807c6cbd93779", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:23-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "40b4ff84b38cfb28ae9a30426f47a3ad", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:23-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823181, "admin_graphql_api_id": "gid://shopify/LineItem/1071823181", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459969, "admin_graphql_api_id": "gid://shopify/Order/1073459969", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:27:30-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/48b0719e537c3c333216675180fc0662/authenticate?key=e072883103b424ca776545c12110edd4", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:30-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "48b0719e537c3c333216675180fc0662", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:30-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823179, "admin_graphql_api_id": "gid://shopify/LineItem/1071823179", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -474,7 +474,7 @@ describe('Order resource', () => { }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459972, "admin_graphql_api_id": "gid://shopify/Order/1073459972", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2022-11-28T17:13:33-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/8e116c24823eec49a7cc6298924db5ee/authenticate?key=e12e99638b289b07f1416ce16e199c24", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:33-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "8e116c24823eec49a7cc6298924db5ee", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:33-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339459, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:32-05:00", "updated_at": "2022-11-28T17:13:33-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:32-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339459"}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823184, "admin_graphql_api_id": "gid://shopify/LineItem/1071823184", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459967, "admin_graphql_api_id": "gid://shopify/Order/1073459967", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:27:09-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/a322d3b3d1add5bb8671897946a69cbe/authenticate?key=338368464f7b33742721bf04547e1c0b", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:09-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "a322d3b3d1add5bb8671897946a69cbe", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:09-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339474, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:09-05:00", "updated_at": "2023-01-03T12:27:10-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:09-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339474"}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823177, "admin_graphql_api_id": "gid://shopify/LineItem/1071823177", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.email = "foo@example.com"; @@ -498,7 +498,7 @@ describe('Order resource', () => { }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459971, "admin_graphql_api_id": "gid://shopify/Order/1073459971", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2022-11-28T17:13:29-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/e7cefc24914c10ff6c254415f85e6931/authenticate?key=52d7e27a9be1af5a3e5305a06989dca7", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:29-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "e7cefc24914c10ff6c254415f85e6931", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:29-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339458, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:29-05:00", "updated_at": "2022-11-28T17:13:30-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:29-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339458"}, "discount_applications": [], "fulfillments": [{"id": 1069019862, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019862", "created_at": "2022-11-28T17:13:30-05:00", "location_id": 487838322, "name": "#1002.1", "order_id": 1073459971, "origin_address": {}, "receipt": {}, "service": "manual", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2022-11-28T17:13:30-05:00", "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459964, "admin_graphql_api_id": "gid://shopify/Order/1073459964", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:26:15-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/eecea5ec1db2273b6c5a895c8e13ff58/authenticate?key=a22af164f7a9206bb9254a0724447566", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:26:15-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "eecea5ec1db2273b6c5a895c8e13ff58", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:15-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339473, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:26:15-05:00", "updated_at": "2023-01-03T12:26:16-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:26:15-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339473"}, "discount_applications": [], "fulfillments": [{"id": 1069019862, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019862", "created_at": "2023-01-03T12:26:15-05:00", "location_id": 487838322, "name": "#1002.1", "order_id": 1073459964, "origin_address": {}, "receipt": {}, "service": "manual", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2023-01-03T12:26:15-05:00", "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.email = "foo@example.com"; @@ -524,7 +524,7 @@ describe('Order resource', () => { }); it('test_23', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459962, "admin_graphql_api_id": "gid://shopify/Order/1073459962", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2022-11-28T17:12:22-05:00", "currency": "USD", "current_subtotal_price": "181.09", "current_subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_discounts": "17.91", "current_total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "181.09", "current_total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "FAKE30", "amount": "17.91", "type": "percentage"}], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/cafd791ccfe1480135cba4179151c1a0/authenticate?key=a1f1594e66904b77e01ef5754d5a0145", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": "+18885551234", "presentment_currency": "USD", "processed_at": "2022-11-28T17:12:22-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "181.09", "subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "cafd791ccfe1480135cba4179151c1a0", "total_discounts": "17.91", "total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "131.09", "total_price": "181.09", "total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:22-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339456, "email": "jane@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:12:21-05:00", "updated_at": "2022-11-28T17:12:22-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:12:22-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317286, "customer_id": 1073339456, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "manual", "value": "9.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "FAKE30", "description": "FAKE30"}], "fulfillments": [], "line_items": [{"id": 1071823172, "admin_graphql_api_id": "gid://shopify/LineItem/1071823172", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "17.91", "amount_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459971, "admin_graphql_api_id": "gid://shopify/Order/1073459971", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2023-01-03T12:27:42-05:00", "currency": "USD", "current_subtotal_price": "181.09", "current_subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_discounts": "17.91", "current_total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "181.09", "current_total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "FAKE30", "amount": "17.91", "type": "percentage"}], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1b22331bf230d2f5b192b6c2965aff1/authenticate?key=a77ee802fb9a5928d3e50b38497a0710", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": "+18885551234", "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:42-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "181.09", "subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "b1b22331bf230d2f5b192b6c2965aff1", "total_discounts": "17.91", "total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "131.09", "total_price": "181.09", "total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:42-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339476, "email": "jane@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:41-05:00", "updated_at": "2023-01-03T12:27:42-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:41-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339476", "default_address": {"id": 1053317309, "customer_id": 1073339476, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "manual", "value": "9.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "FAKE30", "description": "FAKE30"}], "fulfillments": [], "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "17.91", "amount_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -583,7 +583,7 @@ describe('Order resource', () => { }); it('test_24', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459968, "admin_graphql_api_id": "gid://shopify/Order/1073459968", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:13:20-05:00", "currency": "USD", "current_subtotal_price": "255.92", "current_subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "270.37", "current_total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "current_total_tax": "14.45", "current_total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/85556fb7bf0703395d3e0f7eba8f2675/authenticate?key=36f4e65925a0d2312050634eed0e7650", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:20-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "255.92", "subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "10.20", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "10.20", "currency_code": "USD"}, "presentment_money": {"amount": "10.20", "currency_code": "USD"}}, "channel_liable": null}, {"price": "4.25", "rate": 0.025, "title": "County tax", "price_set": {"shop_money": {"amount": "4.25", "currency_code": "USD"}, "presentment_money": {"amount": "4.25", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "85556fb7bf0703395d3e0f7eba8f2675", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "255.92", "total_line_items_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "total_outstanding": "270.37", "total_price": "270.37", "total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "14.45", "total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:20-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823178, "admin_graphql_api_id": "gid://shopify/LineItem/1071823178", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1700, "name": "Red Leather Coat", "price": "129.99", "price_set": {"shop_money": {"amount": "129.99", "currency_code": "USD"}, "presentment_money": {"amount": "129.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": true, "title": "Red Leather Coat", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "7.81", "price_set": {"shop_money": {"amount": "7.81", "currency_code": "USD"}, "presentment_money": {"amount": "7.81", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "3.26", "price_set": {"shop_money": {"amount": "3.26", "currency_code": "USD"}, "presentment_money": {"amount": "3.26", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}, {"id": 1071823179, "admin_graphql_api_id": "gid://shopify/LineItem/1071823179", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 750, "name": "Blue Suede Shoes", "price": "85.95", "price_set": {"shop_money": {"amount": "85.95", "currency_code": "USD"}, "presentment_money": {"amount": "85.95", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": false, "title": "Blue Suede Shoes", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [], "duties": [], "discount_allocations": []}, {"id": 1071823180, "admin_graphql_api_id": "gid://shopify/LineItem/1071823180", "fulfillable_quantity": 2, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 320, "name": "Raspberry Beret", "price": "19.99", "price_set": {"shop_money": {"amount": "19.99", "currency_code": "USD"}, "presentment_money": {"amount": "19.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 2, "requires_shipping": true, "sku": null, "taxable": true, "title": "Raspberry Beret", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "2.39", "price_set": {"shop_money": {"amount": "2.39", "currency_code": "USD"}, "presentment_money": {"amount": "2.39", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "0.99", "price_set": {"shop_money": {"amount": "0.99", "currency_code": "USD"}, "presentment_money": {"amount": "0.99", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459970, "admin_graphql_api_id": "gid://shopify/Order/1073459970", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:27:34-05:00", "currency": "USD", "current_subtotal_price": "255.92", "current_subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "270.37", "current_total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "current_total_tax": "14.45", "current_total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/c92054d234b69c849746dd1dd0d1e3c5/authenticate?key=28bd5e97da3a1ed1e62ef43b0349ab20", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:34-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "255.92", "subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "10.20", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "10.20", "currency_code": "USD"}, "presentment_money": {"amount": "10.20", "currency_code": "USD"}}, "channel_liable": null}, {"price": "4.25", "rate": 0.025, "title": "County tax", "price_set": {"shop_money": {"amount": "4.25", "currency_code": "USD"}, "presentment_money": {"amount": "4.25", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "c92054d234b69c849746dd1dd0d1e3c5", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "255.92", "total_line_items_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "total_outstanding": "270.37", "total_price": "270.37", "total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "14.45", "total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:34-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823180, "admin_graphql_api_id": "gid://shopify/LineItem/1071823180", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1700, "name": "Red Leather Coat", "price": "129.99", "price_set": {"shop_money": {"amount": "129.99", "currency_code": "USD"}, "presentment_money": {"amount": "129.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": true, "title": "Red Leather Coat", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "7.81", "price_set": {"shop_money": {"amount": "7.81", "currency_code": "USD"}, "presentment_money": {"amount": "7.81", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "3.26", "price_set": {"shop_money": {"amount": "3.26", "currency_code": "USD"}, "presentment_money": {"amount": "3.26", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}, {"id": 1071823181, "admin_graphql_api_id": "gid://shopify/LineItem/1071823181", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 750, "name": "Blue Suede Shoes", "price": "85.95", "price_set": {"shop_money": {"amount": "85.95", "currency_code": "USD"}, "presentment_money": {"amount": "85.95", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": false, "title": "Blue Suede Shoes", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [], "duties": [], "discount_allocations": []}, {"id": 1071823182, "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "fulfillable_quantity": 2, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 320, "name": "Raspberry Beret", "price": "19.99", "price_set": {"shop_money": {"amount": "19.99", "currency_code": "USD"}, "presentment_money": {"amount": "19.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 2, "requires_shipping": true, "sku": null, "taxable": true, "title": "Raspberry Beret", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "2.39", "price_set": {"shop_money": {"amount": "2.39", "currency_code": "USD"}, "presentment_money": {"amount": "2.39", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "0.99", "price_set": {"shop_money": {"amount": "0.99", "currency_code": "USD"}, "presentment_money": {"amount": "0.99", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -633,7 +633,7 @@ describe('Order resource', () => { }); it('test_25', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:14:23-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:22-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -658,7 +658,7 @@ describe('Order resource', () => { }); it('test_26', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": "Customer contacted us about a custom engraving on this iPod", "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:41-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": "Customer contacted us about a custom engraving on this iPod", "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:57-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -676,7 +676,7 @@ describe('Order resource', () => { }); it('test_27', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "colour", "value": "red"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:57-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "colour", "value": "red"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:22-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -699,7 +699,7 @@ describe('Order resource', () => { }); it('test_28', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "a-different@email.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "a-different@email.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:43-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "a-different@email.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "a-different@email.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:53-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -717,7 +717,7 @@ describe('Order resource', () => { }); it('test_29', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+15145556677", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:52-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+15145556677", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:07-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -735,7 +735,7 @@ describe('Order resource', () => { }); it('test_30', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": true, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:39-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": true, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:36-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -753,7 +753,7 @@ describe('Order resource', () => { }); it('test_31', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:36-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:27-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -771,7 +771,7 @@ describe('Order resource', () => { }); it('test_32', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "External, Inbound, Outbound", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:18-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "External, Inbound, Outbound", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:09-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -789,7 +789,7 @@ describe('Order resource', () => { }); it('test_33', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:58-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "123 Ship Street", "phone": "+1(502)-459-2181", "city": "Shipsville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:07-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "123 Ship Street", "phone": "+1(502)-459-2181", "city": "Shipsville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; diff --git a/rest/admin/__tests__/2022-04/page.test.ts b/rest/admin/__tests__/2022-04/page.test.ts index 66b9ce378..386c2e5c0 100644 --- a/rest/admin/__tests__/2022-04/page.test.ts +++ b/rest/admin/__tests__/2022-04/page.test.ts @@ -31,116 +31,140 @@ describe('Page resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"pages": [{"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}]})); + queueMockResponse(JSON.stringify({"pages": [{"id": 108828309, "title": "Sample Page", "shop_id": 548380009, "handle": "sample", "body_html": "

this is a sample page.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}, {"id": 322471, "title": "Support", "shop_id": 548380009, "handle": "support", "body_html": "

Come in store for support.

", "author": "Dennis", "created_at": "2009-07-15T20:00:00-04:00", "updated_at": "2009-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"}, {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}]})); await shopify.rest.Page.all({ session: session, - since_id: "108828309", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/pages.json', - query: 'since_id=108828309', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"pages": [{"id": 108828309, "title": "Sample Page", "shop_id": 548380009, "handle": "sample", "body_html": "

this is a sample page.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}, {"id": 322471, "title": "Support", "shop_id": 548380009, "handle": "support", "body_html": "

Come in store for support.

", "author": "Dennis", "created_at": "2009-07-15T20:00:00-04:00", "updated_at": "2009-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"}, {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}]})); + queueMockResponse(JSON.stringify({"pages": [{"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}]})); await shopify.rest.Page.all({ session: session, + since_id: "108828309", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/pages.json', - query: '', + query: 'since_id=108828309', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"count": 4})); + queueMockResponse(JSON.stringify({"page": {"id": 1025371373, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:23:38-05:00", "updated_at": "2023-01-03T12:23:38-05:00", "published_at": "2023-01-03T12:23:38-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371373"}})); - await shopify.rest.Page.count({ - session: session, - }); + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + await page.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/pages/count.json', + path: '/admin/api/2022-04/pages.json', query: '', headers, - data: undefined + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"page": {"id": 1025371369, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:22:57-05:00", "updated_at": "2023-01-03T12:22:57-05:00", "published_at": "2023-01-03T12:22:57-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371369"}})); - await shopify.rest.Page.find({ - session: session, - id: 131092082, - }); + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.metafields = [ + { + "key": "new", + "value": "new value", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await page.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/pages/131092082.json', + path: '/admin/api/2022-04/pages.json', query: '', headers, - data: undefined + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "author": "Christopher Gorski", "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "handle": "new-warranty", "title": "New warranty", "id": 131092082, "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"page": {"id": 1025371374, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:23:49-05:00", "updated_at": "2023-01-03T12:23:49-05:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371374"}})); const page = new shopify.rest.Page({session: session}); - page.id = 131092082; - page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; - page.author = "Christopher Gorski"; - page.title = "New warranty"; - page.handle = "new-warranty"; + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.published = false; await page.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/pages/131092082.json', + path: '/admin/api/2022-04/pages.json', query: '', headers, - data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "author": "Christopher Gorski", "title": "New warranty", "handle": "new-warranty"} } + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "published": false} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "title": "Terms of Services", "handle": "tos", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:05-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"count": 4})); - const page = new shopify.rest.Page({session: session}); - page.id = 131092082; - page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; - await page.save({}); + await shopify.rest.Page.count({ + session: session, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-04/pages/131092082.json', + path: '/admin/api/2022-04/pages/count.json', query: '', headers, - data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:06-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"page": {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + + await shopify.rest.Page.find({ + session: session, + id: 131092082, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2022-04/pages/131092082.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:26-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); page.id = 131092082; @@ -164,8 +188,8 @@ describe('Page resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": null, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:11-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + it('test_9', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": null, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:07-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); page.id = 131092082; @@ -182,8 +206,8 @@ describe('Page resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_9', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": "2022-10-03T12:54:12-04:00", "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:12-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + it('test_10', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": "2023-01-03T12:23:46-05:00", "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:46-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); page.id = 131092082; @@ -200,84 +224,60 @@ describe('Page resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_10', async () => { - queueMockResponse(JSON.stringify({})); - - await shopify.rest.Page.delete({ - session: session, - id: 131092082, - }); - - expect({ - method: 'DELETE', - domain, - path: '/admin/api/2022-04/pages/131092082.json', - query: '', - headers, - data: undefined - }).toMatchMadeHttpRequest(); - }); - it('test_11', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 1025371368, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2022-10-03T12:53:50-04:00", "updated_at": "2022-10-03T12:53:50-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371368"}})); + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "author": "Christopher Gorski", "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "handle": "new-warranty", "title": "New warranty", "id": 131092082, "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:28-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); - page.title = "Warranty information"; - page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; - page.published = false; + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; + page.author = "Christopher Gorski"; + page.title = "New warranty"; + page.handle = "new-warranty"; await page.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/pages.json', + path: '/admin/api/2022-04/pages/131092082.json', query: '', headers, - data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "published": false} } + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "author": "Christopher Gorski", "title": "New warranty", "handle": "new-warranty"} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 1025371371, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2022-10-03T12:54:10-04:00", "updated_at": "2022-10-03T12:54:10-04:00", "published_at": "2022-10-03T12:54:10-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371371"}})); + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "title": "Terms of Services", "handle": "tos", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:08-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); - page.title = "Warranty information"; - page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; - page.metafields = [ - { - "key": "new", - "value": "new value", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; await page.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/pages.json', + path: '/admin/api/2022-04/pages/131092082.json', query: '', headers, - data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

"} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 1025371374, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2022-10-03T12:54:22-04:00", "updated_at": "2022-10-03T12:54:22-04:00", "published_at": "2022-10-03T12:54:22-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371374"}})); + queueMockResponse(JSON.stringify({})); - const page = new shopify.rest.Page({session: session}); - page.title = "Warranty information"; - page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; - await page.save({}); + await shopify.rest.Page.delete({ + session: session, + id: 131092082, + }); expect({ - method: 'POST', + method: 'DELETE', domain, - path: '/admin/api/2022-04/pages.json', + path: '/admin/api/2022-04/pages/131092082.json', query: '', headers, - data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"} } + data: undefined }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/payment.test.ts b/rest/admin/__tests__/2022-04/payment.test.ts index 2b3cab98d..1d5d5fc82 100644 --- a/rest/admin/__tests__/2022-04/payment.test.ts +++ b/rest/admin/__tests__/2022-04/payment.test.ts @@ -31,7 +31,7 @@ describe('Payment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"payment": {"id": 1071573807, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2023, "customer_id": 207119551}, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}, {"id": 1071573807, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2023, "customer_id": 207119551}}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2022-10-03T12:52:28-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2023, "customer_id": 207119551}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + queueMockResponse(JSON.stringify({"payment": {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}, {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:42:43-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); const payment = new shopify.rest.Payment({session: session}); payment.checkout_id = "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x"; @@ -41,7 +41,7 @@ describe('Payment resource', () => { "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" }; payment.amount = "398.00"; - payment.session_id = "global-98c9624a14e5f4b0"; + payment.session_id = "global-d127b9b88aa1043d"; payment.unique_token = "client-side-idempotency-token"; await payment.save({}); @@ -51,12 +51,12 @@ describe('Payment resource', () => { path: '/admin/api/2022-04/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments.json', query: '', headers, - data: { "payment": {"request_details": {"ip_address": "123.1.1.1", "accept_language": "en-US,en;q=0.8,fr;q=0.6", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, "amount": "398.00", "session_id": "global-98c9624a14e5f4b0", "unique_token": "client-side-idempotency-token"} } + data: { "payment": {"request_details": {"ip_address": "123.1.1.1", "accept_language": "en-US,en;q=0.8,fr;q=0.6", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, "amount": "398.00", "session_id": "global-d127b9b88aa1043d", "unique_token": "client-side-idempotency-token"} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}]})); + queueMockResponse(JSON.stringify({"payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}]})); await shopify.rest.Payment.all({ session: session, @@ -74,7 +74,7 @@ describe('Payment resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:24-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278472, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:24-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278472, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:23-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278482, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:23-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278482, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); await shopify.rest.Payment.find({ session: session, @@ -93,7 +93,7 @@ describe('Payment resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:41-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278473, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:41-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278473, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:30-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278483, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:30-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278483, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); await shopify.rest.Payment.find({ session: session, diff --git a/rest/admin/__tests__/2022-04/payment_gateway.test.ts b/rest/admin/__tests__/2022-04/payment_gateway.test.ts index a60ad66d9..09dc3a46f 100644 --- a/rest/admin/__tests__/2022-04/payment_gateway.test.ts +++ b/rest/admin/__tests__/2022-04/payment_gateway.test.ts @@ -31,42 +31,60 @@ describe('PaymentGateway resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2022-10-03T12:24:45-04:00", "credential4": null, "attachment": null}]})); + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:58-05:00", "credential4": null, "attachment": null}, {"disabled": true, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": false, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}]})); await shopify.rest.PaymentGateway.all({ session: session, - disabled: "false", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/payment_gateways.json', - query: 'disabled=false', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2022-10-03T12:24:52-04:00", "credential4": null, "attachment": null}, {"disabled": true, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": false, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}]})); + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:52-05:00", "credential4": null, "attachment": null}]})); await shopify.rest.PaymentGateway.all({ session: session, + disabled: "false", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/payment_gateways.json', - query: '', + query: 'disabled=false', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"payment": {"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2022-10-03T12:24:50-04:00", "credential4": null, "attachment": null}})); + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 1048196722, "name": "authorize_net", "provider_id": 7, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club", "jcb"], "processing_method": "direct", "service_name": "Authorize.net", "metadata": {}, "created_at": "2023-01-03T12:21:57-05:00", "updated_at": "2023-01-03T12:21:57-05:00", "credential1": "someone@example.com", "credential3": null, "credential4": null, "attachment": null}})); + + const payment_gateway = new shopify.rest.PaymentGateway({session: session}); + payment_gateway.credential1 = "someone@example.com"; + payment_gateway.provider_id = 7; + await payment_gateway.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/payment_gateways.json', + query: '', + headers, + data: { "payment_gateway": {"credential1": "someone@example.com", "provider_id": 7} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"payment": {"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:54-05:00", "credential4": null, "attachment": null}})); await shopify.rest.PaymentGateway.find({ session: session, @@ -83,8 +101,8 @@ describe('PaymentGateway resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_4', async () => { - queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": true, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:24:52-04:00"}})); + it('test_5', async () => { + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": true, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:22:03-05:00"}})); const payment_gateway = new shopify.rest.PaymentGateway({session: session}); payment_gateway.id = 170508070; @@ -101,7 +119,7 @@ describe('PaymentGateway resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { + it('test_6', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.PaymentGateway.delete({ @@ -119,22 +137,4 @@ describe('PaymentGateway resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 1048196722, "name": "authorize_net", "provider_id": 7, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club", "jcb"], "processing_method": "direct", "service_name": "Authorize.net", "metadata": {}, "created_at": "2022-10-03T12:24:47-04:00", "updated_at": "2022-10-03T12:24:47-04:00", "credential1": "someone@example.com", "credential3": null, "credential4": null, "attachment": null}})); - - const payment_gateway = new shopify.rest.PaymentGateway({session: session}); - payment_gateway.credential1 = "someone@example.com"; - payment_gateway.provider_id = 7; - await payment_gateway.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-04/payment_gateways.json', - query: '', - headers, - data: { "payment_gateway": {"credential1": "someone@example.com", "provider_id": 7} } - }).toMatchMadeHttpRequest(); - }); - }); diff --git a/rest/admin/__tests__/2022-04/policy.test.ts b/rest/admin/__tests__/2022-04/policy.test.ts index f55f2e1a5..508fa262f 100644 --- a/rest/admin/__tests__/2022-04/policy.test.ts +++ b/rest/admin/__tests__/2022-04/policy.test.ts @@ -31,7 +31,7 @@ describe('Policy resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"policies": [{"body": "You have 30 days to get a refund", "created_at": "2022-10-03T12:52:45-04:00", "updated_at": "2022-10-03T12:52:45-04:00", "handle": "refund-policy", "title": "Refund policy", "url": "https://jsmith.myshopify.com/548380009/policies/878590288"}]})); + queueMockResponse(JSON.stringify({"policies": [{"body": "You have 30 days to get a refund", "created_at": "2023-01-03T12:39:49-05:00", "updated_at": "2023-01-03T12:39:49-05:00", "handle": "refund-policy", "title": "Refund policy", "url": "https://jsmith.myshopify.com/548380009/policies/878590288"}]})); await shopify.rest.Policy.all({ session: session, diff --git a/rest/admin/__tests__/2022-04/price_rule.test.ts b/rest/admin/__tests__/2022-04/price_rule.test.ts index 62db4f409..f3396a02b 100644 --- a/rest/admin/__tests__/2022-04/price_rule.test.ts +++ b/rest/admin/__tests__/2022-04/price_rule.test.ts @@ -31,7 +31,7 @@ describe('PriceRule resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341478, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "allocation_limit": 3, "once_per_customer": false, "usage_limit": null, "starts_at": "2018-03-21T20:00:00-04:00", "ends_at": null, "created_at": "2022-10-03T12:24:17-04:00", "updated_at": "2022-10-03T12:24:17-04:00", "entitled_product_ids": [921728736], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [841564295], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "Buy2iPodsGetiPodTouchForFree", "admin_graphql_api_id": "gid://shopify/PriceRule/996341478"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341481, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "allocation_limit": 3, "once_per_customer": false, "usage_limit": null, "starts_at": "2018-03-21T20:00:00-04:00", "ends_at": null, "created_at": "2023-01-03T12:06:59-05:00", "updated_at": "2023-01-03T12:06:59-05:00", "entitled_product_ids": [921728736], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [841564295], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "Buy2iPodsGetiPodTouchForFree", "admin_graphql_api_id": "gid://shopify/PriceRule/996341481"}})); const price_rule = new shopify.rest.PriceRule({session: session}); price_rule.title = "Buy2iPodsGetiPodTouchForFree"; @@ -66,20 +66,16 @@ describe('PriceRule resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341479, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "allocation_limit": null, "once_per_customer": false, "usage_limit": 20, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2022-10-03T12:24:18-04:00", "updated_at": "2022-10-03T12:24:18-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "FREESHIPPING", "admin_graphql_api_id": "gid://shopify/PriceRule/996341479"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341478, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:46-05:00", "updated_at": "2023-01-03T12:06:46-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/996341478"}})); const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.title = "FREESHIPPING"; - price_rule.target_type = "shipping_line"; + price_rule.title = "SUMMERSALE10OFF"; + price_rule.target_type = "line_item"; price_rule.target_selection = "all"; - price_rule.allocation_method = "each"; - price_rule.value_type = "percentage"; - price_rule.value = "-100.0"; - price_rule.usage_limit = 20; + price_rule.allocation_method = "across"; + price_rule.value_type = "fixed_amount"; + price_rule.value = "-10.0"; price_rule.customer_selection = "all"; - price_rule.prerequisite_subtotal_range = { - "greater_than_or_equal_to": "50.0" - }; price_rule.starts_at = "2017-01-19T17:59:10Z"; await price_rule.save({}); @@ -89,21 +85,24 @@ describe('PriceRule resource', () => { path: '/admin/api/2022-04/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "FREESHIPPING", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "value_type": "percentage", "value": "-100.0", "usage_limit": 20, "customer_selection": "all", "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "starts_at": "2017-01-19T17:59:10Z"} } + data: { "price_rule": {"title": "SUMMERSALE10OFF", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "starts_at": "2017-01-19T17:59:10Z"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341480, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2022-10-03T12:24:22-04:00", "updated_at": "2022-10-03T12:24:22-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/996341480"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341480, "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:56-05:00", "updated_at": "2023-01-03T12:06:56-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [841564295], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "15OFFCOLLECTION", "admin_graphql_api_id": "gid://shopify/PriceRule/996341480"}})); const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.title = "SUMMERSALE10OFF"; + price_rule.title = "15OFFCOLLECTION"; price_rule.target_type = "line_item"; - price_rule.target_selection = "all"; + price_rule.target_selection = "entitled"; price_rule.allocation_method = "across"; - price_rule.value_type = "fixed_amount"; - price_rule.value = "-10.0"; + price_rule.value_type = "percentage"; + price_rule.value = "-15.0"; price_rule.customer_selection = "all"; + price_rule.entitled_collection_ids = [ + 841564295 + ]; price_rule.starts_at = "2017-01-19T17:59:10Z"; await price_rule.save({}); @@ -113,24 +112,25 @@ describe('PriceRule resource', () => { path: '/admin/api/2022-04/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "SUMMERSALE10OFF", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "starts_at": "2017-01-19T17:59:10Z"} } + data: { "price_rule": {"title": "15OFFCOLLECTION", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "entitled_collection_ids": [841564295], "starts_at": "2017-01-19T17:59:10Z"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341481, "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2022-10-03T12:24:29-04:00", "updated_at": "2022-10-03T12:24:29-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [841564295], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "15OFFCOLLECTION", "admin_graphql_api_id": "gid://shopify/PriceRule/996341481"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341479, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "allocation_limit": null, "once_per_customer": false, "usage_limit": 20, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:52-05:00", "updated_at": "2023-01-03T12:06:52-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "FREESHIPPING", "admin_graphql_api_id": "gid://shopify/PriceRule/996341479"}})); const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.title = "15OFFCOLLECTION"; - price_rule.target_type = "line_item"; - price_rule.target_selection = "entitled"; - price_rule.allocation_method = "across"; + price_rule.title = "FREESHIPPING"; + price_rule.target_type = "shipping_line"; + price_rule.target_selection = "all"; + price_rule.allocation_method = "each"; price_rule.value_type = "percentage"; - price_rule.value = "-15.0"; + price_rule.value = "-100.0"; + price_rule.usage_limit = 20; price_rule.customer_selection = "all"; - price_rule.entitled_collection_ids = [ - 841564295 - ]; + price_rule.prerequisite_subtotal_range = { + "greater_than_or_equal_to": "50.0" + }; price_rule.starts_at = "2017-01-19T17:59:10Z"; await price_rule.save({}); @@ -140,93 +140,93 @@ describe('PriceRule resource', () => { path: '/admin/api/2022-04/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "15OFFCOLLECTION", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "entitled_collection_ids": [841564295], "starts_at": "2017-01-19T17:59:10Z"} } + data: { "price_rule": {"title": "FREESHIPPING", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "value_type": "percentage", "value": "-100.0", "usage_limit": 20, "customer_selection": "all", "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "starts_at": "2017-01-19T17:59:10Z"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:24:20-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "WINTER SALE", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}, {"id": 106886544, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2023-01-01T12:05:09-05:00", "ends_at": "2023-01-05T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "TENOFF", "admin_graphql_api_id": "gid://shopify/PriceRule/106886544"}]})); - const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.id = 507328175; - price_rule.title = "WINTER SALE"; - await price_rule.save({}); + await shopify.rest.PriceRule.all({ + session: session, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-04/price_rules/507328175.json', + path: '/admin/api/2022-04/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "WINTER SALE"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}]})); - await shopify.rest.PriceRule.find({ + await shopify.rest.PriceRule.all({ session: session, - id: 507328175, + since_id: "106886545", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/price_rules/507328175.json', - query: '', + path: '/admin/api/2022-04/price_rules.json', + query: 'since_id=106886545', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:55-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "WINTER SALE", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); - await shopify.rest.PriceRule.delete({ - session: session, - id: 507328175, - }); + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.id = 507328175; + price_rule.title = "WINTER SALE"; + await price_rule.save({}); expect({ - method: 'DELETE', + method: 'PUT', domain, path: '/admin/api/2022-04/price_rules/507328175.json', query: '', headers, - data: undefined + data: { "price_rule": {"title": "WINTER SALE"} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}]})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); - await shopify.rest.PriceRule.all({ + await shopify.rest.PriceRule.find({ session: session, - since_id: "106886545", + id: 507328175, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/price_rules.json', - query: 'since_id=106886545', + path: '/admin/api/2022-04/price_rules/507328175.json', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}, {"id": 106886544, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-10-01T12:15:55-04:00", "ends_at": "2022-10-05T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "TENOFF", "admin_graphql_api_id": "gid://shopify/PriceRule/106886544"}]})); + queueMockResponse(JSON.stringify({})); - await shopify.rest.PriceRule.all({ + await shopify.rest.PriceRule.delete({ session: session, + id: 507328175, }); expect({ - method: 'GET', + method: 'DELETE', domain, - path: '/admin/api/2022-04/price_rules.json', + path: '/admin/api/2022-04/price_rules/507328175.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/product.test.ts b/rest/admin/__tests__/2022-04/product.test.ts index d3522fa4a..35149fd7e 100644 --- a/rest/admin/__tests__/2022-04/product.test.ts +++ b/rest/admin/__tests__/2022-04/product.test.ts @@ -31,60 +31,60 @@ describe('Product resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, + ids: "632910392,921728736", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products.json', - query: '', + query: 'ids=632910392%2C921728736', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, - ids: "632910392,921728736", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products.json', - query: 'ids=632910392%2C921728736', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}, {"id": 921728736, "title": "IPod Touch 8GB", "images": []}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, - fields: "id,images,title", + since_id: "632910392", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products.json', - query: 'fields=id%2Cimages%2Ctitle', + query: 'since_id=632910392', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); await shopify.rest.Product.all({ session: session, @@ -102,364 +102,344 @@ describe('Product resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, - since_id: "632910392", + presentment_currencies: "USD", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products.json', - query: 'since_id=632910392', + query: 'presentment_currencies=USD', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}, {"id": 921728736, "title": "IPod Touch 8GB", "images": []}]})); await shopify.rest.Product.all({ session: session, - presentment_currencies: "USD", + fields: "id,images,title", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products.json', - query: 'presentment_currencies=USD', + query: 'fields=id%2Cimages%2Ctitle', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559591, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:24-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:24-04:00", "published_at": "2022-09-28T16:39:24-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, Big Air, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/1071559591", "variants": [{"id": 1070325046, "product_id": 1071559591, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:24-04:00", "updated_at": "2022-09-28T16:39:24-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325046, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325046"}], "options": [{"id": 1055547204, "product_id": 1071559591, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"count": 2})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.tags = [ - "Barnes & Noble", - "Big Air", - "John's Fav" - ]; - await product.save({}); + await shopify.rest.Product.count({ + session: session, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/products.json', + path: '/admin/api/2022-04/products/count.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "tags": ["Barnes & Noble", "Big Air", "John's Fav"]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559592, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:26-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:26-04:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559592", "variants": [{"id": 1070325047, "product_id": 1071559592, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:26-04:00", "updated_at": "2022-09-28T16:39:26-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325047, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325047"}], "options": [{"id": 1055547205, "product_id": 1071559592, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"count": 1})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.published = false; - await product.save({}); + await shopify.rest.Product.count({ + session: session, + collection_id: "841564295", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/products.json', - query: '', + path: '/admin/api/2022-04/products/count.json', + query: 'collection_id=841564295', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559593, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:28-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:28-04:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559593", "variants": [{"id": 1070325048, "product_id": 1071559593, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:28-04:00", "updated_at": "2022-09-28T16:39:28-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325048, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325048"}], "options": [{"id": 1055547206, "product_id": 1071559593, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.status = "draft"; - await product.save({}); + await shopify.rest.Product.find({ + session: session, + id: 632910392, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/products.json', + path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "status": "draft"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559594, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:29-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:30-04:00", "published_at": "2022-09-28T16:39:29-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559594", "variants": [{"id": 1070325049, "product_id": 1071559594, "title": "First", "price": "10.00", "sku": "123", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "First", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:30-04:00", "updated_at": "2022-09-28T16:39:30-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325049, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "10.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325049"}, {"id": 1070325050, "product_id": 1071559594, "title": "Second", "price": "20.00", "sku": "123", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Second", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:30-04:00", "updated_at": "2022-09-28T16:39:30-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325050, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "20.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325050"}], "options": [{"id": 1055547207, "product_id": 1071559594, "name": "Title", "position": 1, "values": ["First", "Second"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.variants = [ - { - "option1": "First", - "price": "10.00", - "sku": "123" - }, - { - "option1": "Second", - "price": "20.00", - "sku": "123" - } - ]; - await product.save({}); + await shopify.rest.Product.find({ + session: session, + id: 632910392, + fields: "id,images,title", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/products.json', - query: '', + path: '/admin/api/2022-04/products/632910392.json', + query: 'fields=id%2Cimages%2Ctitle', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "First", "price": "10.00", "sku": "123"}, {"option1": "Second", "price": "20.00", "sku": "123"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559595, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:32-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:32-04:00", "published_at": "2022-09-28T16:39:32-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559595", "variants": [{"id": 1070325051, "product_id": 1071559595, "title": "Blue / 155", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Blue", "option2": "155", "option3": null, "created_at": "2022-09-28T16:39:32-04:00", "updated_at": "2022-09-28T16:39:32-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325051, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325051"}, {"id": 1070325052, "product_id": 1071559595, "title": "Black / 159", "price": "0.00", "sku": "", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Black", "option2": "159", "option3": null, "created_at": "2022-09-28T16:39:32-04:00", "updated_at": "2022-09-28T16:39:32-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325052, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325052"}], "options": [{"id": 1055547208, "product_id": 1071559595, "name": "Color", "position": 1, "values": ["Blue", "Black"]}, {"id": 1055547209, "product_id": 1071559595, "name": "Size", "position": 2, "values": ["155", "159"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:19-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.variants = [ - { - "option1": "Blue", - "option2": "155" - }, - { - "option1": "Black", - "option2": "159" - } - ]; - product.options = [ - { - "name": "Color", - "values": [ - "Blue", - "Black" - ] - }, + product.id = 632910392; + product.metafields = [ { - "name": "Size", - "values": [ - "155", - "159" - ] + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" } ]; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products.json', + path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "Blue", "option2": "155"}, {"option1": "Black", "option2": "159"}], "options": [{"name": "Color", "values": ["Blue", "Black"]}, {"name": "Size", "values": ["155", "159"]}]} } + data: { "product": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559596, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:34-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:34-04:00", "published_at": "2022-09-28T16:39:34-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559596", "variants": [{"id": 1070325053, "product_id": 1071559596, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:34-04:00", "updated_at": "2022-09-28T16:39:34-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325053, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325053"}], "options": [{"id": 1055547210, "product_id": 1071559596, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473898, "product_id": 1071559596, "position": 1, "created_at": "2022-09-28T16:39:34-04:00", "updated_at": "2022-09-28T16:39:34-04:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664397574", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473898"}], "image": {"id": 1001473898, "product_id": 1071559596, "position": 1, "created_at": "2022-09-28T16:39:34-04:00", "updated_at": "2022-09-28T16:39:34-04:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664397574", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473898"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:07-05:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.images = [ - { - "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" - } - ]; + product.id = 632910392; + product.published = false; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products.json', + path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}]} } + data: { "product": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559597, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:36-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:37-04:00", "published_at": "2022-09-28T16:39:36-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559597", "variants": [{"id": 1070325054, "product_id": 1071559597, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:36-04:00", "updated_at": "2022-09-28T16:39:36-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325054, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325054"}], "options": [{"id": 1055547211, "product_id": 1071559597, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473899, "product_id": 1071559597, "position": 1, "created_at": "2022-09-28T16:39:36-04:00", "updated_at": "2022-09-28T16:39:36-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20220928-1971383-vfpdob.gif?v=1664397576", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473899"}], "image": {"id": 1001473899, "product_id": 1071559597, "position": 1, "created_at": "2022-09-28T16:39:36-04:00", "updated_at": "2022-09-28T16:39:36-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20220928-1971383-vfpdob.gif?v=1664397576", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473899"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:25-05:00", "published_at": "2023-01-03T12:59:24-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.images = [ - { - "src": "http://example.com/rails_logo.gif" - } - ]; + product.id = 632910392; + product.published = true; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products.json', + path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"src": "http://example.com/rails_logo.gif"}]} } + data: { "product": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559598, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:40-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:40-04:00", "published_at": "2022-09-28T16:39:40-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559598", "variants": [{"id": 1070325055, "product_id": 1071559598, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:40-04:00", "updated_at": "2022-09-28T16:39:40-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325055, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325055"}], "options": [{"id": 1055547212, "product_id": 1071559598, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "Updated Product Title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:21-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "2000.00", "sku": "Updating the Product SKU", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:00:20-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.metafields_global_title_tag = "Product SEO Title"; - product.metafields_global_description_tag = "Product SEO Description"; + product.id = 632910392; + product.title = "Updated Product Title"; + product.variants = [ + { + "id": 808950810, + "price": "2000.00", + "sku": "Updating the Product SKU" + }, + { + "id": 49148385 + }, + { + "id": 39072856 + }, + { + "id": 457924702 + } + ]; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products.json', + path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields_global_title_tag": "Product SEO Title", "metafields_global_description_tag": "Product SEO Description"} } + data: { "product": {"title": "Updated Product Title", "variants": [{"id": 808950810, "price": "2000.00", "sku": "Updating the Product SKU"}, {"id": 49148385}, {"id": 39072856}, {"id": 457924702}]} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559599, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:42-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:42-04:00", "published_at": "2022-09-28T16:39:42-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559599", "variants": [{"id": 1070325056, "product_id": 1071559599, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:42-04:00", "updated_at": "2022-09-28T16:39:42-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325056, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325056"}], "options": [{"id": 1055547213, "product_id": 1071559599, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:02:22-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 1001473910, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T13:02:22-05:00", "updated_at": "2023-01-03T13:02:22-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-3uie15.gif?v=1672768942", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473910"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.metafields = [ + product.id = 632910392; + product.images = [ { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" + "id": 850703190 + }, + { + "id": 562641783 + }, + { + "id": 378407906 + }, + { + "src": "http://example.com/rails_logo.gif" } ]; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products.json', + path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "product": {"images": [{"id": 850703190}, {"id": 562641783}, {"id": 378407906}, {"src": "http://example.com/rails_logo.gif"}]} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"count": 2})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:57-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:59:57-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [], "image": null}})); - await shopify.rest.Product.count({ - session: session, - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = []; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-04/products/count.json', + path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: undefined + data: { "product": {"images": []} } }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:01:34-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 850703190, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}], "image": {"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}}})); - await shopify.rest.Product.count({ - session: session, - collection_id: "841564295", - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = [ + { + "id": 850703190, + "position": 3 + }, + { + "id": 562641783, + "position": 2 + }, + { + "id": 378407906, + "position": 1 + } + ]; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-04/products/count.json', - query: 'collection_id=841564295', + path: '/admin/api/2022-04/products/632910392.json', + query: '', headers, - data: undefined + data: { "product": {"images": [{"id": 850703190, "position": 3}, {"id": 562641783, "position": 2}, {"id": 378407906, "position": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:02:16-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Black", "Green", "Red", "Pink"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); - await shopify.rest.Product.find({ - session: session, - id: 632910392, - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.variants = [ + { + "id": 457924702 + }, + { + "id": 39072856 + }, + { + "id": 49148385 + }, + { + "id": 808950810 + } + ]; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: undefined + data: { "product": {"variants": [{"id": 457924702}, {"id": 39072856}, {"id": 49148385}, {"id": 808950810}]} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); - await shopify.rest.Product.find({ - session: session, - id: 632910392, - fields: "id,images,title", - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.metafields_global_title_tag = "Brand new title"; + product.metafields_global_description_tag = "Brand new description"; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-04/products/632910392.json', - query: 'fields=id%2Cimages%2Ctitle', + query: '', headers, - data: undefined + data: { "product": {"metafields_global_title_tag": "Brand new title", "metafields_global_description_tag": "Brand new description"} } }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "New product title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:20-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:11-05:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); product.id = 632910392; - product.title = "New product title"; + product.status = "draft"; await product.save({}); expect({ @@ -468,16 +448,16 @@ describe('Product resource', () => { path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"title": "New product title"} } + data: { "product": {"status": "draft"} } }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:22-04:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:46-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); product.id = 632910392; - product.status = "draft"; + product.tags = "Barnes & Noble, John's Fav"; await product.save({}); expect({ @@ -486,16 +466,16 @@ describe('Product resource', () => { path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"status": "draft"} } + data: { "product": {"tags": "Barnes & Noble, John's Fav"} } }).toMatchMadeHttpRequest(); }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:24-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "New product title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:01:10-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); product.id = 632910392; - product.tags = "Barnes & Noble, John's Fav"; + product.title = "New product title"; await product.save({}); expect({ @@ -504,215 +484,231 @@ describe('Product resource', () => { path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"tags": "Barnes & Noble, John's Fav"} } + data: { "product": {"title": "New product title"} } }).toMatchMadeHttpRequest(); }); it('test_23', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:26-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:26-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({})); - const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.images = []; - await product.save({}); + await shopify.rest.Product.delete({ + session: session, + id: 632910392, + }); expect({ - method: 'PUT', + method: 'DELETE', domain, path: '/admin/api/2022-04/products/632910392.json', query: '', headers, - data: { "product": {"images": []} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_24', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:30-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 1001473901, "product_id": 632910392, "position": 4, "created_at": "2022-09-28T16:40:30-04:00", "updated_at": "2022-09-28T16:40:30-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20220928-1971383-urea82.gif?v=1664397630", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473901"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559595, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:02:18-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:02:18-05:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559595", "variants": [{"id": 1070325052, "product_id": 1071559595, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:02:18-05:00", "updated_at": "2023-01-03T13:02:18-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325052, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325052"}], "options": [{"id": 1055547207, "product_id": 1071559595, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.images = [ - { - "id": 850703190 - }, - { - "id": 562641783 - }, - { - "id": 378407906 - }, - { - "src": "http://example.com/rails_logo.gif" - } - ]; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.status = "draft"; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392.json', + path: '/admin/api/2022-04/products.json', query: '', headers, - data: { "product": {"images": [{"id": 850703190}, {"id": 562641783}, {"id": 378407906}, {"src": "http://example.com/rails_logo.gif"}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "status": "draft"} } }).toMatchMadeHttpRequest(); }); it('test_25', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:33-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:33-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397633", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 850703190, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:33-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397633", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}], "image": {"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:33-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397633", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559585, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:56-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:56-05:00", "published_at": "2023-01-03T13:00:56-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559585", "variants": [{"id": 1070325040, "product_id": 1071559585, "title": "First", "price": "10.00", "sku": "123", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "First", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:56-05:00", "updated_at": "2023-01-03T13:00:56-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325040, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "10.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325040"}, {"id": 1070325041, "product_id": 1071559585, "title": "Second", "price": "20.00", "sku": "123", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Second", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:56-05:00", "updated_at": "2023-01-03T13:00:56-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325041, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "20.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325041"}], "options": [{"id": 1055547196, "product_id": 1071559585, "name": "Title", "position": 1, "values": ["First", "Second"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.images = [ - { - "id": 850703190, - "position": 3 - }, + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.variants = [ { - "id": 562641783, - "position": 2 + "option1": "First", + "price": "10.00", + "sku": "123" }, { - "id": 378407906, - "position": 1 + "option1": "Second", + "price": "20.00", + "sku": "123" } ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392.json', + path: '/admin/api/2022-04/products.json', query: '', headers, - data: { "product": {"images": [{"id": 850703190, "position": 3}, {"id": 562641783, "position": 2}, {"id": 378407906, "position": 1}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "First", "price": "10.00", "sku": "123"}, {"option1": "Second", "price": "20.00", "sku": "123"}]} } }).toMatchMadeHttpRequest(); }); it('test_26', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:36-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Black", "Green", "Red", "Pink"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559582, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:15-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:15-05:00", "published_at": "2023-01-03T13:00:15-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559582", "variants": [{"id": 1070325035, "product_id": 1071559582, "title": "Blue / 155", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Blue", "option2": "155", "option3": null, "created_at": "2023-01-03T13:00:15-05:00", "updated_at": "2023-01-03T13:00:15-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325035, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325035"}, {"id": 1070325036, "product_id": 1071559582, "title": "Black / 159", "price": "0.00", "sku": "", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Black", "option2": "159", "option3": null, "created_at": "2023-01-03T13:00:15-05:00", "updated_at": "2023-01-03T13:00:15-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325036, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325036"}], "options": [{"id": 1055547192, "product_id": 1071559582, "name": "Color", "position": 1, "values": ["Blue", "Black"]}, {"id": 1055547193, "product_id": 1071559582, "name": "Size", "position": 2, "values": ["155", "159"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; product.variants = [ { - "id": 457924702 + "option1": "Blue", + "option2": "155" }, { - "id": 39072856 - }, + "option1": "Black", + "option2": "159" + } + ]; + product.options = [ { - "id": 49148385 + "name": "Color", + "values": [ + "Blue", + "Black" + ] }, { - "id": 808950810 + "name": "Size", + "values": [ + "155", + "159" + ] } ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392.json', + path: '/admin/api/2022-04/products.json', query: '', headers, - data: { "product": {"variants": [{"id": 457924702}, {"id": 39072856}, {"id": 49148385}, {"id": 808950810}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "Blue", "option2": "155"}, {"option1": "Black", "option2": "159"}], "options": [{"name": "Color", "values": ["Blue", "Black"]}, {"name": "Size", "values": ["155", "159"]}]} } }).toMatchMadeHttpRequest(); }); it('test_27', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "Updated Product Title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:40-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "2000.00", "sku": "Updating the Product SKU", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:40-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559586, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:01:04-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:01:04-05:00", "published_at": "2023-01-03T13:01:04-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "Barnes & Noble, Big Air, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/1071559586", "variants": [{"id": 1070325042, "product_id": 1071559586, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:01:04-05:00", "updated_at": "2023-01-03T13:01:04-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325042, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325042"}], "options": [{"id": 1055547197, "product_id": 1071559586, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.title = "Updated Product Title"; - product.variants = [ - { - "id": 808950810, - "price": "2000.00", - "sku": "Updating the Product SKU" - }, - { - "id": 49148385 - }, - { - "id": 39072856 - }, - { - "id": 457924702 - } + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.tags = [ + "Barnes & Noble", + "Big Air", + "John's Fav" ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392.json', + path: '/admin/api/2022-04/products.json', query: '', headers, - data: { "product": {"title": "Updated Product Title", "variants": [{"id": 808950810, "price": "2000.00", "sku": "Updating the Product SKU"}, {"id": 49148385}, {"id": 39072856}, {"id": 457924702}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "tags": ["Barnes & Noble", "Big Air", "John's Fav"]} } }).toMatchMadeHttpRequest(); }); it('test_28', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559578, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T12:59:53-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T12:59:53-05:00", "published_at": "2023-01-03T12:59:53-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559578", "variants": [{"id": 1070325031, "product_id": 1071559578, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325031, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325031"}], "options": [{"id": 1055547186, "product_id": 1071559578, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473906, "product_id": 1071559578, "position": 1, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-j94qo6.gif?v=1672768793", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473906"}], "image": {"id": 1001473906, "product_id": 1071559578, "position": 1, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-j94qo6.gif?v=1672768793", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473906"}}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.metafields_global_title_tag = "Brand new title"; - product.metafields_global_description_tag = "Brand new description"; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "src": "http://example.com/rails_logo.gif" + } + ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392.json', + path: '/admin/api/2022-04/products.json', query: '', headers, - data: { "product": {"metafields_global_title_tag": "Brand new title", "metafields_global_description_tag": "Brand new description"} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"src": "http://example.com/rails_logo.gif"}]} } }).toMatchMadeHttpRequest(); }); it('test_29', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:45-04:00", "published_at": "2022-09-28T16:40:45-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559583, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:23-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:23-05:00", "published_at": "2023-01-03T13:00:23-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559583", "variants": [{"id": 1070325037, "product_id": 1071559583, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325037, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325037"}], "options": [{"id": 1055547194, "product_id": 1071559583, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473907, "product_id": 1071559583, "position": 1, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768823", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473907"}], "image": {"id": 1001473907, "product_id": 1071559583, "position": 1, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768823", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473907"}}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.published = true; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + } + ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392.json', + path: '/admin/api/2022-04/products.json', query: '', headers, - data: { "product": {"published": true} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}]} } }).toMatchMadeHttpRequest(); }); it('test_30', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:47-04:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559581, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:09-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:09-05:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559581", "variants": [{"id": 1070325034, "product_id": 1071559581, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:09-05:00", "updated_at": "2023-01-03T13:00:09-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325034, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325034"}], "options": [{"id": 1055547191, "product_id": 1071559581, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; product.published = false; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392.json', + path: '/admin/api/2022-04/products.json', query: '', headers, - data: { "product": {"published": false} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "published": false} } }).toMatchMadeHttpRequest(); }); it('test_31', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:49-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559576, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T12:59:44-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T12:59:44-05:00", "published_at": "2023-01-03T12:59:44-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559576", "variants": [{"id": 1070325030, "product_id": 1071559576, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T12:59:44-05:00", "updated_at": "2023-01-03T12:59:44-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325030, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325030"}], "options": [{"id": 1055547183, "product_id": 1071559576, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; product.metafields = [ { "key": "new", @@ -724,30 +720,34 @@ describe('Product resource', () => { await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392.json', + path: '/admin/api/2022-04/products.json', query: '', headers, - data: { "product": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_32', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559584, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:52-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:52-05:00", "published_at": "2023-01-03T13:00:52-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559584", "variants": [{"id": 1070325039, "product_id": 1071559584, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:52-05:00", "updated_at": "2023-01-03T13:00:52-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325039, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325039"}], "options": [{"id": 1055547195, "product_id": 1071559584, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); - await shopify.rest.Product.delete({ - session: session, - id: 632910392, - }); + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.metafields_global_title_tag = "Product SEO Title"; + product.metafields_global_description_tag = "Product SEO Description"; + await product.save({}); expect({ - method: 'DELETE', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392.json', + path: '/admin/api/2022-04/products.json', query: '', headers, - data: undefined + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields_global_title_tag": "Product SEO Title", "metafields_global_description_tag": "Product SEO Description"} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/product_listing.test.ts b/rest/admin/__tests__/2022-04/product_listing.test.ts index 6a54cc9d3..400052394 100644 --- a/rest/admin/__tests__/2022-04/product_listing.test.ts +++ b/rest/admin/__tests__/2022-04/product_listing.test.ts @@ -31,7 +31,7 @@ describe('ProductListing resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"product_listings": [{"product_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "handle": "ipod-nano", "product_type": "Cult Products", "title": "IPod Nano - 8GB", "vendor": "Apple", "available": true, "tags": "Emotive, Flash Memory, MP3, Music", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 808950810, "title": "Pink", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Pink"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008PINK", "barcode": "1234_pink", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 10, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": 562641783, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}, {"id": 49148385, "title": "Red", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Red"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008RED", "barcode": "1234_red", "taxable": true, "position": 2, "available": true, "inventory_policy": "continue", "inventory_quantity": 20, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}, {"id": 39072856, "title": "Green", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Green"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008GREEN", "barcode": "1234_green", "taxable": true, "position": 3, "available": true, "inventory_policy": "continue", "inventory_quantity": 30, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}, {"id": 457924702, "title": "Black", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008BLACK", "barcode": "1234_black", "taxable": true, "position": 4, "available": true, "inventory_policy": "continue", "inventory_quantity": 40, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [{"id": 850703190, "created_at": "2022-10-03T12:15:55-04:00", "position": 1, "updated_at": "2022-10-03T12:15:55-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "width": 123, "height": 456}, {"id": 562641783, "created_at": "2022-10-03T12:15:55-04:00", "position": 2, "updated_at": "2022-10-03T12:15:55-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "variant_ids": [808950810], "width": 123, "height": 456}, {"id": 378407906, "created_at": "2022-10-03T12:15:55-04:00", "position": 3, "updated_at": "2022-10-03T12:15:55-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "width": 123, "height": 456}], "options": [{"id": 594680422, "name": "Color", "product_id": 632910392, "position": 1, "values": ["Pink", "Red", "Green", "Black"]}]}, {"product_id": 921728736, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}]})); + queueMockResponse(JSON.stringify({"product_listings": [{"product_id": 632910392, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "handle": "ipod-nano", "product_type": "Cult Products", "title": "IPod Nano - 8GB", "vendor": "Apple", "available": true, "tags": "Emotive, Flash Memory, MP3, Music", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 808950810, "title": "Pink", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Pink"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008PINK", "barcode": "1234_pink", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 10, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": 562641783, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 49148385, "title": "Red", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Red"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008RED", "barcode": "1234_red", "taxable": true, "position": 2, "available": true, "inventory_policy": "continue", "inventory_quantity": 20, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 39072856, "title": "Green", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Green"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008GREEN", "barcode": "1234_green", "taxable": true, "position": 3, "available": true, "inventory_policy": "continue", "inventory_quantity": 30, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 457924702, "title": "Black", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008BLACK", "barcode": "1234_black", "taxable": true, "position": 4, "available": true, "inventory_policy": "continue", "inventory_quantity": 40, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [{"id": 850703190, "created_at": "2023-01-03T12:05:09-05:00", "position": 1, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672765509", "variant_ids": [], "width": 123, "height": 456}, {"id": 562641783, "created_at": "2023-01-03T12:05:09-05:00", "position": 2, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672765509", "variant_ids": [808950810], "width": 123, "height": 456}, {"id": 378407906, "created_at": "2023-01-03T12:05:09-05:00", "position": 3, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672765509", "variant_ids": [], "width": 123, "height": 456}], "options": [{"id": 594680422, "name": "Color", "product_id": 632910392, "position": 1, "values": ["Pink", "Red", "Green", "Black"]}]}, {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}]})); await shopify.rest.ProductListing.all({ session: session, @@ -82,7 +82,7 @@ describe('ProductListing resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); await shopify.rest.ProductListing.find({ session: session, @@ -100,7 +100,7 @@ describe('ProductListing resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); const product_listing = new shopify.rest.ProductListing({session: session}); product_listing.product_id = 921728736; diff --git a/rest/admin/__tests__/2022-04/product_resource_feedback.test.ts b/rest/admin/__tests__/2022-04/product_resource_feedback.test.ts index 5033a0085..3071056a7 100644 --- a/rest/admin/__tests__/2022-04/product_resource_feedback.test.ts +++ b/rest/admin/__tests__/2022-04/product_resource_feedback.test.ts @@ -31,7 +31,7 @@ describe('ProductResourceFeedback resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T13:22:08-04:00", "updated_at": "2022-10-03T13:22:08-04:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2022-10-03T13:07:13-04:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2022-10-03T13:22:08-04:00", "state": "requires_action"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:45:42-05:00", "updated_at": "2023-01-03T12:45:42-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2023-01-03T12:45:40-05:00", "state": "requires_action"}})); const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); product_resource_feedback.product_id = 632910392; @@ -39,8 +39,8 @@ describe('ProductResourceFeedback resource', () => { product_resource_feedback.messages = [ "Needs at least one image." ]; - product_resource_feedback.resource_updated_at = "2022-10-03T13:07:13-04:00"; - product_resource_feedback.feedback_generated_at = "2022-10-03T17:22:08.114485Z"; + product_resource_feedback.resource_updated_at = "2023-01-03T12:21:36-05:00"; + product_resource_feedback.feedback_generated_at = "2023-01-03T17:45:40.928568Z"; await product_resource_feedback.save({}); expect({ @@ -49,18 +49,18 @@ describe('ProductResourceFeedback resource', () => { path: '/admin/api/2022-04/products/632910392/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "requires_action", "messages": ["Needs at least one image."], "resource_updated_at": "2022-10-03T13:07:13-04:00", "feedback_generated_at": "2022-10-03T17:22:08.114485Z"} } + data: { "resource_feedback": {"state": "requires_action", "messages": ["Needs at least one image."], "resource_updated_at": "2023-01-03T12:21:36-05:00", "feedback_generated_at": "2023-01-03T17:45:40.928568Z"} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T13:22:10-04:00", "updated_at": "2022-10-03T13:22:10-04:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2022-10-03T13:07:13-04:00", "messages": [], "feedback_generated_at": "2022-10-03T13:22:09-04:00", "state": "success"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:45:45-05:00", "updated_at": "2023-01-03T12:45:45-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": [], "feedback_generated_at": "2023-01-03T12:45:44-05:00", "state": "success"}})); const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); product_resource_feedback.product_id = 632910392; product_resource_feedback.state = "success"; - product_resource_feedback.resource_updated_at = "2022-10-03T13:07:13-04:00"; - product_resource_feedback.feedback_generated_at = "2022-10-03T17:22:09.073706Z"; + product_resource_feedback.resource_updated_at = "2023-01-03T12:21:36-05:00"; + product_resource_feedback.feedback_generated_at = "2023-01-03T17:45:44.063762Z"; await product_resource_feedback.save({}); expect({ @@ -69,12 +69,12 @@ describe('ProductResourceFeedback resource', () => { path: '/admin/api/2022-04/products/632910392/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "success", "resource_updated_at": "2022-10-03T13:07:13-04:00", "feedback_generated_at": "2022-10-03T17:22:09.073706Z"} } + data: { "resource_feedback": {"state": "success", "resource_updated_at": "2023-01-03T12:21:36-05:00", "feedback_generated_at": "2023-01-03T17:45:44.063762Z"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2022-10-03T13:22:11-04:00", "updated_at": "2022-10-03T13:22:11-04:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2022-10-03T13:07:13-04:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2022-10-03T12:22:11-04:00", "state": "requires_action"}]})); + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2023-01-03T12:45:45-05:00", "updated_at": "2023-01-03T12:45:45-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2023-01-03T11:45:45-05:00", "state": "requires_action"}]})); await shopify.rest.ProductResourceFeedback.all({ session: session, diff --git a/rest/admin/__tests__/2022-04/recurring_application_charge.test.ts b/rest/admin/__tests__/2022-04/recurring_application_charge.test.ts index 2b6c392dd..6959d65fe 100644 --- a/rest/admin/__tests__/2022-04/recurring_application_charge.test.ts +++ b/rest/admin/__tests__/2022-04/recurring_application_charge.test.ts @@ -31,12 +31,13 @@ describe('RecurringApplicationCharge resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266947, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:52:52-04:00", "updated_at": "2022-10-03T12:52:52-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266947", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266947/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBANeWT06EmF1dG9fYWN0aXZhdGVU--fd1fceece89091b9d39f3c13b2b6ba1868c07823"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266949, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:35-05:00", "updated_at": "2023-01-03T13:06:35-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 5, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266949", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266949/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAVeWT06EmF1dG9fYWN0aXZhdGVU--9b5c79476bf6e10095d51a27255892c04e5dd4fa"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + recurring_application_charge.trial_days = 5; await recurring_application_charge.save({}); expect({ @@ -45,18 +46,19 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-04/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com"} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "trial_days": 5} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266950, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:52:58-04:00", "updated_at": "2022-10-03T12:52:58-04:00", "test": true, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266950", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266950/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAZeWT06EmF1dG9fYWN0aXZhdGVU--c5d071902db4f2e27dd740432882625a5fab74c9"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266951, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:39-05:00", "updated_at": "2023-01-03T13:06:39-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": null, "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266951", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266951/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAdeWT06EmF1dG9fYWN0aXZhdGVU--4e07fb141094c2ffacfcff713a2dc85eab38a229"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; - recurring_application_charge.test = true; + recurring_application_charge.capped_amount = 100; + recurring_application_charge.terms = "$1 for 1000 emails"; await recurring_application_charge.save({}); expect({ @@ -65,19 +67,17 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-04/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "capped_amount": 100, "terms": "$1 for 1000 emails"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266951, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:52:59-04:00", "updated_at": "2022-10-03T12:52:59-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": null, "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266951", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266951/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAdeWT06EmF1dG9fYWN0aXZhdGVU--c1960487d59ce5a37a7ff2dfa85ca64c904b92cd"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266952, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:41-05:00", "updated_at": "2023-01-03T13:06:41-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266952", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266952/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAheWT06EmF1dG9fYWN0aXZhdGVU--c278a9ebe0e4885c8b9df2be46598c9b9abf0731"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; - recurring_application_charge.capped_amount = 100; - recurring_application_charge.terms = "$1 for 1000 emails"; await recurring_application_charge.save({}); expect({ @@ -86,18 +86,18 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-04/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "capped_amount": 100, "terms": "$1 for 1000 emails"} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266954, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:53:11-04:00", "updated_at": "2022-10-03T12:53:11-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 5, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266954", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266954/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBApeWT06EmF1dG9fYWN0aXZhdGVU--784a3d7ab3ffbe680e66bc9b6017f0b19a84eb94"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266954, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:51-05:00", "updated_at": "2023-01-03T13:06:51-05:00", "test": true, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266954", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266954/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBApeWT06EmF1dG9fYWN0aXZhdGVU--f0a955813cb17f90e052cdbc976832ce6f213068"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; - recurring_application_charge.trial_days = 5; + recurring_application_charge.test = true; await recurring_application_charge.save({}); expect({ @@ -106,22 +106,21 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-04/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "trial_days": 5} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "pending", "return_url": "http://yourapp.example.org", "billing_on": "2022-10-03", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVU--b5f90d04779cc5242b396e4054f2e650c5dace1c"}})); + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "accepted", "return_url": "http://yourapp.example.org", "billing_on": "2023-01-03", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:06:22-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195"}]})); - await shopify.rest.RecurringApplicationCharge.find({ + await shopify.rest.RecurringApplicationCharge.all({ session: session, - id: 455696195, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/recurring_application_charges/455696195.json', + path: '/admin/api/2022-04/recurring_application_charges.json', query: '', headers, data: undefined @@ -129,52 +128,53 @@ describe('RecurringApplicationCharge resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 1029266947, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:21-05:00", "updated_at": "2023-01-03T13:06:21-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266947", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266947/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBANeWT06EmF1dG9fYWN0aXZhdGVU--4e6554253be678506a3421452fb801fd291e6db7"}]})); - await shopify.rest.RecurringApplicationCharge.delete({ + await shopify.rest.RecurringApplicationCharge.all({ session: session, - id: 455696195, + since_id: "455696195", }); expect({ - method: 'DELETE', + method: 'GET', domain, - path: '/admin/api/2022-04/recurring_application_charges/455696195.json', - query: '', + path: '/admin/api/2022-04/recurring_application_charges.json', + query: 'since_id=455696195', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 1029266953, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:53:09-04:00", "updated_at": "2022-10-03T12:53:09-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266953", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266953/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAleWT06EmF1dG9fYWN0aXZhdGVU--1255bd14c50f77b5a2bab1190e116c8784e01280"}]})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "pending", "return_url": "http://yourapp.example.org", "billing_on": "2023-01-03", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVU--b5f90d04779cc5242b396e4054f2e650c5dace1c"}})); - await shopify.rest.RecurringApplicationCharge.all({ + await shopify.rest.RecurringApplicationCharge.find({ session: session, - since_id: "455696195", + id: 455696195, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/recurring_application_charges.json', - query: 'since_id=455696195', + path: '/admin/api/2022-04/recurring_application_charges/455696195.json', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "accepted", "return_url": "http://yourapp.example.org", "billing_on": "2022-10-03", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:53:11-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195"}]})); + queueMockResponse(JSON.stringify({})); - await shopify.rest.RecurringApplicationCharge.all({ + await shopify.rest.RecurringApplicationCharge.delete({ session: session, + id: 455696195, }); expect({ - method: 'GET', + method: 'DELETE', domain, - path: '/admin/api/2022-04/recurring_application_charges.json', + path: '/admin/api/2022-04/recurring_application_charges/455696195.json', query: '', headers, data: undefined @@ -182,7 +182,7 @@ describe('RecurringApplicationCharge resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"return_url": "http://yourapp.example.org/", "id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "active", "billing_on": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:53:07-04:00", "test": null, "activated_on": "2022-10-03", "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": "2022-10-03", "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://yourapp.example.org/?charge_id=455696195", "update_capped_amount_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_update_capped_amount?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVG--4fa9614788ca5e1cf650a7e46ca7681295b568d8"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"return_url": "http://yourapp.example.org/", "id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "active", "billing_on": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:06:19-05:00", "test": null, "activated_on": "2023-01-03", "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": "2023-01-03", "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://yourapp.example.org/?charge_id=455696195", "update_capped_amount_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_update_capped_amount?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVG--c9d104c0a19c52b84fa17360f32abc13aae86935"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.id = 455696195; diff --git a/rest/admin/__tests__/2022-04/redirect.test.ts b/rest/admin/__tests__/2022-04/redirect.test.ts index a3875b3b4..f3d926234 100644 --- a/rest/admin/__tests__/2022-04/redirect.test.ts +++ b/rest/admin/__tests__/2022-04/redirect.test.ts @@ -174,7 +174,7 @@ describe('Redirect resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"redirect": {"id": 984542199, "path": "/ipod", "target": "/pages/itunes"}})); + queueMockResponse(JSON.stringify({"redirect": {"id": 984542200, "path": "/ipod", "target": "/pages/itunes"}})); const redirect = new shopify.rest.Redirect({session: session}); redirect.path = "/ipod"; @@ -192,7 +192,7 @@ describe('Redirect resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"redirect": {"id": 984542200, "path": "/forums", "target": "http://forums.apple.com/"}})); + queueMockResponse(JSON.stringify({"redirect": {"id": 984542199, "path": "/forums", "target": "http://forums.apple.com/"}})); const redirect = new shopify.rest.Redirect({session: session}); redirect.path = "http://www.apple.com/forums"; diff --git a/rest/admin/__tests__/2022-04/refund.test.ts b/rest/admin/__tests__/2022-04/refund.test.ts index 3cacf82ea..8a826afff 100644 --- a/rest/admin/__tests__/2022-04/refund.test.ts +++ b/rest/admin/__tests__/2022-04/refund.test.ts @@ -31,7 +31,7 @@ describe('Refund resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"refunds": [{"id": 509562969, "order_id": 450789469, "created_at": "2022-10-03T12:44:45-04:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2022-10-03T12:44:45-04:00", "restock": true, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}]})); + queueMockResponse(JSON.stringify({"refunds": [{"id": 509562969, "order_id": 450789469, "created_at": "2023-01-03T12:56:35-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2023-01-03T12:56:35-05:00", "restock": true, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}]})); await shopify.rest.Refund.all({ session: session, @@ -49,18 +49,28 @@ describe('Refund resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"refund": {"id": 929361463, "order_id": 450789469, "created_at": "2022-10-03T12:51:57-04:00", "note": null, "user_id": null, "processed_at": "2022-10-03T12:51:57-04:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "refund_line_items": [], "transactions": [{"id": 1068278470, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-10-03T12:51:57-04:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2022-10-03T12:51:57-04:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "currency_exchange_adjustment": null, "amount": "5.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278470"}], "order_adjustments": [{"id": 1030976842, "order_id": 450789469, "refund_id": 929361463, "amount": "-5.00", "tax_amount": "0.00", "kind": "shipping_refund", "reason": "Shipping refund", "amount_set": {"shop_money": {"amount": "-5.00", "currency_code": "USD"}, "presentment_money": {"amount": "-5.00", "currency_code": "USD"}}, "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}]}})); + queueMockResponse(JSON.stringify({"refund": {"id": 929361465, "order_id": 450789469, "created_at": "2023-01-03T13:05:55-05:00", "note": "wrong size", "user_id": null, "processed_at": "2023-01-03T13:05:55-05:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/929361465", "refund_line_items": [{"location_id": null, "restock_type": "no_restock", "quantity": 1, "id": 1058498312, "line_item_id": 518995019, "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 1068278491, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T13:05:54-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2023-01-03T13:05:54-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "41.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278491"}], "order_adjustments": []}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; refund.currency = "USD"; + refund.notify = true; + refund.note = "wrong size"; refund.shipping = { - "amount": 5.0 + "full_refund": true }; + refund.refund_line_items = [ + { + "line_item_id": 518995019, + "quantity": 1, + "restock_type": "return", + "location_id": 487838322 + } + ]; refund.transactions = [ { "parent_id": 801038806, - "amount": 5.0, + "amount": 41.94, "kind": "refund", "gateway": "bogus" } @@ -73,33 +83,23 @@ describe('Refund resource', () => { path: '/admin/api/2022-04/orders/450789469/refunds.json', query: '', headers, - data: { "refund": {"currency": "USD", "shipping": {"amount": 5.0}, "transactions": [{"parent_id": 801038806, "amount": 5.0, "kind": "refund", "gateway": "bogus"}]} } + data: { "refund": {"currency": "USD", "notify": true, "note": "wrong size", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "return", "location_id": 487838322}], "transactions": [{"parent_id": 801038806, "amount": 41.94, "kind": "refund", "gateway": "bogus"}]} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"refund": {"id": 929361464, "order_id": 450789469, "created_at": "2022-10-03T12:52:06-04:00", "note": "wrong size", "user_id": null, "processed_at": "2022-10-03T12:52:06-04:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/Refund/929361464", "refund_line_items": [{"location_id": null, "restock_type": "no_restock", "quantity": 1, "id": 1058498308, "line_item_id": 518995019, "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 1068278471, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-10-03T12:52:05-04:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2022-10-03T12:52:05-04:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "currency_exchange_adjustment": null, "amount": "41.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278471"}], "order_adjustments": []}})); + queueMockResponse(JSON.stringify({"refund": {"id": 929361466, "order_id": 450789469, "created_at": "2023-01-03T13:05:59-05:00", "note": null, "user_id": null, "processed_at": "2023-01-03T13:05:59-05:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/929361466", "refund_line_items": [], "transactions": [{"id": 1068278492, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T13:05:59-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2023-01-03T13:05:59-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "5.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278492"}], "order_adjustments": [{"id": 1030976843, "order_id": 450789469, "refund_id": 929361466, "amount": "-5.00", "tax_amount": "0.00", "kind": "shipping_refund", "reason": "Shipping refund", "amount_set": {"shop_money": {"amount": "-5.00", "currency_code": "USD"}, "presentment_money": {"amount": "-5.00", "currency_code": "USD"}}, "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}]}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; refund.currency = "USD"; - refund.notify = true; - refund.note = "wrong size"; refund.shipping = { - "full_refund": true + "amount": 5.0 }; - refund.refund_line_items = [ - { - "line_item_id": 518995019, - "quantity": 1, - "restock_type": "return", - "location_id": 487838322 - } - ]; refund.transactions = [ { "parent_id": 801038806, - "amount": 41.94, + "amount": 5.0, "kind": "refund", "gateway": "bogus" } @@ -112,12 +112,12 @@ describe('Refund resource', () => { path: '/admin/api/2022-04/orders/450789469/refunds.json', query: '', headers, - data: { "refund": {"currency": "USD", "notify": true, "note": "wrong size", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "return", "location_id": 487838322}], "transactions": [{"parent_id": 801038806, "amount": 41.94, "kind": "refund", "gateway": "bogus"}]} } + data: { "refund": {"currency": "USD", "shipping": {"amount": 5.0}, "transactions": [{"parent_id": 801038806, "amount": 5.0, "kind": "refund", "gateway": "bogus"}]} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"refund": {"id": 509562969, "order_id": 450789469, "created_at": "2022-10-03T12:44:45-04:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2022-10-03T12:44:45-04:00", "restock": true, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "c901414060.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}})); + queueMockResponse(JSON.stringify({"refund": {"id": 509562969, "order_id": 450789469, "created_at": "2023-01-03T12:56:35-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2023-01-03T12:56:35-05:00", "restock": true, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}})); await shopify.rest.Refund.find({ session: session, @@ -136,12 +136,12 @@ describe('Refund resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "2.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "2.00", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; await refund.calculate({ - body: {"refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + body: {"refund": {"currency": "USD", "shipping": {"amount": 2.0}}}, }); expect({ @@ -150,17 +150,17 @@ describe('Refund resource', () => { path: '/admin/api/2022-04/orders/450789469/refunds/calculate.json', query: '', headers, - data: { "refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + data: { "refund": {"currency": "USD", "shipping": {"amount": 2.0}} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; await refund.calculate({ - body: {"refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + body: {"refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, }); expect({ @@ -169,17 +169,17 @@ describe('Refund resource', () => { path: '/admin/api/2022-04/orders/450789469/refunds/calculate.json', query: '', headers, - data: { "refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + data: { "refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "2.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_line_items": [], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "2.00", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; await refund.calculate({ - body: {"refund": {"currency": "USD", "shipping": {"amount": 2.0}}}, + body: {"refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, }); expect({ @@ -188,7 +188,7 @@ describe('Refund resource', () => { path: '/admin/api/2022-04/orders/450789469/refunds/calculate.json', query: '', headers, - data: { "refund": {"currency": "USD", "shipping": {"amount": 2.0}} } + data: { "refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/report.test.ts b/rest/admin/__tests__/2022-04/report.test.ts index b19e59bc8..d3fb0dddf 100644 --- a/rest/admin/__tests__/2022-04/report.test.ts +++ b/rest/admin/__tests__/2022-04/report.test.ts @@ -31,113 +31,95 @@ describe('Report resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2022-10-03T12:44:45-04:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}, {"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, + since_id: "123", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/reports.json', - query: '', + query: 'since_id=123', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2022-10-03T12:44:45-04:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, - updated_at_min: "2005-07-31 15:57:11 EDT -04:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/reports.json', - query: 'updated_at_min=2005-07-31+15%3A57%3A11+EDT+-04%3A00', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales"}, {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}]})); await shopify.rest.Report.all({ session: session, - ids: "517154478", + fields: "id,shopify_ql", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/reports.json', - query: 'ids=517154478', + query: 'fields=id%2Cshopify_ql', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}, {"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2022-10-03T12:44:45-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, - since_id: "123", + ids: "517154478", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/reports.json', - query: 'since_id=123', + query: 'ids=517154478', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales"}, {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, - fields: "id,shopify_ql", + updated_at_min: "2005-07-31 15:57:11 EDT -04:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/reports.json', - query: 'fields=id%2Cshopify_ql', + query: 'updated_at_min=2005-07-31+15%3A57%3A11+EDT+-04%3A00', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"report": {"id": 1016888664, "name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales", "updated_at": "2022-10-03T12:53:33-04:00", "category": "custom_app_reports"}})); - - const report = new shopify.rest.Report({session: session}); - report.name = "A new app report"; - report.shopify_ql = "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"; - await report.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-04/reports.json', - query: '', - headers, - data: { "report": {"name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"} } - }).toMatchMadeHttpRequest(); - }); - - it('test_7', async () => { queueMockResponse(JSON.stringify({"report": {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}})); await shopify.rest.Report.find({ @@ -155,7 +137,7 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { + it('test_7', async () => { queueMockResponse(JSON.stringify({"report": {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}})); await shopify.rest.Report.find({ @@ -174,8 +156,8 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_9', async () => { - queueMockResponse(JSON.stringify({"report": {"name": "Changed Report Name", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -12m UNTIL today ORDER BY total_sales", "id": 517154478, "updated_at": "2022-10-03T12:53:27-04:00", "category": "custom_app_reports"}})); + it('test_8', async () => { + queueMockResponse(JSON.stringify({"report": {"name": "Changed Report Name", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -12m UNTIL today ORDER BY total_sales", "id": 517154478, "updated_at": "2023-01-03T12:47:04-05:00", "category": "custom_app_reports"}})); const report = new shopify.rest.Report({session: session}); report.id = 517154478; @@ -193,7 +175,7 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_10', async () => { + it('test_9', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Report.delete({ @@ -211,4 +193,22 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); + it('test_10', async () => { + queueMockResponse(JSON.stringify({"report": {"id": 1016888664, "name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales", "updated_at": "2023-01-03T12:46:45-05:00", "category": "custom_app_reports"}})); + + const report = new shopify.rest.Report({session: session}); + report.name = "A new app report"; + report.shopify_ql = "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"; + await report.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/reports.json', + query: '', + headers, + data: { "report": {"name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"} } + }).toMatchMadeHttpRequest(); + }); + }); diff --git a/rest/admin/__tests__/2022-04/resource_feedback.test.ts b/rest/admin/__tests__/2022-04/resource_feedback.test.ts index 45d98c2eb..4aca79751 100644 --- a/rest/admin/__tests__/2022-04/resource_feedback.test.ts +++ b/rest/admin/__tests__/2022-04/resource_feedback.test.ts @@ -31,14 +31,14 @@ describe('ResourceFeedback resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T12:45:53-04:00", "updated_at": "2022-10-03T12:45:53-04:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2022-10-03T12:45:51-04:00", "state": "requires_action"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:53:47-05:00", "updated_at": "2023-01-03T12:53:47-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T12:53:46-05:00", "state": "requires_action"}})); const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); resource_feedback.state = "requires_action"; resource_feedback.messages = [ "is not connected. Connect your account to use this sales channel." ]; - resource_feedback.feedback_generated_at = "2022-10-03T16:45:51.594730Z"; + resource_feedback.feedback_generated_at = "2023-01-03T17:53:46.212756Z"; await resource_feedback.save({}); expect({ @@ -47,16 +47,16 @@ describe('ResourceFeedback resource', () => { path: '/admin/api/2022-04/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "requires_action", "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2022-10-03T16:45:51.594730Z"} } + data: { "resource_feedback": {"state": "requires_action", "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T17:53:46.212756Z"} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T12:45:55-04:00", "updated_at": "2022-10-03T12:45:55-04:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": [], "feedback_generated_at": "2022-10-03T12:45:53-04:00", "state": "success"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:53:50-05:00", "updated_at": "2023-01-03T12:53:50-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": [], "feedback_generated_at": "2023-01-03T12:53:49-05:00", "state": "success"}})); const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); resource_feedback.state = "success"; - resource_feedback.feedback_generated_at = "2022-10-03T16:45:53.872041Z"; + resource_feedback.feedback_generated_at = "2023-01-03T17:53:49.185362Z"; await resource_feedback.save({}); expect({ @@ -65,12 +65,12 @@ describe('ResourceFeedback resource', () => { path: '/admin/api/2022-04/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "success", "feedback_generated_at": "2022-10-03T16:45:53.872041Z"} } + data: { "resource_feedback": {"state": "success", "feedback_generated_at": "2023-01-03T17:53:49.185362Z"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2022-10-03T12:45:57-04:00", "updated_at": "2022-10-03T12:45:57-04:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2022-10-03T11:45:57-04:00", "state": "requires_action"}]})); + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2023-01-03T12:53:44-05:00", "updated_at": "2023-01-03T12:53:44-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T11:53:44-05:00", "state": "requires_action"}]})); await shopify.rest.ResourceFeedback.all({ session: session, diff --git a/rest/admin/__tests__/2022-04/script_tag.test.ts b/rest/admin/__tests__/2022-04/script_tag.test.ts index a02afd7b0..061f5e4e2 100644 --- a/rest/admin/__tests__/2022-04/script_tag.test.ts +++ b/rest/admin/__tests__/2022-04/script_tag.test.ts @@ -31,59 +31,77 @@ describe('ScriptTag resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}]})); + queueMockResponse(JSON.stringify({"script_tags": [{"id": 421379493, "src": "https://js.example.org/bar.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}, {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); await shopify.rest.ScriptTag.all({ session: session, - since_id: "421379493", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/script_tags.json', - query: 'since_id=421379493', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}]})); + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); await shopify.rest.ScriptTag.all({ session: session, - src: "https://js.example.org/foo.js", + since_id: "421379493", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/script_tags.json', - query: 'src=https%3A%2F%2Fjs.example.org%2Ffoo.js', + query: 'since_id=421379493', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"script_tags": [{"id": 421379493, "src": "https://js.example.org/bar.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}, {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}]})); + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); await shopify.rest.ScriptTag.all({ session: session, + src: "https://js.example.org/foo.js", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/script_tags.json', - query: '', + query: 'src=https%3A%2F%2Fjs.example.org%2Ffoo.js', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"id": 870402688, "src": "https://example.com/my_script.js", "event": "onload", "created_at": "2023-01-03T12:54:19-05:00", "updated_at": "2023-01-03T12:54:19-05:00", "display_scope": "all", "cache": false}})); + + const script_tag = new shopify.rest.ScriptTag({session: session}); + script_tag.event = "onload"; + script_tag.src = "https://example.com/my_script.js"; + await script_tag.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-04/script_tags.json', + query: '', + headers, + data: { "script_tag": {"event": "onload", "src": "https://example.com/my_script.js"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { queueMockResponse(JSON.stringify({"count": 2})); await shopify.rest.ScriptTag.count({ @@ -100,8 +118,8 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { - queueMockResponse(JSON.stringify({"script_tag": {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all", "cache": false}})); + it('test_6', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all", "cache": false}})); await shopify.rest.ScriptTag.find({ session: session, @@ -118,8 +136,8 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"script_tag": {"src": "https://somewhere-else.com/another.js", "cache": false, "id": 596726825, "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:46:10-04:00", "display_scope": "all"}})); + it('test_7', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"src": "https://somewhere-else.com/another.js", "cache": false, "id": 596726825, "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:54:18-05:00", "display_scope": "all"}})); const script_tag = new shopify.rest.ScriptTag({session: session}); script_tag.id = 596726825; @@ -136,7 +154,7 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { + it('test_8', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.ScriptTag.delete({ @@ -154,22 +172,4 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { - queueMockResponse(JSON.stringify({"script_tag": {"id": 870402687, "src": "https://example.com/my_script.js", "event": "onload", "created_at": "2022-10-03T12:46:20-04:00", "updated_at": "2022-10-03T12:46:20-04:00", "display_scope": "all", "cache": false}})); - - const script_tag = new shopify.rest.ScriptTag({session: session}); - script_tag.event = "onload"; - script_tag.src = "https://example.com/my_script.js"; - await script_tag.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-04/script_tags.json', - query: '', - headers, - data: { "script_tag": {"event": "onload", "src": "https://example.com/my_script.js"} } - }).toMatchMadeHttpRequest(); - }); - }); diff --git a/rest/admin/__tests__/2022-04/shop.test.ts b/rest/admin/__tests__/2022-04/shop.test.ts index 1189bf3d9..5dd70c77b 100644 --- a/rest/admin/__tests__/2022-04/shop.test.ts +++ b/rest/admin/__tests__/2022-04/shop.test.ts @@ -31,7 +31,7 @@ describe('Shop resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"shop": {"id": 548380009, "name": "John Smith Test Store", "email": "j.smith@example.com", "domain": "shop.apple.com", "province": "California", "country": "US", "address1": "1 Infinite Loop", "zip": "95014", "city": "Cupertino", "source": null, "phone": "1231231234", "latitude": 45.45, "longitude": -75.43, "primary_locale": "en", "address2": "Suite 100", "created_at": "2007-12-31T19:00:00-05:00", "updated_at": "2022-10-03T13:22:14-04:00", "country_code": "US", "country_name": "United States", "currency": "USD", "customer_email": "customers@apple.com", "timezone": "(GMT-05:00) Eastern Time (US & Canada)", "iana_timezone": "America/New_York", "shop_owner": "John Smith", "money_format": "${{amount}}", "money_with_currency_format": "${{amount}} USD", "weight_unit": "lb", "province_code": "CA", "taxes_included": null, "auto_configure_tax_inclusivity": null, "tax_shipping": null, "county_taxes": true, "plan_display_name": "Shopify Plus", "plan_name": "enterprise", "has_discounts": true, "has_gift_cards": true, "myshopify_domain": "jsmith.myshopify.com", "google_apps_domain": null, "google_apps_login_enabled": null, "money_in_emails_format": "${{amount}}", "money_with_currency_in_emails_format": "${{amount}} USD", "eligible_for_payments": true, "requires_extra_payments_agreement": false, "password_enabled": false, "has_storefront": true, "eligible_for_card_reader_giveaway": false, "finances": true, "primary_location_id": 655441491, "cookie_consent_level": "implicit", "visitor_tracking_consent_preference": "allow_all", "checkout_api_supported": true, "multi_location_enabled": true, "setup_required": false, "pre_launch_enabled": false, "enabled_presentment_currencies": ["USD"], "transactional_sms_disabled": false, "marketing_sms_consent_enabled_at_checkout": false}})); + queueMockResponse(JSON.stringify({"shop": {"id": 548380009, "name": "John Smith Test Store", "email": "j.smith@example.com", "domain": "shop.apple.com", "province": "California", "country": "US", "address1": "1 Infinite Loop", "zip": "95014", "city": "Cupertino", "source": null, "phone": "1231231234", "latitude": 45.45, "longitude": -75.43, "primary_locale": "en", "address2": "Suite 100", "created_at": "2007-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:55:05-05:00", "country_code": "US", "country_name": "United States", "currency": "USD", "customer_email": "customers@apple.com", "timezone": "(GMT-05:00) Eastern Time (US & Canada)", "iana_timezone": "America/New_York", "shop_owner": "John Smith", "money_format": "${{amount}}", "money_with_currency_format": "${{amount}} USD", "weight_unit": "lb", "province_code": "CA", "taxes_included": null, "auto_configure_tax_inclusivity": null, "tax_shipping": null, "county_taxes": true, "plan_display_name": "Shopify Plus", "plan_name": "enterprise", "has_discounts": true, "has_gift_cards": true, "myshopify_domain": "jsmith.myshopify.com", "google_apps_domain": null, "google_apps_login_enabled": null, "money_in_emails_format": "${{amount}}", "money_with_currency_in_emails_format": "${{amount}} USD", "eligible_for_payments": true, "requires_extra_payments_agreement": false, "password_enabled": false, "has_storefront": true, "eligible_for_card_reader_giveaway": false, "finances": true, "primary_location_id": 655441491, "cookie_consent_level": "implicit", "visitor_tracking_consent_preference": "allow_all", "checkout_api_supported": true, "multi_location_enabled": true, "setup_required": false, "pre_launch_enabled": false, "enabled_presentment_currencies": ["USD"], "transactional_sms_disabled": false, "marketing_sms_consent_enabled_at_checkout": false}})); await shopify.rest.Shop.all({ session: session, diff --git a/rest/admin/__tests__/2022-04/smart_collection.test.ts b/rest/admin/__tests__/2022-04/smart_collection.test.ts index 0b7d65ac7..56d40877d 100644 --- a/rest/admin/__tests__/2022-04/smart_collection.test.ts +++ b/rest/admin/__tests__/2022-04/smart_collection.test.ts @@ -31,42 +31,42 @@ describe('SmartCollection resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001318, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T12:43:30-05:00", "body_html": null, "published_at": "2023-01-03T12:43:29-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001318"}]})); await shopify.rest.SmartCollection.all({ session: session, + since_id: "482865238", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/smart_collections.json', - query: '', + query: 'since_id=482865238', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001333, "handle": "ipods-1", "title": "IPods", "updated_at": "2022-10-03T13:16:25-04:00", "body_html": null, "published_at": "2022-10-03T13:16:25-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001333"}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); await shopify.rest.SmartCollection.all({ session: session, - since_id: "482865238", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/smart_collections.json', - query: 'since_id=482865238', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); await shopify.rest.SmartCollection.all({ session: session, @@ -84,211 +84,194 @@ describe('SmartCollection resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001348, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:18:29-04:00", "body_html": null, "published_at": "2022-10-03T13:18:29-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001348"}, {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001324, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:44:05-05:00", "body_html": null, "published_at": "2023-01-03T12:44:05-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001324"}, {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); await shopify.rest.SmartCollection.all({ session: session, - ids: "482865238,1063001348", + ids: "482865238,1063001324", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/smart_collections.json', - query: 'ids=482865238%2C1063001348', + query: 'ids=482865238%2C1063001324', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001332, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:16:20-04:00", "body_html": null, "published_at": "2022-10-03T13:16:20-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001332"}})); + queueMockResponse(JSON.stringify({"count": 1})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - await smart_collection.save({}); + await shopify.rest.SmartCollection.count({ + session: session, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/smart_collections.json', + path: '/admin/api/2022-04/smart_collections/count.json', query: '', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001336, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:17:01-04:00", "body_html": null, "published_at": "2022-10-03T13:16:55-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001336", "image": {"created_at": "2022-10-03T13:16:58-04:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-4mmir0.gif?v=1664817421"}}})); + queueMockResponse(JSON.stringify({"count": 1})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - smart_collection.image = { - "src": "http://example.com/rails_logo.gif", - "alt": "Rails Logo" - }; - await smart_collection.save({}); + await shopify.rest.SmartCollection.count({ + session: session, + product_id: "632910392", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/smart_collections.json', - query: '', + path: '/admin/api/2022-04/smart_collections/count.json', + query: 'product_id=632910392', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001339, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:17:45-04:00", "body_html": null, "published_at": "2022-10-03T13:17:42-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001339", "image": {"created_at": "2022-10-03T13:17:45-04:00", "alt": "iPod", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664817465"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 2, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - smart_collection.image = { - "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", - "alt": "iPod" - }; - await smart_collection.save({}); + await shopify.rest.SmartCollection.find({ + session: session, + id: 482865238, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-04/smart_collections.json', + path: '/admin/api/2022-04/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", "alt": "iPod"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001346, "handle": "ipods-1", "title": "IPods", "updated_at": "2022-10-03T13:18:22-04:00", "body_html": null, "published_at": "2022-10-03T13:18:22-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001346"}})); + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": null, "updated_at": "2023-01-03T12:43:43-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "IPods"; - smart_collection.rules = [ - { - "column": "title", - "relation": "starts_with", - "condition": "iPod" - } - ]; + smart_collection.id = 482865238; + smart_collection.published = false; await smart_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/smart_collections.json', + path: '/admin/api/2022-04/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"title": "IPods", "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}]} } + data: { "smart_collection": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001347, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:18:27-04:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001347"}})); + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": "2023-01-03T12:43:23-05:00", "updated_at": "2023-01-03T12:43:23-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - smart_collection.published = false; + smart_collection.id = 482865238; + smart_collection.published = true; await smart_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/smart_collections.json', + path: '/admin/api/2022-04/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published": false} } + data: { "smart_collection": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

The best selling ipod ever

", "handle": "smart-ipods", "updated_at": "2023-01-03T12:44:13-05:00", "id": 482865238, "sort_order": "manual", "title": "Smart iPods", "disjunctive": false, "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"}})); - await shopify.rest.SmartCollection.count({ - session: session, - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = ""; + smart_collection.updated_at = "2023-01-03T12:44:12-05:00"; + smart_collection.title = "Smart iPods"; + smart_collection.handle = "smart-ipods"; + smart_collection.body_html = "

The best selling ipod ever

"; + smart_collection.published_at = "2008-02-01T19:00:00-05:00"; + smart_collection.sort_order = "manual"; + smart_collection.template_suffix = null; + smart_collection.disjunctive = false; + smart_collection.rules = [ + { + "column": "type", + "relation": "equals", + "condition": "Cult Products" + } + ]; + smart_collection.published_scope = "web"; + smart_collection.admin_graphql_api_id = "gid://shopify/Collection/482865238"; + await smart_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-04/smart_collections/count.json', + path: '/admin/api/2022-04/smart_collections/482865238.json', query: '', headers, - data: undefined + data: { "smart_collection": {"image": "", "updated_at": "2023-01-03T12:44:12-05:00", "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2023-01-03T12:44:35-05:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:44:35-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672767875"}}})); - await shopify.rest.SmartCollection.count({ - session: session, - product_id: "632910392", - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L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2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; + await smart_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-04/smart_collections/count.json', - query: 'product_id=632910392', + path: '/admin/api/2022-04/smart_collections/482865238.json', + query: '', headers, - data: undefined + data: { "smart_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVY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4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 2, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2023-01-03T12:43:34-05:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"alt": "Rails logo", "created_at": "2023-01-03T12:43:32-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-iapzkx.gif?v=1672767814"}}})); - await shopify.rest.SmartCollection.find({ - session: session, - id: 482865238, - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "alt": "Rails logo" + }; + await smart_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-04/smart_collections/482865238.json', query: '', headers, - data: undefined + data: { "smart_collection": {"image": {"alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": "2022-10-03T13:15:44-04:00", "updated_at": "2022-10-03T13:15:45-04:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

5000 songs in your pocket

", "title": "Smart iPods", "handle": "smart-ipods", "id": 482865238, "updated_at": "2023-01-03T12:44:20-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); smart_collection.id = 482865238; - smart_collection.published = true; + smart_collection.body_html = "

5000 songs in your pocket

"; await smart_collection.save({}); expect({ @@ -297,137 +280,154 @@ describe('SmartCollection resource', () => { path: '/admin/api/2022-04/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"published": true} } + data: { "smart_collection": {"body_html": "

5000 songs in your pocket

"} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2022-10-03T13:15:58-04:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"alt": "Rails logo", "created_at": "2022-10-03T13:15:53-04:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-m6oibt.gif?v=1664817358"}}})); + queueMockResponse(JSON.stringify({})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.image = { - "alt": "Rails logo" - }; - await smart_collection.save({}); + await shopify.rest.SmartCollection.delete({ + session: session, + id: 482865238, + }); expect({ - method: 'PUT', + method: 'DELETE', domain, path: '/admin/api/2022-04/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"image": {"alt": "Rails logo"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2022-10-03T13:16:15-04:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:16:15-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1664817375"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001315, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:20-05:00", "body_html": null, "published_at": "2023-01-03T12:43:20-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001315", "image": {"created_at": "2023-01-03T12:43:20-05:00", "alt": "iPod", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672767800"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; smart_collection.image = { - "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\n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hRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", - "alt": "Rails logo" + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", + "alt": "iPod" }; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/smart_collections/482865238.json', + path: '/admin/api/2022-04/smart_collections.json', query: '', headers, - data: { "smart_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/P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l/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", "alt": "iPod"}} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

5000 songs in your pocket

", "title": "Smart iPods", "handle": "smart-ipods", "id": 482865238, "updated_at": "2022-10-03T13:16:36-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001314, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:18-05:00", "body_html": null, "published_at": "2023-01-03T12:43:18-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001314", "image": {"created_at": "2023-01-03T12:43:18-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-xezjfo.gif?v=1672767798"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.body_html = "

5000 songs in your pocket

"; + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + smart_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/smart_collections/482865238.json', + path: '/admin/api/2022-04/smart_collections.json', query: '', headers, - data: { "smart_collection": {"body_html": "

5000 songs in your pocket

"} } + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

The best selling ipod ever

", "handle": "smart-ipods", "updated_at": "2022-10-03T13:17:09-04:00", "id": 482865238, "sort_order": "manual", "title": "Smart iPods", "disjunctive": false, "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001313, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:16-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001313"}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.image = ""; - smart_collection.updated_at = "2022-10-03T13:17:08-04:00"; - smart_collection.title = "Smart iPods"; - smart_collection.handle = "smart-ipods"; - smart_collection.body_html = "

The best selling ipod ever

"; - smart_collection.published_at = "2008-02-01T19:00:00-05:00"; - smart_collection.sort_order = "manual"; - smart_collection.template_suffix = null; - smart_collection.disjunctive = false; + smart_collection.title = "Macbooks"; smart_collection.rules = [ { - "column": "type", + "column": "vendor", "relation": "equals", - "condition": "Cult Products" + "condition": "Apple" } ]; - smart_collection.published_scope = "web"; - smart_collection.admin_graphql_api_id = "gid://shopify/Collection/482865238"; + smart_collection.published = false; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/smart_collections/482865238.json', + path: '/admin/api/2022-04/smart_collections.json', query: '', headers, - data: { "smart_collection": {"image": "", "updated_at": "2022-10-03T13:17:08-04:00", "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"} } + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published": false} } }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": null, "updated_at": "2022-10-03T13:17:23-04:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001326, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T12:44:09-05:00", "body_html": null, "published_at": "2023-01-03T12:44:09-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001326"}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.published = false; + smart_collection.title = "IPods"; + smart_collection.rules = [ + { + "column": "title", + "relation": "starts_with", + "condition": "iPod" + } + ]; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/smart_collections/482865238.json', + path: '/admin/api/2022-04/smart_collections.json', query: '', headers, - data: { "smart_collection": {"published": false} } + data: { "smart_collection": {"title": "IPods", "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}]} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001329, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:44:38-05:00", "body_html": null, "published_at": "2023-01-03T12:44:38-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001329"}})); - await shopify.rest.SmartCollection.delete({ - session: session, - id: 482865238, - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + await smart_collection.save({}); expect({ - method: 'DELETE', + method: 'POST', domain, - path: '/admin/api/2022-04/smart_collections/482865238.json', + path: '/admin/api/2022-04/smart_collections.json', query: '', headers, - data: undefined + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}]} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-04/storefront_access_token.test.ts b/rest/admin/__tests__/2022-04/storefront_access_token.test.ts index a93bd6d80..9c30a7620 100644 --- a/rest/admin/__tests__/2022-04/storefront_access_token.test.ts +++ b/rest/admin/__tests__/2022-04/storefront_access_token.test.ts @@ -31,7 +31,7 @@ describe('StorefrontAccessToken resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"storefront_access_token": {"access_token": "45ca0032e77093b648d94244e45fab27", "access_scope": "unauthenticated_read_product_listings", "created_at": "2022-10-03T13:03:45-04:00", "id": 1003303990, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/1003303990", "title": "Test"}})); + queueMockResponse(JSON.stringify({"storefront_access_token": {"access_token": "b3ababb5c68d0062d5619d853abf6efa", "access_scope": "unauthenticated_read_product_listings", "created_at": "2023-01-03T12:44:44-05:00", "id": 1003303990, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/1003303990", "title": "Test"}})); const storefront_access_token = new shopify.rest.StorefrontAccessToken({session: session}); storefront_access_token.title = "Test"; @@ -48,7 +48,7 @@ describe('StorefrontAccessToken resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"storefront_access_tokens": [{"access_token": "378d95641257a4ab3feff967ee234f4d", "access_scope": "unauthenticated_read_product_listings", "created_at": "2022-10-03T12:44:45-04:00", "id": 755357713, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/755357713", "title": "API Client Extension"}]})); + queueMockResponse(JSON.stringify({"storefront_access_tokens": [{"access_token": "378d95641257a4ab3feff967ee234f4d", "access_scope": "unauthenticated_read_product_listings", "created_at": "2023-01-03T12:21:36-05:00", "id": 755357713, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/755357713", "title": "API Client Extension"}]})); await shopify.rest.StorefrontAccessToken.all({ session: session, diff --git a/rest/admin/__tests__/2022-04/tender_transaction.test.ts b/rest/admin/__tests__/2022-04/tender_transaction.test.ts index 1f9579925..b6414042a 100644 --- a/rest/admin/__tests__/2022-04/tender_transaction.test.ts +++ b/rest/admin/__tests__/2022-04/tender_transaction.test.ts @@ -31,107 +31,107 @@ describe('TenderTransaction resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222834, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222852, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222851, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - since_id: "1011222833", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/tender_transactions.json', - query: 'since_id=1011222833', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222835, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222858, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - processed_at_max: "2005-08-06 10:22:51 -0400", + since_id: "1011222857", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/tender_transactions.json', - query: 'processed_at_max=2005-08-06+10%3A22%3A51+-0400', + query: 'since_id=1011222857', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222837, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222855, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222856, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - processed_at_max: "2005-08-05 10:22:51 -0400", + order: "processed_at ASC", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/tender_transactions.json', - query: 'processed_at_max=2005-08-05+10%3A22%3A51+-0400', + query: 'order=processed_at+ASC', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222844, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222843, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222842, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, + processed_at_min: "2005-08-06 10:22:51 -0400", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/tender_transactions.json', - query: '', + query: 'processed_at_min=2005-08-06+10%3A22%3A51+-0400', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222848, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222853, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - processed_at_min: "2005-08-06 10:22:51 -0400", + processed_at_max: "2005-08-06 10:22:51 -0400", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/tender_transactions.json', - query: 'processed_at_min=2005-08-06+10%3A22%3A51+-0400', + query: 'processed_at_max=2005-08-06+10%3A22%3A51+-0400', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222849, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222850, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222843, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - order: "processed_at ASC", + processed_at_max: "2005-08-05 10:22:51 -0400", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/tender_transactions.json', - query: 'order=processed_at+ASC', + query: 'processed_at_max=2005-08-05+10%3A22%3A51+-0400', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-04/theme.test.ts b/rest/admin/__tests__/2022-04/theme.test.ts index 7528b4b2a..ef9cb2c46 100644 --- a/rest/admin/__tests__/2022-04/theme.test.ts +++ b/rest/admin/__tests__/2022-04/theme.test.ts @@ -31,7 +31,7 @@ describe('Theme resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"themes": [{"id": 828155753, "name": "Comfort", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}, {"id": 976877075, "name": "Preview of Parallax", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "demo", "theme_store_id": 688, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/976877075"}, {"id": 752253240, "name": "Sandbox", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}]})); + queueMockResponse(JSON.stringify({"themes": [{"id": 828155753, "name": "Comfort", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}, {"id": 976877075, "name": "Preview of Parallax", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "demo", "theme_store_id": 688, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/976877075"}, {"id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}]})); await shopify.rest.Theme.all({ session: session, @@ -48,7 +48,7 @@ describe('Theme resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"theme": {"id": 1049083723, "name": "Lemongrass", "created_at": "2022-10-03T13:05:00-04:00", "updated_at": "2022-10-03T13:05:00-04:00", "role": "unpublished", "theme_store_id": null, "previewable": false, "processing": true, "admin_graphql_api_id": "gid://shopify/Theme/1049083723"}})); + queueMockResponse(JSON.stringify({"theme": {"id": 1049083723, "name": "Lemongrass", "created_at": "2023-01-03T12:25:57-05:00", "updated_at": "2023-01-03T12:25:57-05:00", "role": "unpublished", "theme_store_id": null, "previewable": false, "processing": true, "admin_graphql_api_id": "gid://shopify/Theme/1049083723"}})); const theme = new shopify.rest.Theme({session: session}); theme.name = "Lemongrass"; @@ -67,7 +67,7 @@ describe('Theme resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"theme": {"id": 828155753, "name": "Comfort", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}})); + queueMockResponse(JSON.stringify({"theme": {"id": 828155753, "name": "Comfort", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}})); await shopify.rest.Theme.find({ session: session, @@ -85,11 +85,11 @@ describe('Theme resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"theme": {"name": "Experimental", "role": "unpublished", "id": 752253240, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:04:50-04:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + queueMockResponse(JSON.stringify({"theme": {"role": "main", "id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:51-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); const theme = new shopify.rest.Theme({session: session}); theme.id = 752253240; - theme.name = "Experimental"; + theme.role = "main"; await theme.save({}); expect({ @@ -98,16 +98,16 @@ describe('Theme resource', () => { path: '/admin/api/2022-04/themes/752253240.json', query: '', headers, - data: { "theme": {"name": "Experimental"} } + data: { "theme": {"role": "main"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"theme": {"role": "main", "id": 752253240, "name": "Sandbox", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:04:59-04:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + queueMockResponse(JSON.stringify({"theme": {"name": "Experimental", "role": "unpublished", "id": 752253240, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:26:01-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); const theme = new shopify.rest.Theme({session: session}); theme.id = 752253240; - theme.role = "main"; + theme.name = "Experimental"; await theme.save({}); expect({ @@ -116,12 +116,12 @@ describe('Theme resource', () => { path: '/admin/api/2022-04/themes/752253240.json', query: '', headers, - data: { "theme": {"role": "main"} } + data: { "theme": {"name": "Experimental"} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"id": 752253240, "name": "Sandbox", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"})); + queueMockResponse(JSON.stringify({"id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"})); await shopify.rest.Theme.delete({ session: session, diff --git a/rest/admin/__tests__/2022-04/transaction.test.ts b/rest/admin/__tests__/2022-04/transaction.test.ts index a0a77a9db..362fd9687 100644 --- a/rest/admin/__tests__/2022-04/transaction.test.ts +++ b/rest/admin/__tests__/2022-04/transaction.test.ts @@ -31,7 +31,7 @@ describe('Transaction resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "c901414060.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}, {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}, {"id": 801038806, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T10:22:51-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2005-08-05T10:22:51-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "250.94", "currency": "USD", "payment_id": "c901414060.2", "admin_graphql_api_id": "gid://shopify/OrderTransaction/801038806"}]})); + queueMockResponse(JSON.stringify({"transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}, {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "#1001.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}, {"id": 801038806, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T10:22:51-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2005-08-05T10:22:51-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "250.94", "currency": "USD", "payment_id": "#1001.2", "admin_graphql_api_id": "gid://shopify/OrderTransaction/801038806"}]})); await shopify.rest.Transaction.all({ session: session, @@ -49,7 +49,7 @@ describe('Transaction resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"transactions": [{"id": 1068278464, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:03-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:03-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278464"}]})); + queueMockResponse(JSON.stringify({"transactions": [{"id": 1068278485, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:26-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:26-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278485"}]})); await shopify.rest.Transaction.all({ session: session, @@ -68,7 +68,7 @@ describe('Transaction resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278467, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:19-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:19-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278467"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278488, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:33-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:33-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278488"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; @@ -89,7 +89,7 @@ describe('Transaction resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278463, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:00-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:00-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278463"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278486, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:29-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:29-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278486"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; @@ -108,7 +108,7 @@ describe('Transaction resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278465, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:07-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:07-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278465"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278484, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:24-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:24-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278484"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; @@ -130,7 +130,7 @@ describe('Transaction resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278466, "order_id": 450789469, "kind": "void", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:11-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:11-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "0.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278466"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278487, "order_id": 450789469, "kind": "void", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:31-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:31-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "0.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278487"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; diff --git a/rest/admin/__tests__/2022-04/usage_charge.test.ts b/rest/admin/__tests__/2022-04/usage_charge.test.ts index 33038ae44..af1429d75 100644 --- a/rest/admin/__tests__/2022-04/usage_charge.test.ts +++ b/rest/admin/__tests__/2022-04/usage_charge.test.ts @@ -31,7 +31,7 @@ describe('UsageCharge resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618208, "description": "Super Mega Plan 1000 emails", "price": "1.00", "created_at": "2022-10-03T12:53:15-04:00", "billing_on": null, "balance_used": 11.0, "balance_remaining": 89.0, "risk_level": 0}})); + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618209, "description": "Super Mega Plan 1000 emails", "price": "1.00", "created_at": "2023-01-03T12:42:12-05:00", "billing_on": null, "balance_used": 11.0, "balance_remaining": 89.0, "risk_level": 0}})); const usage_charge = new shopify.rest.UsageCharge({session: session}); usage_charge.recurring_application_charge_id = 455696195; @@ -50,7 +50,7 @@ describe('UsageCharge resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"usage_charges": [{"id": 1034618206, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2022-10-03T12:53:13-04:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}]})); + queueMockResponse(JSON.stringify({"usage_charges": [{"id": 1034618206, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2023-01-03T12:42:08-05:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}]})); await shopify.rest.UsageCharge.all({ session: session, @@ -68,18 +68,18 @@ describe('UsageCharge resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618210, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2022-10-03T12:53:16-04:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}})); + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618207, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2023-01-03T12:42:10-05:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}})); await shopify.rest.UsageCharge.find({ session: session, recurring_application_charge_id: 455696195, - id: 1034618210, + id: 1034618207, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-04/recurring_application_charges/455696195/usage_charges/1034618210.json', + path: '/admin/api/2022-04/recurring_application_charges/455696195/usage_charges/1034618207.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-04/user.test.ts b/rest/admin/__tests__/2022-04/user.test.ts index afcf1dcca..d5b234ca7 100644 --- a/rest/admin/__tests__/2022-04/user.test.ts +++ b/rest/admin/__tests__/2022-04/user.test.ts @@ -31,7 +31,7 @@ describe('User resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"users": [{"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}, {"id": 930143300, "first_name": "John", "email": "j.limited@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Limited", "account_owner": false, "receive_announcements": 1, "bio": null, "permissions": [], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/930143300", "tfa_enabled?": false}]})); + queueMockResponse(JSON.stringify({"users": [{"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}, {"id": 930143300, "first_name": "John", "email": "j.limited@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Limited", "account_owner": false, "receive_announcements": 1, "bio": null, "permissions": [], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/930143300", "tfa_enabled?": false}]})); await shopify.rest.User.all({ session: session, @@ -48,7 +48,7 @@ describe('User resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); await shopify.rest.User.find({ session: session, @@ -66,7 +66,7 @@ describe('User resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); await shopify.rest.User.current({ session: session, diff --git a/rest/admin/__tests__/2022-04/variant.test.ts b/rest/admin/__tests__/2022-04/variant.test.ts index a6749ab06..5ec417ec8 100644 --- a/rest/admin/__tests__/2022-04/variant.test.ts +++ b/rest/admin/__tests__/2022-04/variant.test.ts @@ -31,220 +31,220 @@ describe('Variant resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); await shopify.rest.Variant.all({ session: session, product_id: 632910392, - since_id: "49148385", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products/632910392/variants.json', - query: 'since_id=49148385', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + queueMockResponse(JSON.stringify({"variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); await shopify.rest.Variant.all({ session: session, product_id: 632910392, - presentment_currencies: "USD,CAD", + since_id: "49148385", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products/632910392/variants.json', - query: 'presentment_currencies=USD%2CCAD', + query: 'since_id=49148385', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); await shopify.rest.Variant.all({ session: session, product_id: 632910392, + presentment_currencies: "USD,CAD", }); expect({ method: 'GET', domain, path: '/admin/api/2022-04/products/632910392/variants.json', - query: '', + query: 'presentment_currencies=USD%2CCAD', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"count": 4})); + queueMockResponse(JSON.stringify({"variant": {"id": 1070325020, "product_id": 632910392, "title": "Yellow", "price": "1.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Yellow", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:18-05:00", "updated_at": "2023-01-03T12:25:18-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325020, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "1.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325020"}})); - await shopify.rest.Variant.count({ - session: session, - product_id: 632910392, - }); + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Yellow"; + variant.price = "1.00"; + await variant.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/products/632910392/variants/count.json', + path: '/admin/api/2022-04/products/632910392/variants.json', query: '', headers, - data: undefined + data: { "variant": {"option1": "Yellow", "price": "1.00"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "tax_code": "DA040000", "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 1070325023, "product_id": 632910392, "title": "Blue", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Blue", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:36-05:00", "updated_at": "2023-01-03T12:25:36-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325023, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325023"}})); - await shopify.rest.Variant.find({ - session: session, - id: 808950810, - }); + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Blue"; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await variant.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-04/variants/808950810.json', + path: '/admin/api/2022-04/products/632910392/variants.json', query: '', headers, - data: undefined + data: { "variant": {"option1": "Blue", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:21-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 1070325022, "product_id": 632910392, "title": "Purple", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Purple", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:32-05:00", "updated_at": "2023-01-03T12:25:32-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": 850703190, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325022, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325022"}})); const variant = new shopify.rest.Variant({session: session}); - variant.id = 808950810; - variant.image_id = 562641783; + variant.product_id = 632910392; + variant.image_id = 850703190; + variant.option1 = "Purple"; await variant.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-04/variants/808950810.json', + path: '/admin/api/2022-04/products/632910392/variants.json', query: '', headers, - data: { "variant": {"image_id": 562641783} } + data: { "variant": {"image_id": 850703190, "option1": "Purple"} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:38-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"count": 4})); - const variant = new shopify.rest.Variant({session: session}); - variant.id = 808950810; - variant.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; - await variant.save({}); + await shopify.rest.Variant.count({ + session: session, + product_id: 632910392, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-04/variants/808950810.json', + path: '/admin/api/2022-04/products/632910392/variants/count.json', query: '', headers, - data: { "variant": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Not Pink", "price": "99.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Not Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:49-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "99.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "tax_code": "DA040000", "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); - const variant = new shopify.rest.Variant({session: session}); - variant.id = 808950810; - variant.option1 = "Not Pink"; - variant.price = "99.00"; - await variant.save({}); + await shopify.rest.Variant.find({ + session: session, + id: 808950810, + }); expect({ - method: 'PUT', + method: 'GET', domain, path: '/admin/api/2022-04/variants/808950810.json', query: '', headers, - data: { "variant": {"option1": "Not Pink", "price": "99.00"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 1070325019, "product_id": 632910392, "title": "Purple", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Purple", "option2": null, "option3": null, "created_at": "2022-10-03T12:50:00-04:00", "updated_at": "2022-10-03T12:50:00-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": 850703190, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325019, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325019"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:13-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); const variant = new shopify.rest.Variant({session: session}); - variant.product_id = 632910392; - variant.image_id = 850703190; - variant.option1 = "Purple"; + variant.id = 808950810; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await variant.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products/632910392/variants.json', + path: '/admin/api/2022-04/variants/808950810.json', query: '', headers, - data: { "variant": {"image_id": 850703190, "option1": "Purple"} } + data: { "variant": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 1070325020, "product_id": 632910392, "title": "Yellow", "price": "1.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Yellow", "option2": null, "option3": null, "created_at": "2022-10-03T12:50:03-04:00", "updated_at": "2022-10-03T12:50:03-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325020, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "1.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325020"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:26-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); const variant = new shopify.rest.Variant({session: session}); - variant.product_id = 632910392; - variant.option1 = "Yellow"; - variant.price = "1.00"; + variant.id = 808950810; + variant.image_id = 562641783; await variant.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products/632910392/variants.json', + path: '/admin/api/2022-04/variants/808950810.json', query: '', headers, - data: { "variant": {"option1": "Yellow", "price": "1.00"} } + data: { "variant": {"image_id": 562641783} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 1070325024, "product_id": 632910392, "title": "Blue", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Blue", "option2": null, "option3": null, "created_at": "2022-10-03T12:50:35-04:00", "updated_at": "2022-10-03T12:50:35-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325024, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325024"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Not Pink", "price": "99.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Not Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:43-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "99.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); const variant = new shopify.rest.Variant({session: session}); - variant.product_id = 632910392; - variant.option1 = "Blue"; - variant.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + variant.id = 808950810; + variant.option1 = "Not Pink"; + variant.price = "99.00"; await variant.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-04/products/632910392/variants.json', + path: '/admin/api/2022-04/variants/808950810.json', query: '', headers, - data: { "variant": {"option1": "Blue", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "variant": {"option1": "Not Pink", "price": "99.00"} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/abandoned_checkout.test.ts b/rest/admin/__tests__/2022-07/abandoned_checkout.test.ts index 302fab1d3..25d2ef1b8 100644 --- a/rest/admin/__tests__/2022-07/abandoned_checkout.test.ts +++ b/rest/admin/__tests__/2022-07/abandoned_checkout.test.ts @@ -31,60 +31,60 @@ describe('AbandonedCheckout resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, + created_at_max: "2013-10-12T07:05:27-02:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/checkouts.json', - query: '', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/checkouts.json', - query: 'status=closed', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - created_at_max: "2013-10-12T07:05:27-02:00", + status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/checkouts.json', - query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + query: 'status=closed', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, @@ -102,53 +102,53 @@ describe('AbandonedCheckout resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/checkouts.json', - query: 'status=closed', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, + created_at_max: "2013-10-12T07:05:27-02:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/checkouts.json', - query: '', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - created_at_max: "2013-10-12T07:05:27-02:00", + status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/checkouts.json', - query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + query: 'status=closed', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-07/apple_pay_certificate.test.ts b/rest/admin/__tests__/2022-07/apple_pay_certificate.test.ts index 28e049594..b034b342d 100644 --- a/rest/admin/__tests__/2022-07/apple_pay_certificate.test.ts +++ b/rest/admin/__tests__/2022-07/apple_pay_certificate.test.ts @@ -31,7 +31,7 @@ describe('ApplePayCertificate resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938274, "status": "issuing", "merchant_id": null}})); + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938276, "status": "issuing", "merchant_id": null}})); const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); @@ -48,17 +48,17 @@ describe('ApplePayCertificate resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938276, "status": "csr", "merchant_id": null}})); + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938274, "status": "csr", "merchant_id": null}})); await shopify.rest.ApplePayCertificate.find({ session: session, - id: 1068938276, + id: 1068938274, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/apple_pay_certificates/1068938276.json', + path: '/admin/api/2022-07/apple_pay_certificates/1068938274.json', query: '', headers, data: undefined @@ -66,10 +66,10 @@ describe('ApplePayCertificate resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938277, "status": "completed", "merchant_id": "merchant.something"}})); + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938275, "status": "completed", "merchant_id": "merchant.something"}})); const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); - apple_pay_certificate.id = 1068938277; + apple_pay_certificate.id = 1068938275; apple_pay_certificate.status = "completed"; apple_pay_certificate.merchant_id = "merchant.something"; apple_pay_certificate.encoded_signed_certificate = "MIIEZzCCBA6gAwIBAgIIWGMideLkDJAwCgYIKoZIzj0EAwIwgYAxNDAyBgNV\nBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0g\nRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMw\nEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNDEyMDgyMTMy\nMDBaFw0xNzAxMDYyMTMyMDBaMIGZMSowKAYKCZImiZPyLGQBAQwabWVyY2hh\nbnQuY29t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REREOTI5NTE4RjVGMDdBQUM4NzdDMzRCQjM3\nODFCQTg2MzkyNjIwCgYIKoZIzj0EAwIDRwAwRAIgZ/oNx0gCc/PM4pYhOWL2\nCecFQrIgzHr/fZd8qcy3Be8CIEQCaAPpmvQrXEX0hFexoYMHtOHY9dgN2D8L\nNKpVyn3t\n"; @@ -78,7 +78,7 @@ describe('ApplePayCertificate resource', () => { expect({ method: 'PUT', domain, - path: '/admin/api/2022-07/apple_pay_certificates/1068938277.json', + path: '/admin/api/2022-07/apple_pay_certificates/1068938275.json', query: '', headers, data: { "apple_pay_certificate": {"status": "completed", "merchant_id": "merchant.something", "encoded_signed_certificate": "MIIEZzCCBA6gAwIBAgIIWGMideLkDJAwCgYIKoZIzj0EAwIwgYAxNDAyBgNV\nBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0g\nRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMw\nEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNDEyMDgyMTMy\nMDBaFw0xNzAxMDYyMTMyMDBaMIGZMSowKAYKCZImiZPyLGQBAQwabWVyY2hh\nbnQuY29tLm5vcm1vcmUuamFzb24xMDAuBgNVBAMMJ01lcmNoYW50IElEOiBt\nZXJjaGFudC5jb20ubm9ybW9yZS5qYXNvbjETMBEGA1UECwwKNVVZMzJOTE5O\nOTEXMBUGA1UECgwOSm9zaHVhIFRlc3NpZXIxCzAJBgNVBAYTAkNBMFkwEwYH\nKoZIzj0CAQYIKoZIzj0DAQcDQgAEAxDDCvzG6MnsZSJOtbr0hr3MRq+4HzTZ\nx8J4FD34E3kU5CallEnZLBmnzfqmjP8644SO28LLJxvWBnrg7lHFtaOCAlUw\nggJRMEcGCCsGAQUFBwEBBDswOTA3BggrBgEFBQcwAYYraHR0cDovL29jc3Au\nYXBwbGUuY29tL29jc3AwNC1hcHBsZXd3ZHJjYTIwMTAdBgNVHQ4EFgQUkPsO\nKEKvhL/takKomy5GWXtCd8wwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBSE\ntoTMOoZichZZlOgao71I3zrfCzCCAR0GA1UdIASCARQwggEQMIIBDAYJKoZI\nhvdjZAUBMIH+MIHDBggrBgEFBQcCAjCBtgyBs1JlbGlhbmNlIG9uIHRoaXMg\nY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0YW5jZSBv\nZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBjb25k\naXRpb25zIG9mIHVzZSwgY2VydGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZp\nY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDYGCCsGAQUFBwIBFipodHRw\nOi8vd3d3LmFwcGxlLmNvbS9jZXJ0aWZpY2F0ZWF1dGhvcml0eS8wNgYDVR0f\nBC8wLTAroCmgJ4YlaHR0cDovL2NybC5hcHBsZS5jb20vYXBwbGV3d2RyY2Ey\nLmNybDAOBgNVHQ8BAf8EBAMCAygwTwYJKoZIhvdjZAYgBEIMQDM0NTBBMjhB\nOTlGRjIyRkI5OTdDRERFODU1REREOTI5NTE4RjVGMDdBQUM4NzdDMzRCQjM3\nODFCQTg2MzkyNjIwCgYIKoZIzj0EAwIDRwAwRAIgZ/oNx0gCc/PM4pYhOWL2\nCecFQrIgzHr/fZd8qcy3Be8CIEQCaAPpmvQrXEX0hFexoYMHtOHY9dgN2D8L\nNKpVyn3t\n"} } @@ -90,13 +90,13 @@ describe('ApplePayCertificate resource', () => { await shopify.rest.ApplePayCertificate.delete({ session: session, - id: 1068938278, + id: 1068938277, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/apple_pay_certificates/1068938278.json', + path: '/admin/api/2022-07/apple_pay_certificates/1068938277.json', query: '', headers, data: undefined @@ -108,13 +108,13 @@ describe('ApplePayCertificate resource', () => { await shopify.rest.ApplePayCertificate.csr({ session: session, - id: 1068938275, + id: 1068938278, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/apple_pay_certificates/1068938275/csr.json', + path: '/admin/api/2022-07/apple_pay_certificates/1068938278/csr.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/application_charge.test.ts b/rest/admin/__tests__/2022-07/application_charge.test.ts index dd3992f21..a4461d31c 100644 --- a/rest/admin/__tests__/2022-07/application_charge.test.ts +++ b/rest/admin/__tests__/2022-07/application_charge.test.ts @@ -31,7 +31,7 @@ describe('ApplicationCharge resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262347, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": true, "created_at": "2022-10-03T12:20:20-04:00", "updated_at": "2022-10-03T12:20:20-04:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262347", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262347/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBAsxojw6EmF1dG9fYWN0aXZhdGVU--997306f5eeeafb34d59f4272303af853c6aa28da"}})); + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262349, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": true, "created_at": "2023-01-03T13:03:09-05:00", "updated_at": "2023-01-03T13:03:09-05:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262349", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262349/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA0xojw6EmF1dG9fYWN0aXZhdGVU--ea73480c6bd64f4002e70c5f128c1623aaa7991e"}})); const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; @@ -51,7 +51,7 @@ describe('ApplicationCharge resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262350, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": null, "created_at": "2022-10-03T12:20:27-04:00", "updated_at": "2022-10-03T12:20:27-04:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262350", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262350/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA4xojw6EmF1dG9fYWN0aXZhdGVU--ac057c7548ab2cf6b733606771fc47a03238e4ed"}})); + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262351, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": null, "created_at": "2023-01-03T13:03:15-05:00", "updated_at": "2023-01-03T13:03:15-05:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262351", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262351/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA8xojw6EmF1dG9fYWN0aXZhdGVU--9dad4a7611bec2f70cd0db8cc9157e15360188f0"}})); const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; @@ -70,17 +70,16 @@ describe('ApplicationCharge resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"application_charge": {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}})); + queueMockResponse(JSON.stringify({"application_charges": [{"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}, {"id": 556467234, "name": "Green theme", "api_client_id": 755357713, "price": "120.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "theme", "decorated_return_url": "http://google.com?charge_id=556467234"}, {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}]})); - await shopify.rest.ApplicationCharge.find({ + await shopify.rest.ApplicationCharge.all({ session: session, - id: 675931192, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/application_charges/675931192.json', + path: '/admin/api/2022-07/application_charges.json', query: '', headers, data: undefined @@ -88,7 +87,7 @@ describe('ApplicationCharge resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"application_charges": [{"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}, {"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}]})); + queueMockResponse(JSON.stringify({"application_charges": [{"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}, {"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}]})); await shopify.rest.ApplicationCharge.all({ session: session, @@ -106,16 +105,17 @@ describe('ApplicationCharge resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"application_charges": [{"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}, {"id": 556467234, "name": "Green theme", "api_client_id": 755357713, "price": "120.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": "theme", "decorated_return_url": "http://google.com?charge_id=556467234"}, {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}]})); + queueMockResponse(JSON.stringify({"application_charge": {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}})); - await shopify.rest.ApplicationCharge.all({ + await shopify.rest.ApplicationCharge.find({ session: session, + id: 675931192, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/application_charges.json', + path: '/admin/api/2022-07/application_charges/675931192.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/application_credit.test.ts b/rest/admin/__tests__/2022-07/application_credit.test.ts index ccca84759..7e3b41169 100644 --- a/rest/admin/__tests__/2022-07/application_credit.test.ts +++ b/rest/admin/__tests__/2022-07/application_credit.test.ts @@ -31,12 +31,11 @@ describe('ApplicationCredit resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636125, "amount": "5.00", "description": "application credit for refund", "test": true}})); + queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636125, "amount": "5.00", "description": "application credit for refund", "test": null}})); const application_credit = new shopify.rest.ApplicationCredit({session: session}); application_credit.description = "application credit for refund"; application_credit.amount = 5.0; - application_credit.test = true; await application_credit.save({}); expect({ @@ -45,16 +44,17 @@ describe('ApplicationCredit resource', () => { path: '/admin/api/2022-07/application_credits.json', query: '', headers, - data: { "application_credit": {"description": "application credit for refund", "amount": 5.0, "test": true} } + data: { "application_credit": {"description": "application credit for refund", "amount": 5.0} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636127, "amount": "5.00", "description": "application credit for refund", "test": null}})); + queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636129, "amount": "5.00", "description": "application credit for refund", "test": true}})); const application_credit = new shopify.rest.ApplicationCredit({session: session}); application_credit.description = "application credit for refund"; application_credit.amount = 5.0; + application_credit.test = true; await application_credit.save({}); expect({ @@ -63,7 +63,7 @@ describe('ApplicationCredit resource', () => { path: '/admin/api/2022-07/application_credits.json', query: '', headers, - data: { "application_credit": {"description": "application credit for refund", "amount": 5.0} } + data: { "application_credit": {"description": "application credit for refund", "amount": 5.0, "test": true} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/article.test.ts b/rest/admin/__tests__/2022-07/article.test.ts index 758b04ed9..82e37b5f3 100644 --- a/rest/admin/__tests__/2022-07/article.test.ts +++ b/rest/admin/__tests__/2022-07/article.test.ts @@ -31,194 +31,206 @@ describe('Article resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"articles": [{"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}]})); + queueMockResponse(JSON.stringify({"articles": [{"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}]})); await shopify.rest.Article.all({ session: session, blog_id: 241253187, - since_id: "134645308", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/blogs/241253187/articles.json', - query: 'since_id=134645308', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"articles": [{"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}]})); + queueMockResponse(JSON.stringify({"articles": [{"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}]})); await shopify.rest.Article.all({ session: session, blog_id: 241253187, + since_id: "134645308", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/blogs/241253187/articles.json', - query: '', + query: 'since_id=134645308', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"count": 4})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293785, "title": "My new Article title", "created_at": "2023-01-03T12:47:34-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:34-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293785"}})); - await shopify.rest.Article.count({ - session: session, - blog_id: 241253187, - }); + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + await article.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/blogs/241253187/articles/count.json', + path: '/admin/api/2022-07/blogs/241253187/articles.json', query: '', headers, - data: undefined + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293781, "title": "My new Article title", "created_at": "2023-01-03T12:47:18-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:18-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293781", "image": {"created_at": "2023-01-03T12:47:18-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768038"}}})); - await shopify.rest.Article.find({ - session: session, - blog_id: 241253187, - id: 134645308, - }); + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + }; + await article.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-07/blogs/241253187/articles.json', query: '', headers, - data: undefined + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "user_id": null, "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "updated_at": "2022-10-03T12:46:51-04:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293786, "title": "My new Article title", "created_at": "2023-01-03T12:47:51-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:52-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293786"}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.id = 134645308; - article.title = "My new Title"; - article.author = "Your name"; - article.tags = "Tags, Will Be, Updated"; - article.body_html = "

Look, I can even update through a web service.

"; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await article.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-07/blogs/241253187/articles.json', query: '', headers, - data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "updated_at": "2022-10-03T12:47:19-04:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:47:18-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20221003-23488-6gc29.gif?v=1664815639"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293788, "title": "My new Article title", "created_at": "2023-01-03T12:48:03-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:48:04-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293788", "image": {"created_at": "2023-01-03T12:48:03-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20230103-54493-87k83g.gif?v=1672768084"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.id = 134645308; - article.title = "My new Title"; - article.author = "Your name"; - article.tags = "Tags, Will Be, Updated"; - article.body_html = "

Look, I can even update through a web service.

"; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; article.image = { + "src": "http://example.com/rails_logo.gif", "alt": "Rails logo" }; await article.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-07/blogs/241253187/articles.json', query: '', headers, - data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"alt": "Rails logo"}} } + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": "2022-10-03T12:47:23-04:00", "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2022-10-03T12:47:23-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293784, "title": "My new Article title", "created_at": "2023-01-03T12:47:30-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": null, "updated_at": "2023-01-03T12:47:30-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293784"}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.id = 134645308; - article.published = true; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published = false; await article.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-07/blogs/241253187/articles.json', query: '', headers, - data: { "article": {"published": true} } + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published": false} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "updated_at": "2022-10-03T12:48:10-04:00", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:48:10-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1664815690"}}})); + queueMockResponse(JSON.stringify({"count": 4})); - const article = new shopify.rest.Article({session: session}); - article.blog_id = 241253187; - article.id = 134645308; - article.title = "My new Title"; - article.author = "Your name"; - article.tags = "Tags, Will Be, Updated"; - article.body_html = "

Look, I can even update through a web service.

"; - article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - article.image = { - "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09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DK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n" - }; - await article.save({}); + await shopify.rest.Article.count({ + session: session, + blog_id: 241253187, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-07/blogs/241253187/articles/count.json', query: '', headers, - data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcU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3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": null, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2022-10-03T12:48:53-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); - const article = new shopify.rest.Article({session: session}); - article.blog_id = 241253187; - article.id = 134645308; - article.published = false; - await article.save({}); + await shopify.rest.Article.find({ + session: session, + blog_id: 241253187, + id: 134645308, + }); expect({ - method: 'PUT', + method: 'GET', domain, path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2022-10-03T12:48:56-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2023-01-03T12:48:00-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; @@ -244,12 +256,12 @@ describe('Article resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "updated_at": "2022-10-03T12:49:00-04:00", "id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308"}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": null, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2023-01-03T12:48:14-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; article.id = 134645308; - article.image = ""; + article.published = false; await article.save({}); expect({ @@ -258,151 +270,139 @@ describe('Article resource', () => { path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"image": ""} } + data: { "article": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": "2023-01-03T12:47:11-05:00", "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2023-01-03T12:47:11-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); - await shopify.rest.Article.delete({ - session: session, - blog_id: 241253187, - id: 134645308, - }); + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.published = true; + await article.save({}); expect({ - method: 'DELETE', + method: 'PUT', domain, path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', query: '', headers, - data: undefined + data: { "article": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293784, "title": "My new Article title", "created_at": "2022-10-03T12:47:52-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:47:52-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293784", "image": {"created_at": "2022-10-03T12:47:52-04:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664815672"}}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "updated_at": "2023-01-03T12:47:43-05:00", "id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308"}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; - article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - article.image = { - "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" - }; + article.id = 134645308; + article.image = ""; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/blogs/241253187/articles.json', + path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}} } + data: { "article": {"image": ""} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293786, "title": "My new Article title", "created_at": "2022-10-03T12:48:37-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:48:37-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293786"}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "updated_at": "2023-01-03T12:48:33-05:00", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:48:33-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672768113"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - article.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + article.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIj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G1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n" + }; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/blogs/241253187/articles.json', + path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8Bf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3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"}} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293787, "title": "My new Article title", "created_at": "2022-10-03T12:48:40-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": null, "updated_at": "2022-10-03T12:48:40-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293787"}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "user_id": null, "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "updated_at": "2023-01-03T12:47:47-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; - article.published = false; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/blogs/241253187/articles.json', + path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published": false} } + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293788, "title": "My new Article title", "created_at": "2022-10-03T12:48:48-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:48:49-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293788", "image": {"created_at": "2022-10-03T12:48:49-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20221003-23488-ryyw9l.gif?v=1664815729"}}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "updated_at": "2023-01-03T12:48:40-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:48:40-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20230103-54493-qvpb1u.gif?v=1672768120"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; article.image = { - "src": "http://example.com/rails_logo.gif", "alt": "Rails logo" }; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/blogs/241253187/articles.json', + path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails logo"}} } + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293792, "title": "My new Article title", "created_at": "2022-10-03T12:49:40-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:49:40-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293792"}})); + queueMockResponse(JSON.stringify({})); - const article = new shopify.rest.Article({session: session}); - article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; - article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - await article.save({}); + await shopify.rest.Article.delete({ + session: session, + blog_id: 241253187, + id: 134645308, + }); expect({ - method: 'POST', + method: 'DELETE', domain, - path: '/admin/api/2022-07/blogs/241253187/articles.json', + path: '/admin/api/2022-07/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + data: undefined }).toMatchMadeHttpRequest(); }); @@ -424,74 +424,74 @@ describe('Article resource', () => { }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); await shopify.rest.Article.tags({ session: session, - limit: "1", - popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/articles/tags.json', - query: 'limit=1&popular=1', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); await shopify.rest.Article.tags({ session: session, + limit: "1", + popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/articles/tags.json', - query: '', + query: 'limit=1&popular=1', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); await shopify.rest.Article.tags({ session: session, blog_id: 241253187, - limit: "1", - popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/blogs/241253187/articles/tags.json', - query: 'limit=1&popular=1', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); await shopify.rest.Article.tags({ session: session, blog_id: 241253187, + limit: "1", + popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/blogs/241253187/articles/tags.json', - query: '', + query: 'limit=1&popular=1', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-07/asset.test.ts b/rest/admin/__tests__/2022-07/asset.test.ts index ed989eb49..18a809a24 100644 --- a/rest/admin/__tests__/2022-07/asset.test.ts +++ b/rest/admin/__tests__/2022-07/asset.test.ts @@ -49,12 +49,12 @@ describe('Asset resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "layout/alternate.liquid", "public_url": null, "created_at": "2022-10-03T13:22:25-04:00", "updated_at": "2022-10-03T13:22:25-04:00", "content_type": "application/x-liquid", "size": 3049, "checksum": "1879a06996941b2ff1ff485a1fe60a97", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2023-01-03T12:39:59-05:00", "content_type": "application/x-liquid", "size": 110, "checksum": "cd71db2e14df976c8aa44b44c8dae77b", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; - asset.key = "layout/alternate.liquid"; - asset.source_key = "layout/theme.liquid"; + asset.key = "templates/index.liquid"; + asset.value = "

We are busy updating the store for you and will be back within the hour.

"; await asset.save({}); expect({ @@ -63,12 +63,12 @@ describe('Asset resource', () => { path: '/admin/api/2022-07/themes/828155753/assets.json', query: '', headers, - data: { "asset": {"key": "layout/alternate.liquid", "source_key": "layout/theme.liquid"} } + data: { "asset": {"key": "templates/index.liquid", "value": "

We are busy updating the store for you and will be back within the hour.

"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "assets/empty.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/empty.gif?v=1664817747", "created_at": "2022-10-03T13:22:27-04:00", "updated_at": "2022-10-03T13:22:27-04:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "assets/empty.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/empty.gif?v=1672767606", "created_at": "2023-01-03T12:40:06-05:00", "updated_at": "2023-01-03T12:40:06-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; @@ -87,12 +87,12 @@ describe('Asset resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2022-10-03T13:22:28-04:00", "content_type": "application/x-liquid", "size": 110, "checksum": "cd71db2e14df976c8aa44b44c8dae77b", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1672767597", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2023-01-03T12:39:57-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; - asset.key = "templates/index.liquid"; - asset.value = "

We are busy updating the store for you and will be back within the hour.

"; + asset.key = "assets/bg-body.gif"; + asset.src = "http://example.com/new_bg.gif"; await asset.save({}); expect({ @@ -101,17 +101,17 @@ describe('Asset resource', () => { path: '/admin/api/2022-07/themes/828155753/assets.json', query: '', headers, - data: { "asset": {"key": "templates/index.liquid", "value": "

We are busy updating the store for you and will be back within the hour.

"} } + data: { "asset": {"key": "assets/bg-body.gif", "src": "http://example.com/new_bg.gif"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1664817751", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2022-10-03T13:22:31-04:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "layout/alternate.liquid", "public_url": null, "created_at": "2023-01-03T12:40:04-05:00", "updated_at": "2023-01-03T12:40:04-05:00", "content_type": "application/x-liquid", "size": 3049, "checksum": "1879a06996941b2ff1ff485a1fe60a97", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; - asset.key = "assets/bg-body.gif"; - asset.src = "http://example.com/new_bg.gif"; + asset.key = "layout/alternate.liquid"; + asset.source_key = "layout/theme.liquid"; await asset.save({}); expect({ @@ -120,7 +120,7 @@ describe('Asset resource', () => { path: '/admin/api/2022-07/themes/828155753/assets.json', query: '', headers, - data: { "asset": {"key": "assets/bg-body.gif", "src": "http://example.com/new_bg.gif"} } + data: { "asset": {"key": "layout/alternate.liquid", "source_key": "layout/theme.liquid"} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/assigned_fulfillment_order.test.ts b/rest/admin/__tests__/2022-07/assigned_fulfillment_order.test.ts index 5e1e6ea23..cc422de2c 100644 --- a/rest/admin/__tests__/2022-07/assigned_fulfillment_order.test.ts +++ b/rest/admin/__tests__/2022-07/assigned_fulfillment_order.test.ts @@ -31,7 +31,7 @@ describe('AssignedFulfillmentOrder resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000777, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000777, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737481, "shop_id": 548380009, "fulfillment_order_id": 1046000777, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}}]})); + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000830, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000821, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737568, "shop_id": 548380009, "fulfillment_order_id": 1046000830, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}}]})); await shopify.rest.AssignedFulfillmentOrder.all({ session: session, diff --git a/rest/admin/__tests__/2022-07/blog.test.ts b/rest/admin/__tests__/2022-07/blog.test.ts index cf50e9608..9e1269d6b 100644 --- a/rest/admin/__tests__/2022-07/blog.test.ts +++ b/rest/admin/__tests__/2022-07/blog.test.ts @@ -31,7 +31,7 @@ describe('Blog resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}]})); + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}]})); await shopify.rest.Blog.all({ session: session, @@ -48,7 +48,7 @@ describe('Blog resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 1008414250, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2022-10-11T13:03:48-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:48-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414250"}]})); + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 1008414253, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:27-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:27-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414253"}]})); await shopify.rest.Blog.all({ session: session, @@ -66,18 +66,10 @@ describe('Blog resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 1008414248, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2022-10-11T13:03:41-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:41-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414248"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 1008414251, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:18-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:18-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414251"}})); const blog = new shopify.rest.Blog({session: session}); blog.title = "Apple main blog"; - blog.metafields = [ - { - "key": "sponsor", - "value": "Shopify", - "type": "single_line_text_field", - "namespace": "global" - } - ]; await blog.save({}); expect({ @@ -86,15 +78,23 @@ describe('Blog resource', () => { path: '/admin/api/2022-07/blogs.json', query: '', headers, - data: { "blog": {"title": "Apple main blog", "metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "blog": {"title": "Apple main blog"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 1008414253, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2022-10-11T13:04:01-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:04:01-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414253"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 1008414254, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:35-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:34-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414254"}})); const blog = new shopify.rest.Blog({session: session}); blog.title = "Apple main blog"; + blog.metafields = [ + { + "key": "sponsor", + "value": "Shopify", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await blog.save({}); expect({ @@ -103,7 +103,7 @@ describe('Blog resource', () => { path: '/admin/api/2022-07/blogs.json', query: '', headers, - data: { "blog": {"title": "Apple main blog"} } + data: { "blog": {"title": "Apple main blog", "metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); @@ -125,44 +125,44 @@ describe('Blog resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "title": "Mah Blog"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); await shopify.rest.Blog.find({ session: session, id: 241253187, - fields: "id,title", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/blogs/241253187.json', - query: 'fields=id%2Ctitle', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "title": "Mah Blog"}})); await shopify.rest.Blog.find({ session: session, id: 241253187, + fields: "id,title", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/blogs/241253187.json', - query: '', + query: 'fields=id%2Ctitle', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"blog": {"title": "Mah Blog", "handle": "apple-blog", "id": 241253187, "updated_at": "2022-10-11T13:03:39-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"title": "Mah Blog", "handle": "apple-blog", "id": 241253187, "updated_at": "2023-01-03T12:45:58-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); const blog = new shopify.rest.Blog({session: session}); blog.id = 241253187; @@ -187,7 +187,7 @@ describe('Blog resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "apple-blog", "id": 241253187, "updated_at": "2022-10-11T13:03:45-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "apple-blog", "id": 241253187, "updated_at": "2023-01-03T12:46:23-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); const blog = new shopify.rest.Blog({session: session}); blog.id = 241253187; @@ -205,7 +205,7 @@ describe('Blog resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate", "id": 241253187, "updated_at": "2022-10-11T13:03:46-04:00", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate", "id": 241253187, "updated_at": "2023-01-03T12:46:11-05:00", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); const blog = new shopify.rest.Blog({session: session}); blog.id = 241253187; diff --git a/rest/admin/__tests__/2022-07/cancellation_request.test.ts b/rest/admin/__tests__/2022-07/cancellation_request.test.ts index a679c003a..b0439f911 100644 --- a/rest/admin/__tests__/2022-07/cancellation_request.test.ts +++ b/rest/admin/__tests__/2022-07/cancellation_request.test.ts @@ -31,17 +31,17 @@ describe('CancellationRequest resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000778, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000778, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737482, "shop_id": 548380009, "fulfillment_order_id": 1046000778, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000808, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737539, "shop_id": 548380009, "fulfillment_order_id": 1046000808, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const cancellation_request = new shopify.rest.CancellationRequest({session: session}); - cancellation_request.fulfillment_order_id = 1046000778; + cancellation_request.fulfillment_order_id = 1046000808; cancellation_request.message = "The customer changed his mind."; await cancellation_request.save({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000778/cancellation_request.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000808/cancellation_request.json', query: '', headers, data: { "cancellation_request": {"message": "The customer changed his mind."} } @@ -49,10 +49,10 @@ describe('CancellationRequest resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000779, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_accepted", "status": "cancelled", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000779, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737483, "shop_id": 548380009, "fulfillment_order_id": 1046000779, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000806, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_accepted", "status": "cancelled", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000798, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737537, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const cancellation_request = new shopify.rest.CancellationRequest({session: session}); - cancellation_request.fulfillment_order_id = 1046000779; + cancellation_request.fulfillment_order_id = 1046000806; await cancellation_request.accept({ body: {"cancellation_request": {"message": "We had not started any processing yet."}}, }); @@ -60,7 +60,7 @@ describe('CancellationRequest resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000779/cancellation_request/accept.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000806/cancellation_request/accept.json', query: '', headers, data: { "cancellation_request": {"message": "We had not started any processing yet."} } @@ -68,10 +68,10 @@ describe('CancellationRequest resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000780, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_rejected", "status": "in_progress", "supported_actions": [], "destination": {"id": 1046000780, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737484, "shop_id": 548380009, "fulfillment_order_id": 1046000780, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000807, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_rejected", "status": "in_progress", "supported_actions": [], "destination": {"id": 1046000799, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737538, "shop_id": 548380009, "fulfillment_order_id": 1046000807, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const cancellation_request = new shopify.rest.CancellationRequest({session: session}); - cancellation_request.fulfillment_order_id = 1046000780; + cancellation_request.fulfillment_order_id = 1046000807; await cancellation_request.reject({ body: {"cancellation_request": {"message": "We have already send the shipment out."}}, }); @@ -79,7 +79,7 @@ describe('CancellationRequest resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000780/cancellation_request/reject.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000807/cancellation_request/reject.json', query: '', headers, data: { "cancellation_request": {"message": "We have already send the shipment out."} } diff --git a/rest/admin/__tests__/2022-07/carrier_service.test.ts b/rest/admin/__tests__/2022-07/carrier_service.test.ts index f0125d2ce..51610f100 100644 --- a/rest/admin/__tests__/2022-07/carrier_service.test.ts +++ b/rest/admin/__tests__/2022-07/carrier_service.test.ts @@ -31,7 +31,7 @@ describe('CarrierService resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"carrier_service": {"id": 1067451814, "name": "Shipping Rate Provider", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451814", "format": "json", "callback_url": "http://shipping.example.com/"}})); + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894957, "name": "Shipping Rate Provider", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894957", "format": "json", "callback_url": "http://shipping.example.com/"}})); const carrier_service = new shopify.rest.CarrierService({session: session}); carrier_service.name = "Shipping Rate Provider"; @@ -50,7 +50,7 @@ describe('CarrierService resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"carrier_services": [{"id": 1067451817, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451817", "format": "json", "callback_url": "http://example.com/"}, {"id": 260046840, "name": "ups_shipping", "active": true, "service_discovery": true, "carrier_service_type": "legacy", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/260046840"}]})); + queueMockResponse(JSON.stringify({"carrier_services": [{"id": 1036894958, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894958", "format": "json", "callback_url": "http://example.com/"}, {"id": 260046840, "name": "ups_shipping", "active": true, "service_discovery": true, "carrier_service_type": "legacy", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/260046840"}]})); await shopify.rest.CarrierService.all({ session: session, @@ -67,10 +67,10 @@ describe('CarrierService resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"carrier_service": {"active": false, "id": 1067451815, "name": "Some new name", "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451815", "format": "json", "callback_url": "http://example.com/"}})); + queueMockResponse(JSON.stringify({"carrier_service": {"active": false, "id": 1036894955, "name": "Some new name", "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894955", "format": "json", "callback_url": "http://example.com/"}})); const carrier_service = new shopify.rest.CarrierService({session: session}); - carrier_service.id = 1067451815; + carrier_service.id = 1036894955; carrier_service.name = "Some new name"; carrier_service.active = false; await carrier_service.save({}); @@ -78,7 +78,7 @@ describe('CarrierService resource', () => { expect({ method: 'PUT', domain, - path: '/admin/api/2022-07/carrier_services/1067451815.json', + path: '/admin/api/2022-07/carrier_services/1036894955.json', query: '', headers, data: { "carrier_service": {"name": "Some new name", "active": false} } @@ -86,17 +86,17 @@ describe('CarrierService resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"carrier_service": {"id": 1067451816, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451816", "format": "json", "callback_url": "http://example.com/"}})); + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894954, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894954", "format": "json", "callback_url": "http://example.com/"}})); await shopify.rest.CarrierService.find({ session: session, - id: 1067451816, + id: 1036894954, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/carrier_services/1067451816.json', + path: '/admin/api/2022-07/carrier_services/1036894954.json', query: '', headers, data: undefined @@ -108,13 +108,13 @@ describe('CarrierService resource', () => { await shopify.rest.CarrierService.delete({ session: session, - id: 1067451812, + id: 1036894959, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/carrier_services/1067451812.json', + path: '/admin/api/2022-07/carrier_services/1036894959.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/checkout.test.ts b/rest/admin/__tests__/2022-07/checkout.test.ts index 345afbc20..665180d56 100644 --- a/rest/admin/__tests__/2022-07/checkout.test.ts +++ b/rest/admin/__tests__/2022-07/checkout.test.ts @@ -31,10 +31,15 @@ describe('Checkout resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2022-10-03T12:24:56-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339458, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "me@example.com", "legal_notice_url": null, "location_id": null, "name": "#1066348319", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "8fa96ad154739bb205a00fab92a6cbb4", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2022-10-03T12:24:56-04:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/8fa96ad154739bb205a00fab92a6cbb4", "total_duties": null, "total_additional_fees": null, "line_items": [], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2023-01-03T12:41:32-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": null, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": null, "legal_notice_url": null, "location_id": null, "name": "#1066348317", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "995.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "995.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "c3b86d7cdfaf5a4d1bf89efbbe88789e", "total_price": "995.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "995.00", "updated_at": "2023-01-03T12:41:32-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/c3b86d7cdfaf5a4d1bf89efbbe88789e", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "e8a51fbe23cff8fcad2766f024a761d6", "key": "e8a51fbe23cff8fcad2766f024a761d6", "product_id": 632910392, "variant_id": 39072856, "sku": "IPOD2008GREEN", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Green", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "995.00", "properties": {}, "quantity": 5, "grams": 567, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); - checkout.email = "me@example.com"; + checkout.line_items = [ + { + "variant_id": 39072856, + "quantity": 5 + } + ]; await checkout.save({}); expect({ @@ -43,20 +48,15 @@ describe('Checkout resource', () => { path: '/admin/api/2022-07/checkouts.json', query: '', headers, - data: { "checkout": {"email": "me@example.com"} } + data: { "checkout": {"line_items": [{"variant_id": 39072856, "quantity": 5}]} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2022-10-03T12:25:20-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": null, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": null, "legal_notice_url": null, "location_id": null, "name": "#1066348320", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "995.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "995.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "d0c540d493f50196bbdf010794a53b9d", "total_price": "995.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "995.00", "updated_at": "2022-10-03T12:25:20-04:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/d0c540d493f50196bbdf010794a53b9d", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "4b03a6477a2646f2bef85f95822a6615", "key": "4b03a6477a2646f2bef85f95822a6615", "product_id": 632910392, "variant_id": 39072856, "sku": "IPOD2008GREEN", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Green", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "995.00", "properties": {}, "quantity": 5, "grams": 567, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2023-01-03T12:41:50-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339479, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "me@example.com", "legal_notice_url": null, "location_id": null, "name": "#1066348318", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "8a8043ef00104a4738ba3a235cd2441b", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2023-01-03T12:41:50-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/8a8043ef00104a4738ba3a235cd2441b", "total_duties": null, "total_additional_fees": null, "line_items": [], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); - checkout.line_items = [ - { - "variant_id": 39072856, - "quantity": 5 - } - ]; + checkout.email = "me@example.com"; await checkout.save({}); expect({ @@ -65,12 +65,12 @@ describe('Checkout resource', () => { path: '/admin/api/2022-07/checkouts.json', query: '', headers, - data: { "checkout": {"line_items": [{"variant_id": 39072856, "quantity": 5}]} } + data: { "checkout": {"email": "me@example.com"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#86568385", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "b490a9220cd14d7344024f4874f640a6", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2022-10-03T12:25:25-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/b490a9220cd14d7344024f4874f640a6", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": 49148385, "key": 49148385, "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": false, "gift_card": false, "price": "0.00", "compare_at_price": null, "line_price": "0.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#86568385", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "b490a9220cd14d7344024f4874f640a6", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2023-01-03T12:41:10-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/b490a9220cd14d7344024f4874f640a6", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": 49148385, "key": 49148385, "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": false, "gift_card": false, "price": "0.00", "compare_at_price": null, "line_price": "0.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); checkout.token = "b490a9220cd14d7344024f4874f640a6"; @@ -87,7 +87,7 @@ describe('Checkout resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": "2005-07-31T11:57:11-04:00", "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#901414060", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": 450789469, "order_status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you", "order": {"id": 450789469, "name": "#1001", "status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you"}, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": "2005-07-31T11:57:11-04:00", "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#901414060", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": 450789469, "order_status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you", "order": {"id": 450789469, "name": "#1001", "status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you"}, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); await shopify.rest.Checkout.find({ session: session, @@ -105,17 +105,17 @@ describe('Checkout resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); await shopify.rest.Checkout.find({ session: session, - token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + token: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', + path: '/admin/api/2022-07/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x.json', query: '', headers, data: undefined @@ -123,17 +123,17 @@ describe('Checkout resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); await shopify.rest.Checkout.find({ session: session, - token: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x.json', + path: '/admin/api/2022-07/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', query: '', headers, data: undefined @@ -141,7 +141,7 @@ describe('Checkout resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2022-10-03T12:25:06-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:41:57-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; @@ -161,7 +161,7 @@ describe('Checkout resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339459, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "john.smith@example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2022-10-03T12:25:22-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "John", "last_name": "Smith", "phone": "(123)456-7890", "company": null, "address1": "126 York St.", "address2": "", "city": "Los Angeles", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "90002"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339478, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "john.smith@example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:41:43-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "John", "last_name": "Smith", "phone": "(123)456-7890", "company": null, "address1": "126 York St.", "address2": "", "city": "Los Angeles", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "90002"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; @@ -189,17 +189,17 @@ describe('Checkout resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"shipping_rates": []})); + queueMockResponse(JSON.stringify({"shipping_rates": [{"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "checkout": {"total_tax": "0.00", "total_price": "398.00", "subtotal_price": "398.00"}, "phone_required": false, "delivery_range": null, "estimated_time_in_transit": null, "handle": "shopify-Free%20Shipping-0.00"}]})); await shopify.rest.Checkout.shipping_rates({ session: session, - token: "zs9ru89kuqcdagk8bz4r9hnxt22wwd42", + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/checkouts/zs9ru89kuqcdagk8bz4r9hnxt22wwd42/shipping_rates.json', + path: '/admin/api/2022-07/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', query: '', headers, data: undefined @@ -225,17 +225,17 @@ describe('Checkout resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"shipping_rates": [{"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "checkout": {"total_tax": "0.00", "total_price": "398.00", "subtotal_price": "398.00"}, "phone_required": false, "delivery_range": null, "estimated_time_in_transit": null, "handle": "shopify-Free%20Shipping-0.00"}]})); + queueMockResponse(JSON.stringify({"shipping_rates": []})); await shopify.rest.Checkout.shipping_rates({ session: session, - token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + token: "zs9ru89kuqcdagk8bz4r9hnxt22wwd42", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', + path: '/admin/api/2022-07/checkouts/zs9ru89kuqcdagk8bz4r9hnxt22wwd42/shipping_rates.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/collect.test.ts b/rest/admin/__tests__/2022-07/collect.test.ts index 150444e38..6dd98e07f 100644 --- a/rest/admin/__tests__/2022-07/collect.test.ts +++ b/rest/admin/__tests__/2022-07/collect.test.ts @@ -31,7 +31,7 @@ describe('Collect resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"collect": {"id": 1071559580, "collection_id": 841564295, "product_id": 921728736, "created_at": "2022-10-03T13:19:30-04:00", "updated_at": "2022-10-03T13:19:30-04:00", "position": 2, "sort_value": "0000000002"}})); + queueMockResponse(JSON.stringify({"collect": {"id": 1071559576, "collection_id": 841564295, "product_id": 921728736, "created_at": "2023-01-03T12:45:21-05:00", "updated_at": "2023-01-03T12:45:21-05:00", "position": 2, "sort_value": "0000000002"}})); const collect = new shopify.rest.Collect({session: session}); collect.product_id = 921728736; @@ -49,17 +49,16 @@ describe('Collect resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 800915878, "collection_id": 482865238, "product_id": 921728736, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); - await shopify.rest.Collect.delete({ + await shopify.rest.Collect.all({ session: session, - id: 455204334, }); expect({ - method: 'DELETE', + method: 'GET', domain, - path: '/admin/api/2022-07/collects/455204334.json', + path: '/admin/api/2022-07/collects.json', query: '', headers, data: undefined @@ -67,18 +66,18 @@ describe('Collect resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"collect": {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}})); + queueMockResponse(JSON.stringify({"collects": [{"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 1071559574, "collection_id": 841564295, "product_id": 921728736, "created_at": "2023-01-03T12:45:12-05:00", "updated_at": "2023-01-03T12:45:12-05:00", "position": 2, "sort_value": "0000000002"}]})); - await shopify.rest.Collect.find({ + await shopify.rest.Collect.all({ session: session, - id: 455204334, + collection_id: "841564295", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/collects/455204334.json', - query: '', + path: '/admin/api/2022-07/collects.json', + query: 'collection_id=841564295', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -103,16 +102,17 @@ describe('Collect resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 800915878, "collection_id": 482865238, "product_id": 921728736, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); + queueMockResponse(JSON.stringify({})); - await shopify.rest.Collect.all({ + await shopify.rest.Collect.delete({ session: session, + id: 455204334, }); expect({ - method: 'GET', + method: 'DELETE', domain, - path: '/admin/api/2022-07/collects.json', + path: '/admin/api/2022-07/collects/455204334.json', query: '', headers, data: undefined @@ -120,54 +120,53 @@ describe('Collect resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"collects": [{"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 1071559581, "collection_id": 841564295, "product_id": 921728736, "created_at": "2022-10-03T13:19:33-04:00", "updated_at": "2022-10-03T13:19:33-04:00", "position": 2, "sort_value": "0000000002"}]})); + queueMockResponse(JSON.stringify({"collect": {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}})); - await shopify.rest.Collect.all({ + await shopify.rest.Collect.find({ session: session, - collection_id: "841564295", + id: 455204334, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/collects.json', - query: 'collection_id=841564295', + path: '/admin/api/2022-07/collects/455204334.json', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"count": 2})); await shopify.rest.Collect.count({ session: session, - collection_id: "841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/collects/count.json', - query: 'collection_id=841564295', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"count": 2})); + queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Collect.count({ session: session, - product_id: "632910392", + collection_id: "841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/collects/count.json', - query: 'product_id=632910392', + query: 'collection_id=841564295', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -178,13 +177,14 @@ describe('Collect resource', () => { await shopify.rest.Collect.count({ session: session, + product_id: "632910392", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/collects/count.json', - query: '', + query: 'product_id=632910392', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-07/collection.test.ts b/rest/admin/__tests__/2022-07/collection.test.ts index bc93edc51..1a6f0e835 100644 --- a/rest/admin/__tests__/2022-07/collection.test.ts +++ b/rest/admin/__tests__/2022-07/collection.test.ts @@ -31,7 +31,7 @@ describe('Collection resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "collection_type": "custom", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "collection_type": "custom", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); await shopify.rest.Collection.find({ session: session, @@ -49,7 +49,7 @@ describe('Collection resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-10-03T12:15:55-04:00", "handle": "ipod-nano", "updated_at": "2022-10-03T12:15:55-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:21:36-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:21:36-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); await shopify.rest.Collection.products({ session: session, diff --git a/rest/admin/__tests__/2022-07/collection_listing.test.ts b/rest/admin/__tests__/2022-07/collection_listing.test.ts index b014d4b99..f52e9e987 100644 --- a/rest/admin/__tests__/2022-07/collection_listing.test.ts +++ b/rest/admin/__tests__/2022-07/collection_listing.test.ts @@ -31,7 +31,7 @@ describe('CollectionListing resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"collection_listings": [{"collection_id": 482865238, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 841564295, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "IPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 395646240, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever. Again

", "default_product_image": {"id": 850703190, "created_at": "2022-10-03T13:07:13-04:00", "position": 1, "updated_at": "2022-10-03T13:07:13-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664816833", "variant_ids": [], "width": 123, "height": 456}, "handle": "ipods_two", "image": null, "title": "IPods Two", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 691652237, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

No ipods here

", "default_product_image": null, "handle": "non-ipods", "image": null, "title": "Non Ipods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}]})); + queueMockResponse(JSON.stringify({"collection_listings": [{"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 841564295, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "IPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 395646240, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever. Again

", "default_product_image": {"id": 850703190, "created_at": "2023-01-03T12:56:35-05:00", "position": 1, "updated_at": "2023-01-03T12:56:35-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "width": 123, "height": 456}, "handle": "ipods_two", "image": null, "title": "IPods Two", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 691652237, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

No ipods here

", "default_product_image": null, "handle": "non-ipods", "image": null, "title": "Non Ipods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}]})); await shopify.rest.CollectionListing.all({ session: session, @@ -66,7 +66,7 @@ describe('CollectionListing resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); await shopify.rest.CollectionListing.find({ session: session, @@ -84,7 +84,7 @@ describe('CollectionListing resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); const collection_listing = new shopify.rest.CollectionListing({session: session}); collection_listing.collection_id = 482865238; diff --git a/rest/admin/__tests__/2022-07/comment.test.ts b/rest/admin/__tests__/2022-07/comment.test.ts index 6fd7d1d83..8a77a0f46 100644 --- a/rest/admin/__tests__/2022-07/comment.test.ts +++ b/rest/admin/__tests__/2022-07/comment.test.ts @@ -31,43 +31,44 @@ describe('Comment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, - article_id: "134645308", - blog_id: "241253187", + since_id: "118373535", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/comments.json', - query: 'article_id=134645308&blog_id=241253187', + query: 'since_id=118373535', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, + article_id: "134645308", + blog_id: "241253187", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/comments.json', - query: '', + query: 'article_id=134645308&blog_id=241253187', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, @@ -85,18 +86,17 @@ describe('Comment resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, - since_id: "118373535", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/comments.json', - query: 'since_id=118373535', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -157,7 +157,7 @@ describe('Comment resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"comment": {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}})); + queueMockResponse(JSON.stringify({"comment": {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}})); await shopify.rest.Comment.find({ session: session, @@ -175,14 +175,14 @@ describe('Comment resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"comment": {"author": "Your new name", "body": "You can even update through a web service.", "email": "your@updated-email.com", "published_at": "2022-10-03T13:05:08-04:00", "id": 118373535, "body_html": "

You can even update through a web service.

", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:08-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"}})); + queueMockResponse(JSON.stringify({"comment": {"author": "Your new name", "body": "You can even update through a web service.", "email": "your@updated-email.com", "published_at": "2023-01-03T12:06:05-05:00", "id": 118373535, "body_html": "

You can even update through a web service.

", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:06-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"}})); const comment = new shopify.rest.Comment({session: session}); comment.id = 118373535; comment.body = "You can even update through a web service."; comment.author = "Your new name"; comment.email = "your@updated-email.com"; - comment.published_at = "2022-10-03T17:05:08.150Z"; + comment.published_at = "2023-01-03T17:06:05.929Z"; await comment.save({}); expect({ @@ -191,12 +191,12 @@ describe('Comment resource', () => { path: '/admin/api/2022-07/comments/118373535.json', query: '', headers, - data: { "comment": {"body": "You can even update through a web service.", "author": "Your new name", "email": "your@updated-email.com", "published_at": "2022-10-03T17:05:08.150Z"} } + data: { "comment": {"body": "You can even update through a web service.", "author": "Your new name", "email": "your@updated-email.com", "published_at": "2023-01-03T17:06:05.929Z"} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"comment": {"id": 757536352, "body": "I like comments\nAnd I like posting them *RESTfully*.", "body_html": "

I like comments
\nAnd I like posting them RESTfully.

", "author": "Your name", "email": "your@email.com", "status": "pending", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T13:05:29-04:00", "updated_at": "2022-10-03T13:05:29-04:00", "ip": "107.20.160.121", "user_agent": null, "published_at": null}})); + queueMockResponse(JSON.stringify({"comment": {"id": 757536352, "body": "I like comments\nAnd I like posting them *RESTfully*.", "body_html": "

I like comments
\nAnd I like posting them RESTfully.

", "author": "Your name", "email": "your@email.com", "status": "pending", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:06:09-05:00", "updated_at": "2023-01-03T12:06:09-05:00", "ip": "107.20.160.121", "user_agent": null, "published_at": null}})); const comment = new shopify.rest.Comment({session: session}); comment.body = "I like comments\nAnd I like posting them *RESTfully*."; @@ -218,7 +218,7 @@ describe('Comment resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"published_at": null, "status": "spam", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:02-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": null, "status": "spam", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:59-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -235,7 +235,7 @@ describe('Comment resource', () => { }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"published_at": "2022-10-03T13:05:06-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:06-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:06:19-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:19-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -252,7 +252,7 @@ describe('Comment resource', () => { }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"published_at": "2022-10-03T13:05:53-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:53-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:06:30-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:30-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -269,7 +269,7 @@ describe('Comment resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"published_at": null, "status": "removed", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:04-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": null, "status": "removed", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:12-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -286,7 +286,7 @@ describe('Comment resource', () => { }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"published_at": "2022-10-03T13:05:15-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:15-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:05:56-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:56-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; diff --git a/rest/admin/__tests__/2022-07/country.test.ts b/rest/admin/__tests__/2022-07/country.test.ts index 8b80f878d..8d90c799d 100644 --- a/rest/admin/__tests__/2022-07/country.test.ts +++ b/rest/admin/__tests__/2022-07/country.test.ts @@ -31,41 +31,76 @@ describe('Country resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"countries": [{"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}, {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}]})); + queueMockResponse(JSON.stringify({"countries": [{"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}, {"id": 359115488, "name": "Colombia", "code": "CO", "tax_name": "VAT", "tax": 0.15, "provinces": []}, {"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}]})); await shopify.rest.Country.all({ session: session, - since_id: "359115488", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/countries.json', - query: 'since_id=359115488', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"countries": [{"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}, {"id": 359115488, "name": "Colombia", "code": "CO", "tax_name": "VAT", "tax": 0.15, "provinces": []}, {"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}]})); + queueMockResponse(JSON.stringify({"countries": [{"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}, {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}]})); await shopify.rest.Country.all({ session: session, + since_id: "359115488", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/countries.json', - query: '', + query: 'since_id=359115488', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 1070231511, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/countries.json', + query: '', + headers, + data: { "country": {"code": "FR"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 1070231510, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + country.tax = 0.2; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/countries.json', + query: '', + headers, + data: { "country": {"code": "FR", "tax": 0.2} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.Country.count({ @@ -82,7 +117,7 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_4', async () => { + it('test_6', async () => { queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); await shopify.rest.Country.find({ @@ -100,7 +135,7 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { + it('test_7', async () => { queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"country_id": 879921427, "tax_name": "Tax", "id": 205434194, "name": "Alberta", "code": "AB", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 170405627, "name": "British Columbia", "code": "BC", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 342345110, "name": "Manitoba", "code": "MB", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 92264567, "name": "New Brunswick", "code": "NB", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 243284171, "name": "Newfoundland", "code": "NL", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 439598329, "name": "Northwest Territories", "code": "NT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 448070559, "name": "Nova Scotia", "code": "NS", "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 670206421, "name": "Nunavut", "code": "NU", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 702530425, "name": "Ontario", "code": "ON", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 570891722, "name": "Prince Edward Island", "code": "PE", "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 473391800, "name": "Saskatchewan", "code": "SK", "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 1005264686, "name": "Yukon", "code": "YT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); const country = new shopify.rest.Country({session: session}); @@ -118,7 +153,7 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { + it('test_8', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Country.delete({ @@ -136,39 +171,4 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { - queueMockResponse(JSON.stringify({"country": {"id": 1070231510, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); - - const country = new shopify.rest.Country({session: session}); - country.code = "FR"; - await country.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-07/countries.json', - query: '', - headers, - data: { "country": {"code": "FR"} } - }).toMatchMadeHttpRequest(); - }); - - it('test_8', async () => { - queueMockResponse(JSON.stringify({"country": {"id": 1070231511, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); - - const country = new shopify.rest.Country({session: session}); - country.code = "FR"; - country.tax = 0.2; - await country.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-07/countries.json', - query: '', - headers, - data: { "country": {"code": "FR", "tax": 0.2} } - }).toMatchMadeHttpRequest(); - }); - }); diff --git a/rest/admin/__tests__/2022-07/custom_collection.test.ts b/rest/admin/__tests__/2022-07/custom_collection.test.ts index f7ac2843a..26cecf128 100644 --- a/rest/admin/__tests__/2022-07/custom_collection.test.ts +++ b/rest/admin/__tests__/2022-07/custom_collection.test.ts @@ -31,238 +31,253 @@ describe('CustomCollection resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); await shopify.rest.CustomCollection.all({ session: session, + ids: "395646240,691652237,841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/custom_collections.json', - query: '', + query: 'ids=395646240%2C691652237%2C841564295', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); await shopify.rest.CustomCollection.all({ session: session, - ids: "395646240,691652237,841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/custom_collections.json', - query: 'ids=395646240%2C691652237%2C841564295', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 1063001346, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:05:21-05:00", "body_html": null, "published_at": "2023-01-03T13:05:21-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001346"}]})); await shopify.rest.CustomCollection.all({ session: session, - product_id: "632910392", + since_id: "841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/custom_collections.json', - query: 'product_id=632910392', + query: 'since_id=841564295', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 1063001328, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:24:03-04:00", "body_html": null, "published_at": "2022-10-03T12:24:03-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001328"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}]})); await shopify.rest.CustomCollection.all({ session: session, - since_id: "841564295", + product_id: "632910392", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/custom_collections.json', - query: 'since_id=841564295', + query: 'product_id=632910392', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001313, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:10-04:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001313"}})); + queueMockResponse(JSON.stringify({"count": 3})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; - custom_collection.published = false; - await custom_collection.save({}); + await shopify.rest.CustomCollection.count({ + session: session, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/custom_collections.json', + path: '/admin/api/2022-07/custom_collections/count.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks", "published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001315, "handle": "ipods-1", "title": "IPods", "updated_at": "2022-10-03T12:23:13-04:00", "body_html": null, "published_at": "2022-10-03T12:23:13-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001315"}})); + queueMockResponse(JSON.stringify({"count": 2})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "IPods"; - custom_collection.collects = [ - { - "product_id": 921728736 - } - ]; - await custom_collection.save({}); + await shopify.rest.CustomCollection.count({ + session: session, + product_id: "632910392", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/custom_collections.json', - query: '', + path: '/admin/api/2022-07/custom_collections/count.json', + query: 'product_id=632910392', headers, - data: { "custom_collection": {"title": "IPods", "collects": [{"product_id": 921728736}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001319, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:29-04:00", "body_html": null, "published_at": "2022-10-03T12:23:29-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001319"}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; - custom_collection.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; - await custom_collection.save({}); + await shopify.rest.CustomCollection.find({ + session: session, + id: 841564295, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/custom_collections.json', + path: '/admin/api/2022-07/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001322, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:35-04:00", "body_html": null, "published_at": "2022-10-03T12:23:34-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001322", "image": {"created_at": "2022-10-03T12:23:34-04:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-gz22my.gif?v=1664814215"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2023-01-03T13:03:58-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; - custom_collection.image = { - "src": "http://example.com/rails_logo.gif", - "alt": "Rails Logo" - }; + custom_collection.id = 841564295; + custom_collection.collects = [ + { + "product_id": 921728736, + "position": 1 + }, + { + "id": 455204334, + "position": 2 + } + ]; await custom_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/custom_collections.json', + path: '/admin/api/2022-07/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + data: { "custom_collection": {"collects": [{"product_id": 921728736, "position": 1}, {"id": 455204334, "position": 2}]} } }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001324, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:44-04:00", "body_html": null, "published_at": "2022-10-03T12:23:44-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001324"}})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2023-01-03T13:04:15-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; + custom_collection.id = 841564295; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await custom_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/custom_collections.json', + path: '/admin/api/2022-07/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks"} } + data: { "custom_collection": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"count": 2})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": null, "updated_at": "2023-01-03T13:05:26-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); - await shopify.rest.CustomCollection.count({ - session: session, - product_id: "632910392", - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = false; + await custom_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-07/custom_collections/count.json', - query: 'product_id=632910392', + path: '/admin/api/2022-07/custom_collections/841564295.json', + query: '', headers, - data: undefined + data: { "custom_collection": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"count": 3})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": "2023-01-03T13:05:05-05:00", "updated_at": "2023-01-03T13:05:05-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); - await shopify.rest.CustomCollection.count({ - session: session, - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = true; + await custom_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-07/custom_collections/count.json', + path: '/admin/api/2022-07/custom_collections/841564295.json', query: '', headers, - data: undefined + data: { "custom_collection": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

The best selling ipod ever

", "handle": "ipods", "updated_at": "2023-01-03T13:04:49-05:00", "id": 841564295, "sort_order": "manual", "title": "IPods", "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"}})); - await shopify.rest.CustomCollection.find({ - session: session, - id: 841564295, - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.image = ""; + custom_collection.updated_at = "2023-01-03T13:04:48-05:00"; + custom_collection.title = "IPods"; + custom_collection.handle = "ipods"; + custom_collection.body_html = "

The best selling ipod ever

"; + custom_collection.published_at = "2008-02-01T19:00:00-05:00"; + custom_collection.sort_order = "manual"; + custom_collection.template_suffix = null; + custom_collection.published_scope = "web"; + custom_collection.admin_graphql_api_id = "gid://shopify/Collection/841564295"; + await custom_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-07/custom_collections/841564295.json', query: '', headers, - data: undefined + data: { "custom_collection": {"image": "", "updated_at": "2023-01-03T13:04:48-05:00", "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

5000 songs in your pocket

", "title": "IPods", "handle": "ipods", "id": 841564295, "updated_at": "2022-10-03T12:22:50-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2023-01-03T13:05:34-05:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T13:05:34-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672769134"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); custom_collection.id = 841564295; - custom_collection.body_html = "

5000 songs in your pocket

"; + custom_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\n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67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; await custom_collection.save({}); expect({ @@ -271,17 +286,16 @@ describe('CustomCollection resource', () => { path: '/admin/api/2022-07/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"body_html": "

5000 songs in your pocket

"} } + data: { "custom_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYS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aqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2022-10-03T12:23:02-04:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:23:02-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1664814182"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2023-01-03T13:04:34-05:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"alt": "Rails logo", "created_at": "2023-01-03T13:04:32-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-s0af8s.gif?v=1672769074"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); custom_collection.id = 841564295; custom_collection.image = { - "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\n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AF\nCRAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo" }; await custom_collection.save({}); @@ -292,25 +306,16 @@ describe('CustomCollection resource', () => { path: '/admin/api/2022-07/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQ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7lwkB0BiUoR3x4EfmrYlCNjAF\nCRAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } + data: { "custom_collection": {"image": {"alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2022-10-03T12:23:04-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

5000 songs in your pocket

", "title": "IPods", "handle": "ipods", "id": 841564295, "updated_at": "2023-01-03T13:04:37-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); custom_collection.id = 841564295; - custom_collection.collects = [ - { - "product_id": 921728736, - "position": 1 - }, - { - "id": 455204334, - "position": 2 - } - ]; + custom_collection.body_html = "

5000 songs in your pocket

"; await custom_collection.save({}); expect({ @@ -319,133 +324,128 @@ describe('CustomCollection resource', () => { path: '/admin/api/2022-07/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"collects": [{"product_id": 921728736, "position": 1}, {"id": 455204334, "position": 2}]} } + data: { "custom_collection": {"body_html": "

5000 songs in your pocket

"} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": null, "updated_at": "2022-10-03T12:23:23-04:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.published = false; - await custom_collection.save({}); + await shopify.rest.CustomCollection.delete({ + session: session, + id: 841564295, + }); expect({ - method: 'PUT', + method: 'DELETE', domain, path: '/admin/api/2022-07/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": "2022-10-03T12:23:50-04:00", "updated_at": "2022-10-03T12:23:50-04:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001333, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T13:04:13-05:00", "body_html": null, "published_at": "2023-01-03T13:04:13-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001333"}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.published = true; + custom_collection.title = "IPods"; + custom_collection.collects = [ + { + "product_id": 921728736 + } + ]; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/custom_collections/841564295.json', + path: '/admin/api/2022-07/custom_collections.json', query: '', headers, - data: { "custom_collection": {"published": true} } + data: { "custom_collection": {"title": "IPods", "collects": [{"product_id": 921728736}]} } }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

The best selling ipod ever

", "handle": "ipods", "updated_at": "2022-10-03T12:23:53-04:00", "id": 841564295, "sort_order": "manual", "title": "IPods", "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001341, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:53-05:00", "body_html": null, "published_at": "2023-01-03T13:04:53-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001341"}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.image = ""; - custom_collection.updated_at = "2022-10-03T12:23:53-04:00"; - custom_collection.title = "IPods"; - custom_collection.handle = "ipods"; - custom_collection.body_html = "

The best selling ipod ever

"; - custom_collection.published_at = "2008-02-01T19:00:00-05:00"; - custom_collection.sort_order = "manual"; - custom_collection.template_suffix = null; - custom_collection.published_scope = "web"; - custom_collection.admin_graphql_api_id = "gid://shopify/Collection/841564295"; + custom_collection.title = "Macbooks"; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/custom_collections/841564295.json', + path: '/admin/api/2022-07/custom_collections.json', query: '', headers, - data: { "custom_collection": {"image": "", "updated_at": "2022-10-03T12:23:53-04:00", "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"} } + data: { "custom_collection": {"title": "Macbooks"} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2022-10-03T12:23:56-04:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"alt": "Rails logo", "created_at": "2022-10-03T12:23:55-04:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-72b9ne.gif?v=1664814236"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001342, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:58-05:00", "body_html": null, "published_at": "2023-01-03T13:04:58-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001342"}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.image = { - "alt": "Rails logo" - }; + custom_collection.title = "Macbooks"; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/custom_collections/841564295.json', + path: '/admin/api/2022-07/custom_collections.json', query: '', headers, - data: { "custom_collection": {"image": {"alt": "Rails logo"}} } + data: { "custom_collection": {"title": "Macbooks", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2022-10-03T12:24:10-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001339, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:40-05:00", "body_html": null, "published_at": "2023-01-03T13:04:39-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001339", "image": {"created_at": "2023-01-03T13:04:39-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-c6wrde.gif?v=1672769080"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + custom_collection.title = "Macbooks"; + custom_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/custom_collections/841564295.json', + path: '/admin/api/2022-07/custom_collections.json', query: '', headers, - data: { "custom_collection": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "custom_collection": {"title": "Macbooks", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001337, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:24-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001337"}})); - await shopify.rest.CustomCollection.delete({ - session: session, - id: 841564295, - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + custom_collection.published = false; + await custom_collection.save({}); expect({ - method: 'DELETE', + method: 'POST', domain, - path: '/admin/api/2022-07/custom_collections/841564295.json', + path: '/admin/api/2022-07/custom_collections.json', query: '', headers, - data: undefined + data: { "custom_collection": {"title": "Macbooks", "published": false} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/customer.test.ts b/rest/admin/__tests__/2022-07/customer.test.ts index 73f165055..3ead6276f 100644 --- a/rest/admin/__tests__/2022-07/customer.test.ts +++ b/rest/admin/__tests__/2022-07/customer.test.ts @@ -31,25 +31,25 @@ describe('Customer resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339464, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:26:08-05:00", "updated_at": "2022-11-09T10:26:08-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:26:08-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339464", "default_address": {"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:25:55-05:00", "updated_at": "2022-11-09T10:25:55-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339469, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:43-05:00", "updated_at": "2023-01-03T12:19:43-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317299, "customer_id": 1073339469, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:19:43-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339469", "default_address": {"id": 1053317299, "customer_id": 1073339469, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:30-05:00", "updated_at": "2023-01-03T12:19:30-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.all({ session: session, - ids: "207119551,1073339464", + ids: "207119551,1073339469", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/customers.json', - query: 'ids=207119551%2C1073339464', + query: 'ids=207119551%2C1073339469', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339466, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:28:04-05:00", "updated_at": "2022-11-09T10:28:04-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317296, "customer_id": 1073339466, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:28:04-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339466", "default_address": {"id": 1053317296, "customer_id": 1073339466, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339458, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:08:39-05:00", "updated_at": "2023-01-03T12:08:39-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:39-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339458", "default_address": {"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}]})); await shopify.rest.Customer.all({ session: session, @@ -67,25 +67,25 @@ describe('Customer resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:23:30-05:00", "updated_at": "2022-11-09T10:23:30-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:12:39-05:00", "updated_at": "2023-01-03T12:12:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.all({ session: session, - updated_at_min: "2022-11-08 15:23:42", + updated_at_min: "2023-01-02 17:12:54", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/customers.json', - query: 'updated_at_min=2022-11-08+15%3A23%3A42', + query: 'updated_at_min=2023-01-02+17%3A12%3A54', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:28:39-05:00", "updated_at": "2022-11-09T10:28:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:09-05:00", "updated_at": "2023-01-03T12:15:09-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.all({ session: session, @@ -120,7 +120,7 @@ describe('Customer resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:21:20-05:00", "updated_at": "2022-11-09T10:21:20-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:13:43-05:00", "updated_at": "2023-01-03T12:13:43-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.search({ session: session, @@ -157,7 +157,7 @@ describe('Customer resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339472, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "tags": "New Customer"}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339466, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "tags": "New Customer"}]})); await shopify.rest.Customer.search({ session: session, @@ -176,7 +176,7 @@ describe('Customer resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:22:34-05:00", "updated_at": "2022-11-09T10:22:34-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:07:03-05:00", "updated_at": "2023-01-03T12:07:03-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.search({ session: session, @@ -194,7 +194,7 @@ describe('Customer resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:33:01-05:00", "updated_at": "2022-11-09T10:33:01-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:16:11-05:00", "updated_at": "2023-01-03T12:16:11-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.search({ session: session, @@ -212,7 +212,7 @@ describe('Customer resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339461, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "verified_email": true}, {"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "verified_email": true}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339460, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "verified_email": true}, {"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "verified_email": true}]})); await shopify.rest.Customer.search({ session: session, @@ -231,7 +231,7 @@ describe('Customer resource', () => { }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:27:08-05:00", "updated_at": "2022-11-09T10:27:08-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:27:08-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:39-05:00", "updated_at": "2023-01-03T12:15:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:15:39-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); await shopify.rest.Customer.find({ session: session, @@ -249,7 +249,7 @@ describe('Customer resource', () => { }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2022-11-09T10:22:49-05:00", "updated_at": "2022-11-09T10:23:03-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:22:49-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2023-01-03T12:18:42-05:00", "updated_at": "2023-01-03T12:18:59-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:18:42-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -274,12 +274,12 @@ describe('Customer resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2022-11-09T10:26:55-05:00", "updated_at": "2022-11-09T10:27:07-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-11-06T10:27:06-05:00", "marketing_opt_in_level": "confirmed_opt_in", "tax_exemptions": [], "email_marketing_consent": {"state": "subscribed", "opt_in_level": "confirmed_opt_in", "consent_updated_at": "2022-11-06T10:27:06-05:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:26:55-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2023-01-03T12:07:21-05:00", "updated_at": "2023-01-03T12:07:37-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-12-31T12:07:36-05:00", "marketing_opt_in_level": "confirmed_opt_in", "tax_exemptions": [], "email_marketing_consent": {"state": "subscribed", "opt_in_level": "confirmed_opt_in", "consent_updated_at": "2022-12-31T12:07:36-05:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:07:21-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; customer.accepts_marketing = true; - customer.accepts_marketing_updated_at = "2022-11-06T10:27:06-05:00"; + customer.accepts_marketing_updated_at = "2022-12-31T12:07:36-05:00"; customer.marketing_opt_in_level = "confirmed_opt_in"; await customer.save({}); @@ -289,12 +289,12 @@ describe('Customer resource', () => { path: '/admin/api/2022-07/customers/207119551.json', query: '', headers, - data: { "customer": {"accepts_marketing": true, "accepts_marketing_updated_at": "2022-11-06T10:27:06-05:00", "marketing_opt_in_level": "confirmed_opt_in"} } + data: { "customer": {"accepts_marketing": true, "accepts_marketing_updated_at": "2022-12-31T12:07:36-05:00", "marketing_opt_in_level": "confirmed_opt_in"} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2022-11-09T10:27:36-05:00", "updated_at": "2022-11-09T10:27:51-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "New Customer, Repeat Customer", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:27:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2023-01-03T12:07:37-05:00", "updated_at": "2023-01-03T12:07:53-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "New Customer, Repeat Customer", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:07:37-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -312,7 +312,7 @@ describe('Customer resource', () => { }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "changed@email.address.com", "note": "Customer is a great guy", "first_name": "Bob", "last_name": "Norman", "accepts_marketing": false, "created_at": "2022-11-09T10:20:18-05:00", "updated_at": "2022-11-09T10:20:33-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:20:33-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:20:18-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "changed@email.address.com", "updated_at": "2023-01-03T12:08:55-05:00", "note": "Customer is a great guy", "first_name": "Bob", "last_name": "Norman", "accepts_marketing": false, "created_at": "2023-01-03T12:08:41-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:55-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:08:41-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -349,7 +349,7 @@ describe('Customer resource', () => { }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 1073339463, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:25:39-05:00", "updated_at": "2022-11-09T10:25:40-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "enabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317293, "customer_id": 1073339463, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:25:40-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339463", "default_address": {"id": 1053317293, "customer_id": 1073339463, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339456, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:08:09-05:00", "updated_at": "2023-01-03T12:08:10-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "enabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317286, "customer_id": 1073339456, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:10-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317286, "customer_id": 1073339456, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -385,7 +385,7 @@ describe('Customer resource', () => { }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 1073339460, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:22:04-05:00", "updated_at": "2022-11-09T10:22:04-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317290, "customer_id": 1073339460, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:22:04-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339460", "default_address": {"id": 1053317290, "customer_id": 1073339460, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339468, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:30-05:00", "updated_at": "2023-01-03T12:19:30-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317298, "customer_id": 1073339468, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:19:30-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339468", "default_address": {"id": 1053317298, "customer_id": 1073339468, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -419,7 +419,7 @@ describe('Customer resource', () => { }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"customer": {"updated_at": "2022-11-09T10:21:50-05:00", "id": 1073339459, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:21:50-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317289, "customer_id": 1073339459, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:21:50-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339459", "default_address": {"id": 1053317289, "customer_id": 1073339459, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339465, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:16:40-05:00", "updated_at": "2023-01-03T12:16:40-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317295, "customer_id": 1073339465, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:16:40-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339465", "default_address": {"id": 1053317295, "customer_id": 1073339465, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -460,7 +460,7 @@ describe('Customer resource', () => { }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 1073339470, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:31:30-05:00", "updated_at": "2022-11-09T10:31:30-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317300, "customer_id": 1073339470, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:31:30-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339470", "default_address": {"id": 1053317300, "customer_id": 1073339470, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339464, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:39-05:00", "updated_at": "2023-01-03T12:15:39-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:15:39-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339464", "default_address": {"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -493,7 +493,7 @@ describe('Customer resource', () => { }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"account_activation_url": "https://jsmith.myshopify.com/account/activate/207119551/63c979bd73389d3b3496db03cea13266-1668007656"})); + queueMockResponse(JSON.stringify({"account_activation_url": "https://jsmith.myshopify.com/account/activate/207119551/75ed95bcf5876b0bac5bb06e1244ccea-1672766051"})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -569,14 +569,14 @@ describe('Customer resource', () => { await shopify.rest.Customer.count({ session: session, - updated_at_min: "2022-11-08 15:33:44", + updated_at_min: "2023-01-02 17:10:34", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/customers/count.json', - query: 'updated_at_min=2022-11-08+15%3A33%3A44', + query: 'updated_at_min=2023-01-02+17%3A10%3A34', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -587,21 +587,21 @@ describe('Customer resource', () => { await shopify.rest.Customer.count({ session: session, - created_at_min: "2022-11-08 15:33:29", + created_at_min: "2023-01-02 17:21:35", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/customers/count.json', - query: 'created_at_min=2022-11-08+15%3A33%3A29', + query: 'created_at_min=2023-01-02+17%3A21%3A35', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_28', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:28:21-05:00", "updated_at": "2022-11-09T10:28:21-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:28:21-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-09T10:28:21-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-09T10:28:21-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-09T10:28:21-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-09T10:28:21-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "c901414060.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:17:39-05:00", "updated_at": "2023-01-03T12:17:39-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:17:39-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:17:39-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:17:39-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:17:39-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:17:39-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Customer.orders({ session: session, @@ -619,7 +619,7 @@ describe('Customer resource', () => { }); it('test_29', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:32:16-05:00", "updated_at": "2022-11-09T10:32:16-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:32:16-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-09T10:32:16-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-09T10:32:16-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-09T10:32:16-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-09T10:32:16-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "c901414060.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:13:09-05:00", "updated_at": "2023-01-03T12:13:09-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:13:09-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:13:09-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:13:09-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:13:09-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:13:09-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Customer.orders({ session: session, diff --git a/rest/admin/__tests__/2022-07/customer_address.test.ts b/rest/admin/__tests__/2022-07/customer_address.test.ts index dbdd26eed..702e01067 100644 --- a/rest/admin/__tests__/2022-07/customer_address.test.ts +++ b/rest/admin/__tests__/2022-07/customer_address.test.ts @@ -131,13 +131,13 @@ describe('CustomerAddress resource', () => { await shopify.rest.CustomerAddress.delete({ session: session, customer_id: 207119551, - id: 1053317288, + id: 1053317306, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/customers/207119551/addresses/1053317288.json', + path: '/admin/api/2022-07/customers/207119551/addresses/1053317306.json', query: '', headers, data: undefined @@ -145,7 +145,7 @@ describe('CustomerAddress resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317286, "customer_id": 207119551, "first_name": "Samuel", "last_name": "de Champlain", "company": "Fancy Co.", "address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "phone": "819-555-5555", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada", "default": false}})); + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317303, "customer_id": 207119551, "first_name": "Samuel", "last_name": "de Champlain", "company": "Fancy Co.", "address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "phone": "819-555-5555", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada", "default": false}})); const customer_address = new shopify.rest.CustomerAddress({session: session}); customer_address.customer_id = 207119551; @@ -181,7 +181,7 @@ describe('CustomerAddress resource', () => { const customer_address = new shopify.rest.CustomerAddress({session: session}); customer_address.customer_id = 207119551; await customer_address.set({ - address_ids: ["1053317287"], + address_ids: ["1053317305"], operation: "destroy", }); @@ -189,24 +189,24 @@ describe('CustomerAddress resource', () => { method: 'PUT', domain, path: '/admin/api/2022-07/customers/207119551/addresses/set.json', - query: 'address_ids%5B%5D=1053317287&operation=destroy', + query: 'address_ids%5B%5D=1053317305&operation=destroy', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317289, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317304, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); const customer_address = new shopify.rest.CustomerAddress({session: session}); customer_address.customer_id = 207119551; - customer_address.id = 1053317289; + customer_address.id = 1053317304; await customer_address.default({}); expect({ method: 'PUT', domain, - path: '/admin/api/2022-07/customers/207119551/addresses/1053317289/default.json', + path: '/admin/api/2022-07/customers/207119551/addresses/1053317304/default.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/customer_saved_search.test.ts b/rest/admin/__tests__/2022-07/customer_saved_search.test.ts index bd83d3556..cb42d94b8 100644 --- a/rest/admin/__tests__/2022-07/customer_saved_search.test.ts +++ b/rest/admin/__tests__/2022-07/customer_saved_search.test.ts @@ -31,7 +31,7 @@ describe('CustomerSavedSearch resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "accepts_marketing:1"}, {"id": 20610973, "name": "Canadian Snowboarders", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "country:Canada"}, {"id": 669439218, "name": "Premier Customers", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}]})); + queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}, {"id": 20610973, "name": "Canadian Snowboarders", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "country:Canada"}, {"id": 669439218, "name": "Premier Customers", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}]})); await shopify.rest.CustomerSavedSearch.all({ session: session, @@ -48,7 +48,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 669439218, "name": "Premier Customers", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}, {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "accepts_marketing:1"}]})); + queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 669439218, "name": "Premier Customers", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}, {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}]})); await shopify.rest.CustomerSavedSearch.all({ session: session, @@ -66,7 +66,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136102, "name": "Spent more than $50", "created_at": "2022-10-31T10:33:27-04:00", "updated_at": "2022-10-31T10:33:27-04:00", "query": "total_spent:>50"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136102, "name": "Spent more than $50", "created_at": "2023-01-03T13:07:07-05:00", "updated_at": "2023-01-03T13:07:07-05:00", "query": "total_spent:>50"}})); const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); customer_saved_search.name = "Spent more than $50"; @@ -84,7 +84,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136103, "name": "Spent more than $50 and after 2013", "created_at": "2022-10-31T10:33:49-04:00", "updated_at": "2022-10-31T10:33:49-04:00", "query": "total_spent:>50 order_date:>=2013-01-01"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136103, "name": "Spent more than $50 and after 2013", "created_at": "2023-01-03T13:07:17-05:00", "updated_at": "2023-01-03T13:07:17-05:00", "query": "total_spent:>50 order_date:>=2013-01-01"}})); const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); customer_saved_search.name = "Spent more than $50 and after 2013"; @@ -137,7 +137,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "accepts_marketing:1"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}})); await shopify.rest.CustomerSavedSearch.find({ session: session, @@ -155,7 +155,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"name": "This Name Has Been Changed", "id": 789629109, "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-31T10:33:35-04:00", "query": "accepts_marketing:1"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"name": "This Name Has Been Changed", "id": 789629109, "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2023-01-03T13:06:53-05:00", "query": "accepts_marketing:1"}})); const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); customer_saved_search.id = 789629109; @@ -191,7 +191,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2022-10-31T10:32:41-04:00", "updated_at": "2022-10-31T10:33:36-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-10-31T10:33:36-04:00", "marketing_opt_in_level": "single_opt_in", "tax_exemptions": [], "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-31T10:32:41-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:07:04-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2023-01-03T13:07:04-05:00", "marketing_opt_in_level": "single_opt_in", "tax_exemptions": [], "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.CustomerSavedSearch.customers({ session: session, diff --git a/rest/admin/__tests__/2022-07/discount_code.test.ts b/rest/admin/__tests__/2022-07/discount_code.test.ts index 09523c4a2..4b4fead2b 100644 --- a/rest/admin/__tests__/2022-07/discount_code.test.ts +++ b/rest/admin/__tests__/2022-07/discount_code.test.ts @@ -31,7 +31,7 @@ describe('DiscountCode resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"discount_code": {"id": 1054381139, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2022-10-03T12:22:02-04:00", "updated_at": "2022-10-03T12:22:02-04:00"}})); + queueMockResponse(JSON.stringify({"discount_code": {"id": 1054381139, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:38:34-05:00", "updated_at": "2023-01-03T12:38:34-05:00"}})); const discount_code = new shopify.rest.DiscountCode({session: session}); discount_code.price_rule_id = 507328175; @@ -49,7 +49,7 @@ describe('DiscountCode resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"discount_codes": [{"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}]})); + queueMockResponse(JSON.stringify({"discount_codes": [{"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}]})); await shopify.rest.DiscountCode.all({ session: session, @@ -67,7 +67,7 @@ describe('DiscountCode resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "WINTERSALE20OFF", "usage_count": 0, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:22:08-04:00"}})); + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "WINTERSALE20OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:31-05:00"}})); const discount_code = new shopify.rest.DiscountCode({session: session}); discount_code.price_rule_id = 507328175; @@ -86,7 +86,7 @@ describe('DiscountCode resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}})); + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}})); await shopify.rest.DiscountCode.find({ session: session, @@ -141,7 +141,7 @@ describe('DiscountCode resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 989355119, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2022-10-03T12:22:11-04:00", "updated_at": "2022-10-03T12:22:11-04:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 989355119, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2023-01-03T12:38:25-05:00", "updated_at": "2023-01-03T12:38:25-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); const discount_code = new shopify.rest.DiscountCode({session: session}); discount_code.price_rule_id = 507328175; @@ -160,7 +160,7 @@ describe('DiscountCode resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 173232803, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 173232803, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); await shopify.rest.DiscountCode.get_all({ session: session, diff --git a/rest/admin/__tests__/2022-07/draft_order.test.ts b/rest/admin/__tests__/2022-07/draft_order.test.ts index 323b14652..2e0d59201 100644 --- a/rest/admin/__tests__/2022-07/draft_order.test.ts +++ b/rest/admin/__tests__/2022-07/draft_order.test.ts @@ -31,29 +31,7 @@ describe('DraftOrder resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920475, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:19:47-04:00", "updated_at": "2022-10-03T12:19:47-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630380, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630380"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/d0730281ac9692b04a064b4bac5f23bc", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920475", "customer": null}})); - - const draft_order = new shopify.rest.DraftOrder({session: session}); - draft_order.line_items = [ - { - "variant_id": 447654529, - "quantity": 1 - } - ]; - await draft_order.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-07/draft_orders.json', - query: '', - headers, - data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } - }).toMatchMadeHttpRequest(); - }); - - it('test_2', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920476, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:19:50-04:00", "updated_at": "2022-10-03T12:19:50-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630381, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630381"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/227d2bfd5f2da805a987c89fd317c33f", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "40.00", "subtotal_price": "40.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920476", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920479, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:43-05:00", "updated_at": "2023-01-03T12:58:43-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630384, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630384"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/b21e68f2f1e19263509b19a8286d2d09", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "30.00", "subtotal_price": "30.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920479", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -63,6 +41,13 @@ describe('DraftOrder resource', () => { "quantity": 2 } ]; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "fixed_amount", + "value": "10.0", + "amount": "10.00", + "title": "Custom" + }; draft_order.customer = { "id": 207119551 }; @@ -75,12 +60,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-07/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "customer": {"id": 207119551}, "use_customer_default_address": true} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.00", "title": "Custom"}, "customer": {"id": 207119551}, "use_customer_default_address": true} } }).toMatchMadeHttpRequest(); }); - it('test_3', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920477, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:00-04:00", "updated_at": "2022-10-03T12:20:00-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630382, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630382"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/81affa4929f868a98b2231f89ab48a24", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "tags": "", "note_attributes": [], "total_price": "11.30", "subtotal_price": "10.00", "total_tax": "1.30", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "11.30", "currency_code": "USD"}, "presentment_money": {"amount": "11.30", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "1.30", "currency_code": "USD"}, "presentment_money": {"amount": "1.30", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920477", "customer": null}})); + it('test_2', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920478, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:39-05:00", "updated_at": "2023-01-03T12:58:39-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630383, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "2.00", "value_type": "percentage"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630383"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/d3f9ba3d1a9c83f93adf079a7f05d693", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "tags": "", "note_attributes": [], "total_price": "20.34", "subtotal_price": "18.00", "total_tax": "2.34", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "20.34", "currency_code": "USD"}, "presentment_money": {"amount": "20.34", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "18.00", "currency_code": "USD"}, "presentment_money": {"amount": "18.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "2.34", "currency_code": "USD"}, "presentment_money": {"amount": "2.34", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "2.00", "currency_code": "USD"}, "presentment_money": {"amount": "2.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920478"}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -90,9 +75,9 @@ describe('DraftOrder resource', () => { "quantity": 1, "applied_discount": { "description": "Custom discount", - "value_type": "fixed_amount", + "value_type": "percentage", "value": "10.0", - "amount": "10.0", + "amount": "2.0", "title": "Custom" } } @@ -105,12 +90,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-07/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.0", "title": "Custom"}}]} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "2.0", "title": "Custom"}}]} } }).toMatchMadeHttpRequest(); }); - it('test_4', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920478, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:01-04:00", "updated_at": "2022-10-03T12:20:01-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630383, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630383"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/58c3ff8f12f0a0f8a552f36dec441b0a", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "30.00", "subtotal_price": "30.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920478", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + it('test_3', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920477, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:31-05:00", "updated_at": "2023-01-03T12:58:31-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630382, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630382"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/17d301f9579f7982e4d1f75dd2b3269c", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "40.00", "subtotal_price": "40.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920477", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -120,13 +105,6 @@ describe('DraftOrder resource', () => { "quantity": 2 } ]; - draft_order.applied_discount = { - "description": "Custom discount", - "value_type": "fixed_amount", - "value": "10.0", - "amount": "10.00", - "title": "Custom" - }; draft_order.customer = { "id": 207119551 }; @@ -139,12 +117,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-07/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.00", "title": "Custom"}, "customer": {"id": 207119551}, "use_customer_default_address": true} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "customer": {"id": 207119551}, "use_customer_default_address": true} } }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920479, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:03-04:00", "updated_at": "2022-10-03T12:20:03-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630384, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630384"}], "shipping_address": null, "billing_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/b351a137cc201ae891ddcda59a58179e", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920479", "customer": {"id": 1073339456, "email": null, "accepts_marketing": false, "created_at": "2022-10-03T12:20:03-04:00", "updated_at": "2022-10-03T12:20:03-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-10-03T12:20:03-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317287, "customer_id": 1073339456, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + it('test_4', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920475, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:23-05:00", "updated_at": "2023-01-03T12:58:23-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630380, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630380"}], "shipping_address": null, "billing_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/5f465084cd7442780b87241fed885a5e", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920475", "customer": {"id": 1073339480, "email": null, "accepts_marketing": false, "created_at": "2023-01-03T12:58:23-05:00", "updated_at": "2023-01-03T12:58:23-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:58:23-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339480", "default_address": {"id": 1053317317, "customer_id": 1073339480, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -175,8 +153,8 @@ describe('DraftOrder resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920480, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:10-04:00", "updated_at": "2022-10-03T12:20:10-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630385, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630385"}], "shipping_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/8e652af09741964f24a0f2b12c70e416", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920480", "customer": {"id": 1073339457, "email": null, "accepts_marketing": false, "created_at": "2022-10-03T12:20:10-04:00", "updated_at": "2022-10-03T12:20:10-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-10-03T12:20:10-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339457", "default_address": {"id": 1053317289, "customer_id": 1073339457, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + it('test_5', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920476, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:25-05:00", "updated_at": "2023-01-03T12:58:25-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630381, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630381"}], "shipping_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/a9d2db17815b237bbc13d6ecd39d8f11", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920476", "customer": {"id": 1073339481, "email": null, "accepts_marketing": false, "created_at": "2023-01-03T12:58:25-05:00", "updated_at": "2023-01-03T12:58:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:58:25-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339481", "default_address": {"id": 1053317318, "customer_id": 1073339481, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -207,8 +185,8 @@ describe('DraftOrder resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920481, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:14-04:00", "updated_at": "2022-10-03T12:20:14-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630386, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "2.00", "value_type": "percentage"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630386"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/45664b5ac2738c15446732395e47b6a1", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "tags": "", "note_attributes": [], "total_price": "20.34", "subtotal_price": "18.00", "total_tax": "2.34", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "20.34", "currency_code": "USD"}, "presentment_money": {"amount": "20.34", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "18.00", "currency_code": "USD"}, "presentment_money": {"amount": "18.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "2.34", "currency_code": "USD"}, "presentment_money": {"amount": "2.34", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "2.00", "currency_code": "USD"}, "presentment_money": {"amount": "2.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920481", "customer": null}})); + it('test_6', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920481, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:56-05:00", "updated_at": "2023-01-03T12:58:56-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630386, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630386"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/46a7191808bee9d2bb0979533fa3b4b4", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "tags": "", "note_attributes": [], "total_price": "11.30", "subtotal_price": "10.00", "total_tax": "1.30", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "11.30", "currency_code": "USD"}, "presentment_money": {"amount": "11.30", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "1.30", "currency_code": "USD"}, "presentment_money": {"amount": "1.30", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920481"}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -218,9 +196,9 @@ describe('DraftOrder resource', () => { "quantity": 1, "applied_discount": { "description": "Custom discount", - "value_type": "percentage", + "value_type": "fixed_amount", "value": "10.0", - "amount": "2.0", + "amount": "10.0", "title": "Custom" } } @@ -233,12 +211,34 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-07/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "2.0", "title": "Custom"}}]} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.0", "title": "Custom"}}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920480, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:45-05:00", "updated_at": "2023-01-03T12:58:45-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630385, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630385"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/42fb27c2a95082c0217255df38363371", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920480"}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D4", "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D4", "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869", "customer": null}]})); + queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D4", "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D4", "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869"}]})); await shopify.rest.DraftOrder.all({ session: session, @@ -255,11 +255,17 @@ describe('DraftOrder resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "Customer contacted us about a custom engraving on this iPod", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:19:57-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "194.00", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:49-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "19.90", "value_type": "percentage"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "179.10", "subtotal_price": "179.10", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "19.90", "currency_code": "USD"}, "presentment_money": {"amount": "19.90", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - draft_order.note = "Customer contacted us about a custom engraving on this iPod"; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "percentage", + "value": "10.0", + "amount": "19.90", + "title": "Custom" + }; await draft_order.save({}); expect({ @@ -268,22 +274,16 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-07/draft_orders/994118539.json', query: '', headers, - data: { "draft_order": {"note": "Customer contacted us about a custom engraving on this iPod"} } + data: { "draft_order": {"applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "19.90", "title": "Custom"}} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:20:17-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "19.90", "value_type": "percentage"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "179.10", "subtotal_price": "179.10", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "19.90", "currency_code": "USD"}, "presentment_money": {"amount": "19.90", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "Customer contacted us about a custom engraving on this iPod", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:47-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "194.00", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - draft_order.applied_discount = { - "description": "Custom discount", - "value_type": "percentage", - "value": "10.0", - "amount": "19.90", - "title": "Custom" - }; + draft_order.note = "Customer contacted us about a custom engraving on this iPod"; await draft_order.save({}); expect({ @@ -292,12 +292,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-07/draft_orders/994118539.json', query: '', headers, - data: { "draft_order": {"applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "19.90", "title": "Custom"}} } + data: { "draft_order": {"note": "Customer contacted us about a custom engraving on this iPod"} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); await shopify.rest.DraftOrder.find({ session: session, @@ -350,12 +350,12 @@ describe('DraftOrder resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "bob.norman@mail.example.com", "from": "j.smith@example.com", "subject": "Draft Order #D2", "custom_message": "", "bcc": []}})); + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!", "bcc": ["j.smith@example.com"]}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; await draft_order.send_invoice({ - body: {"draft_order_invoice": {}}, + body: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}}, }); expect({ @@ -364,17 +364,17 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-07/draft_orders/994118539/send_invoice.json', query: '', headers, - data: {"draft_order_invoice": {}} + data: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}} }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!", "bcc": ["j.smith@example.com"]}})); + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "bob.norman@mail.example.com", "from": "j.smith@example.com", "subject": "Draft Order #D2", "custom_message": "", "bcc": []}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; await draft_order.send_invoice({ - body: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}}, + body: {"draft_order_invoice": {}}, }); expect({ @@ -383,41 +383,41 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-07/draft_orders/994118539/send_invoice.json', query: '', headers, - data: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}} + data: {"draft_order_invoice": {}} }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"email": "bob.norman@mail.example.com", "id": 994118539, "note": "rush order", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:19:56-04:00", "tax_exempt": false, "completed_at": "2022-10-03T12:19:56-04:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459962, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": false}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:20-05:00", "tax_exempt": false, "completed_at": "2023-01-03T12:58:20-05:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459975, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:20-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 2, "state": "disabled", "total_spent": "405.90", "last_order_id": 1073459975, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1002", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317316, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - await draft_order.complete({ - payment_pending: "true", - }); + await draft_order.complete({}); expect({ method: 'PUT', domain, path: '/admin/api/2022-07/draft_orders/994118539/complete.json', - query: 'payment_pending=true', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"email": "bob.norman@mail.example.com", "id": 994118539, "note": "rush order", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:20:08-04:00", "tax_exempt": false, "completed_at": "2022-10-03T12:20:08-04:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459963, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": false}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:36-05:00", "tax_exempt": false, "completed_at": "2023-01-03T12:58:36-05:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459976, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 2, "state": "disabled", "total_spent": "405.90", "last_order_id": 1073459976, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1002", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317319, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - await draft_order.complete({}); + await draft_order.complete({ + payment_pending: "true", + }); expect({ method: 'PUT', domain, path: '/admin/api/2022-07/draft_orders/994118539/complete.json', - query: '', + query: 'payment_pending=true', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-07/fulfillment.test.ts b/rest/admin/__tests__/2022-07/fulfillment.test.ts index 7a8869940..6539052c1 100644 --- a/rest/admin/__tests__/2022-07/fulfillment.test.ts +++ b/rest/admin/__tests__/2022-07/fulfillment.test.ts @@ -31,54 +31,54 @@ describe('Fulfillment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019884, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:18-04:00", "service": "shipwire-app", "updated_at": "2022-10-21T08:57:18-04:00", "tracking_company": "TNT", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "shipwire-app", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shipwire-app", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789", "tracking_urls": ["https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019884"}]})); + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}]})); await shopify.rest.Fulfillment.all({ session: session, order_id: 450789469, - since_id: "255858046", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/orders/450789469/fulfillments.json', - query: 'since_id=255858046', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillments": [{"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:56:20-04:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}]})); + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019883, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:45-05:00", "service": "shipwire-app", "updated_at": "2023-01-03T12:29:45-05:00", "tracking_company": "TNT", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "shipwire-app", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shipwire-app", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789", "tracking_urls": ["https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019883"}]})); await shopify.rest.Fulfillment.all({ session: session, order_id: 450789469, + since_id: "255858046", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/orders/450789469/fulfillments.json', - query: '', + query: 'since_id=255858046', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019901, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:56:20-04:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823190, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823190", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019901"}]})); + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019874, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823194, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823194", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019874"}]})); await shopify.rest.Fulfillment.all({ session: session, - fulfillment_order_id: 1046000823, + fulfillment_order_id: 1046000790, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000823/fulfillments.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000790/fulfillments.json', query: '', headers, data: undefined @@ -104,7 +104,7 @@ describe('Fulfillment resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:56:20-04:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); await shopify.rest.Fulfillment.find({ session: session, @@ -123,7 +123,7 @@ describe('Fulfillment resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019888, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:29-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:29-04:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823185, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019888"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019869, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:52-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:52-05:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823189, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823189", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019869"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.message = "The package was shipped this morning."; @@ -135,7 +135,13 @@ describe('Fulfillment resource', () => { }; fulfillment.line_items_by_fulfillment_order = [ { - "fulfillment_order_id": 1046000807 + "fulfillment_order_id": 1046000785, + "fulfillment_order_line_items": [ + { + "id": 1058737495, + "quantity": 1 + } + ] } ]; await fulfillment.save({}); @@ -146,12 +152,12 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-07/fulfillments.json', query: '', headers, - data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000807}]} } + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000785, "fulfillment_order_line_items": [{"id": 1058737495, "quantity": 1}]}]} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019894, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:51-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:51-04:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823189, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823189", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019894"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019865, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:37-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:37-05:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823187, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823187", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019865"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.message = "The package was shipped this morning."; @@ -163,13 +169,7 @@ describe('Fulfillment resource', () => { }; fulfillment.line_items_by_fulfillment_order = [ { - "fulfillment_order_id": 1046000813, - "fulfillment_order_line_items": [ - { - "id": 1058737556, - "quantity": 1 - } - ] + "fulfillment_order_id": 1046000780 } ]; await fulfillment.save({}); @@ -180,15 +180,15 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-07/fulfillments.json', query: '', headers, - data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000813, "fulfillment_order_line_items": [{"id": 1058737556, "quantity": 1}]}]} } + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000780}]} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"tracking_company": "my-company", "location_id": 24826418, "id": 1069019889, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:33-04:00", "shipment_status": null, "line_items": [{"id": 1071823186, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823186", "tax_lines": []}], "tracking_number": "1111", "tracking_numbers": ["1111"], "tracking_url": "http://www.my-url.com", "tracking_urls": ["http://www.my-url.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019889"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"tracking_company": "my-company", "location_id": 24826418, "id": 1069019871, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:57-05:00", "shipment_status": null, "line_items": [{"id": 1071823192, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823192", "tax_lines": []}], "tracking_number": "1111", "tracking_numbers": ["1111"], "tracking_url": "http://www.my-url.com", "tracking_urls": ["http://www.my-url.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019871"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); - fulfillment.id = 1069019889; + fulfillment.id = 1069019871; await fulfillment.update_tracking({ body: {"fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com", "company": "my-company"}}}, }); @@ -196,7 +196,7 @@ describe('Fulfillment resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillments/1069019889/update_tracking.json', + path: '/admin/api/2022-07/fulfillments/1069019871/update_tracking.json', query: '', headers, data: { "fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com", "company": "my-company"}} } @@ -204,16 +204,16 @@ describe('Fulfillment resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 24826418, "id": 1069019883, "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:13-04:00", "tracking_company": "UPS", "shipment_status": null, "line_items": [{"id": 1071823182, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019883"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 24826418, "id": 1069019870, "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:54-05:00", "tracking_company": "UPS", "shipment_status": null, "line_items": [{"id": 1071823190, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823190", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019870"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); - fulfillment.id = 1069019883; + fulfillment.id = 1069019870; await fulfillment.cancel({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillments/1069019883/cancel.json', + path: '/admin/api/2022-07/fulfillments/1069019870/cancel.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/fulfillment_event.test.ts b/rest/admin/__tests__/2022-07/fulfillment_event.test.ts index 110f6e043..61c4da49d 100644 --- a/rest/admin/__tests__/2022-07/fulfillment_event.test.ts +++ b/rest/admin/__tests__/2022-07/fulfillment_event.test.ts @@ -31,7 +31,7 @@ describe('FulfillmentEvent resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_events": [{"id": 944956394, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2022-10-03T13:13:46-04:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2022-10-03T13:13:46-04:00", "updated_at": "2022-10-03T13:13:46-04:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956394"}]})); + queueMockResponse(JSON.stringify({"fulfillment_events": [{"id": 944956391, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:58:57-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:58:57-05:00", "updated_at": "2023-01-03T12:58:57-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956391"}]})); await shopify.rest.FulfillmentEvent.all({ session: session, @@ -50,7 +50,7 @@ describe('FulfillmentEvent resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956392, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2022-10-03T13:13:41-04:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2022-10-03T13:13:41-04:00", "updated_at": "2022-10-03T13:13:41-04:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956392"}})); + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956392, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:59:00-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:59:00-05:00", "updated_at": "2023-01-03T12:59:00-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956392"}})); const fulfillment_event = new shopify.rest.FulfillmentEvent({session: session}); fulfillment_event.order_id = 450789469; @@ -69,7 +69,7 @@ describe('FulfillmentEvent resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956393, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2022-10-03T13:13:43-04:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2022-10-03T13:13:43-04:00", "updated_at": "2022-10-03T13:13:43-04:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956393"}})); + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956393, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:59:00-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:59:00-05:00", "updated_at": "2023-01-03T12:59:00-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956393"}})); await shopify.rest.FulfillmentEvent.find({ session: session, @@ -95,13 +95,13 @@ describe('FulfillmentEvent resource', () => { session: session, order_id: 450789469, fulfillment_id: 255858046, - id: 944956391, + id: 944956394, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/orders/450789469/fulfillments/255858046/events/944956391.json', + path: '/admin/api/2022-07/orders/450789469/fulfillments/255858046/events/944956394.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/fulfillment_order.test.ts b/rest/admin/__tests__/2022-07/fulfillment_order.test.ts index 2b42bc42e..9e55a30f0 100644 --- a/rest/admin/__tests__/2022-07/fulfillment_order.test.ts +++ b/rest/admin/__tests__/2022-07/fulfillment_order.test.ts @@ -31,7 +31,7 @@ describe('FulfillmentOrder resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000840, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000840, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737539, "shop_id": 548380009, "fulfillment_order_id": 1046000840, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000823, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000815, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737562, "shop_id": 548380009, "fulfillment_order_id": 1046000823, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); await shopify.rest.FulfillmentOrder.all({ session: session, @@ -49,17 +49,17 @@ describe('FulfillmentOrder resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000843, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000843, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000843, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000825, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000817, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737564, "shop_id": 548380009, "fulfillment_order_id": 1046000825, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); await shopify.rest.FulfillmentOrder.find({ session: session, - id: 1046000843, + id: 1046000825, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000843.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000825.json', query: '', headers, data: undefined @@ -67,16 +67,16 @@ describe('FulfillmentOrder resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000836, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000836, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "replacement_fulfillment_order": {"id": 1046000837, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000837, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737536, "shop_id": 548380009, "fulfillment_order_id": 1046000837, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000815, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000807, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "replacement_fulfillment_order": {"id": 1046000816, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000808, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737555, "shop_id": 548380009, "fulfillment_order_id": 1046000816, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000836; + fulfillment_order.id = 1046000815; await fulfillment_order.cancel({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000836/cancel.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000815/cancel.json', query: '', headers, data: undefined @@ -84,10 +84,10 @@ describe('FulfillmentOrder resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000849, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "closed", "status": "incomplete", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000849, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737548, "shop_id": 548380009, "fulfillment_order_id": 1046000849, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000819, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "closed", "status": "incomplete", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000811, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737558, "shop_id": 548380009, "fulfillment_order_id": 1046000819, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000849; + fulfillment_order.id = 1046000819; await fulfillment_order.close({ body: {"fulfillment_order": {"message": "Not enough inventory to complete this work."}}, }); @@ -95,7 +95,7 @@ describe('FulfillmentOrder resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000849/close.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000819/close.json', query: '', headers, data: { "fulfillment_order": {"message": "Not enough inventory to complete this work."} } @@ -103,10 +103,10 @@ describe('FulfillmentOrder resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000846, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 487838322, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000846, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737545, "shop_id": 548380009, "fulfillment_order_id": 1046000846, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "moved_fulfillment_order": {"id": 1046000847, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 655441491, "request_status": "unsubmitted", "status": "open", "supported_actions": ["create_fulfillment", "move"], "destination": {"id": 1046000847, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737546, "shop_id": 548380009, "fulfillment_order_id": 1046000847, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "country_code": "CA", "location_id": 655441491, "name": "50 Rideau Street", "phone": null, "province": "Ontario", "zip": "K1N 9J7"}, "merchant_requests": []}, "remaining_fulfillment_order": null})); + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000821, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 487838322, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000813, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737560, "shop_id": 548380009, "fulfillment_order_id": 1046000821, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "moved_fulfillment_order": {"id": 1046000822, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 655441491, "request_status": "unsubmitted", "status": "open", "supported_actions": ["create_fulfillment", "move"], "destination": {"id": 1046000814, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737561, "shop_id": 548380009, "fulfillment_order_id": 1046000822, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "country_code": "CA", "location_id": 655441491, "name": "50 Rideau Street", "phone": null, "province": "Ontario", "zip": "K1N 9J7"}, "merchant_requests": []}, "remaining_fulfillment_order": null})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000846; + fulfillment_order.id = 1046000821; await fulfillment_order.move({ body: {"fulfillment_order": {"new_location_id": 655441491}}, }); @@ -114,7 +114,7 @@ describe('FulfillmentOrder resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000846/move.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000821/move.json', query: '', headers, data: { "fulfillment_order": {"new_location_id": 655441491} } @@ -122,16 +122,16 @@ describe('FulfillmentOrder resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000845, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000845, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737544, "shop_id": 548380009, "fulfillment_order_id": 1046000845, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000828, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000820, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737567, "shop_id": 548380009, "fulfillment_order_id": 1046000828, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000845; + fulfillment_order.id = 1046000828; await fulfillment_order.open({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000845/open.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000828/open.json', query: '', headers, data: undefined @@ -139,29 +139,29 @@ describe('FulfillmentOrder resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000841, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "scheduled", "supported_actions": ["mark_as_open"], "destination": {"id": 1046000841, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000841, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": "2023-11-19T03:43:00-05:00", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000824, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "scheduled", "supported_actions": ["mark_as_open"], "destination": {"id": 1046000816, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737563, "shop_id": 548380009, "fulfillment_order_id": 1046000824, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": "2024-02-03T12:57:00-05:00", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000841; + fulfillment_order.id = 1046000824; await fulfillment_order.reschedule({ - body: {"fulfillment_order": {"new_fulfill_at": "2023-11-19 08:43 UTC"}}, + body: {"fulfillment_order": {"new_fulfill_at": "2024-02-03 17:57 UTC"}}, }); expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000841/reschedule.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000824/reschedule.json', query: '', headers, - data: { "fulfillment_order": {"new_fulfill_at": "2023-11-19 08:43 UTC"} } + data: { "fulfillment_order": {"new_fulfill_at": "2024-02-03 17:57 UTC"} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000848, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "on_hold", "supported_actions": ["release_hold"], "destination": {"id": 1046000848, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737547, "shop_id": 548380009, "fulfillment_order_id": 1046000848, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [{"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000826, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "on_hold", "supported_actions": ["release_hold"], "destination": {"id": 1046000818, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737565, "shop_id": 548380009, "fulfillment_order_id": 1046000826, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [{"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000848; + fulfillment_order.id = 1046000826; await fulfillment_order.hold({ body: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}}, }); @@ -169,7 +169,7 @@ describe('FulfillmentOrder resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000848/hold.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000826/hold.json', query: '', headers, data: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}} @@ -182,7 +182,7 @@ describe('FulfillmentOrder resource', () => { const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); await fulfillment_order.set_fulfillment_orders_deadline({ - body: {"fulfillment_order_ids": [1046000838], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"}, + body: {"fulfillment_order_ids": [1046000818], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"}, }); expect({ @@ -191,21 +191,21 @@ describe('FulfillmentOrder resource', () => { path: '/admin/api/2022-07/fulfillment_orders/set_fulfillment_orders_deadline.json', query: '', headers, - data: {"fulfillment_order_ids": [1046000838], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"} + data: {"fulfillment_order_ids": [1046000818], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"} }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000839, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000839, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737538, "shop_id": 548380009, "fulfillment_order_id": 1046000839, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000820, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000812, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737559, "shop_id": 548380009, "fulfillment_order_id": 1046000820, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000839; + fulfillment_order.id = 1046000820; await fulfillment_order.release_hold({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000839/release_hold.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000820/release_hold.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/fulfillment_request.test.ts b/rest/admin/__tests__/2022-07/fulfillment_request.test.ts index 9b7361819..376b0f9e2 100644 --- a/rest/admin/__tests__/2022-07/fulfillment_request.test.ts +++ b/rest/admin/__tests__/2022-07/fulfillment_request.test.ts @@ -31,56 +31,56 @@ describe('FulfillmentRequest resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000798, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000795, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737501, "shop_id": 548380009, "fulfillment_order_id": 1046000798, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737502, "shop_id": 548380009, "fulfillment_order_id": 1046000798, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737503, "shop_id": 548380009, "fulfillment_order_id": 1046000798, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000799, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000796, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737504, "shop_id": 548380009, "fulfillment_order_id": 1046000799, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737505, "shop_id": 548380009, "fulfillment_order_id": 1046000799, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2022-10-03T13:19:53-04:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": {"id": 1046000800, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000797, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737506, "shop_id": 548380009, "fulfillment_order_id": 1046000800, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000809, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000801, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737541, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:15-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000809, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000801, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737541, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:15-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": null})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000798; + fulfillment_request.fulfillment_order_id = 1046000809; fulfillment_request.message = "Fulfill this ASAP please."; - fulfillment_request.fulfillment_order_line_items = [ - { - "id": 1058737501, - "quantity": 1 - }, - { - "id": 1058737502, - "quantity": 1 - } - ]; await fulfillment_request.save({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000798/fulfillment_request.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000809/fulfillment_request.json', query: '', headers, - data: { "fulfillment_request": {"message": "Fulfill this ASAP please.", "fulfillment_order_line_items": [{"id": 1058737501, "quantity": 1}, {"id": 1058737502, "quantity": 1}]} } + data: { "fulfillment_request": {"message": "Fulfill this ASAP please."} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000803, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737513, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737514, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737515, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2022-10-03T13:20:20-04:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000803, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737513, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737514, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737515, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2022-10-03T13:20:20-04:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": null})); + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000812, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000804, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737549, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737550, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737551, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000813, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000805, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737552, "shop_id": 548380009, "fulfillment_order_id": 1046000813, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737553, "shop_id": 548380009, "fulfillment_order_id": 1046000813, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:27-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": {"id": 1046000814, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000806, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737554, "shop_id": 548380009, "fulfillment_order_id": 1046000814, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000803; + fulfillment_request.fulfillment_order_id = 1046000812; fulfillment_request.message = "Fulfill this ASAP please."; + fulfillment_request.fulfillment_order_line_items = [ + { + "id": 1058737549, + "quantity": 1 + }, + { + "id": 1058737550, + "quantity": 1 + } + ]; await fulfillment_request.save({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000803/fulfillment_request.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000812/fulfillment_request.json', query: '', headers, - data: { "fulfillment_request": {"message": "Fulfill this ASAP please."} } + data: { "fulfillment_request": {"message": "Fulfill this ASAP please.", "fulfillment_order_line_items": [{"id": 1058737549, "quantity": 1}, {"id": 1058737550, "quantity": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000801, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "accepted", "status": "in_progress", "supported_actions": ["request_cancellation", "create_fulfillment"], "destination": {"id": 1046000798, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737507, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737508, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737509, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000810, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "accepted", "status": "in_progress", "supported_actions": ["request_cancellation", "create_fulfillment"], "destination": {"id": 1046000802, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737543, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737544, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737545, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000801; + fulfillment_request.fulfillment_order_id = 1046000810; await fulfillment_request.accept({ body: {"fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."}}, }); @@ -88,7 +88,7 @@ describe('FulfillmentRequest resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000801/fulfillment_request/accept.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000810/fulfillment_request/accept.json', query: '', headers, data: { "fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."} } @@ -96,21 +96,21 @@ describe('FulfillmentRequest resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000802, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "rejected", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000799, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737510, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737511, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737512, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000811, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "rejected", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000803, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737546, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737547, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737548, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000802; + fulfillment_request.fulfillment_order_id = 1046000811; await fulfillment_request.reject({ - body: {"fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737510, "message": "Not enough inventory."}]}}, + body: {"fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737546, "message": "Not enough inventory."}]}}, }); expect({ method: 'POST', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000802/fulfillment_request/reject.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000811/fulfillment_request/reject.json', query: '', headers, - data: { "fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737510, "message": "Not enough inventory."}]} } + data: { "fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737546, "message": "Not enough inventory."}]} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/fulfillment_service.test.ts b/rest/admin/__tests__/2022-07/fulfillment_service.test.ts index f379f2273..96948cf6f 100644 --- a/rest/admin/__tests__/2022-07/fulfillment_service.test.ts +++ b/rest/admin/__tests__/2022-07/fulfillment_service.test.ts @@ -66,7 +66,7 @@ describe('FulfillmentService resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 1061774524, "name": "Jupiter Fulfillment", "email": null, "service_name": "Jupiter Fulfillment", "handle": "jupiter-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 1072404579, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/1061774524", "permits_sku_sharing": true}})); + queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 1061774488, "name": "Jupiter Fulfillment", "email": null, "service_name": "Jupiter Fulfillment", "handle": "jupiter-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 1072404543, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/1061774488", "permits_sku_sharing": true}})); const fulfillment_service = new shopify.rest.FulfillmentService({session: session}); fulfillment_service.name = "Jupiter Fulfillment"; diff --git a/rest/admin/__tests__/2022-07/gift_card.test.ts b/rest/admin/__tests__/2022-07/gift_card.test.ts index 0eaca105c..df0e4894e 100644 --- a/rest/admin/__tests__/2022-07/gift_card.test.ts +++ b/rest/admin/__tests__/2022-07/gift_card.test.ts @@ -31,79 +31,42 @@ describe('GiftCard resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1035197676, "balance": "100.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}, {"id": 766118925, "balance": "25.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2021-10-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 766118925, "balance": "25.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2022-01-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); await shopify.rest.GiftCard.all({ session: session, + status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/gift_cards.json', - query: '', + query: 'status=enabled', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"gift_cards": [{"id": 766118925, "balance": "25.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2021-10-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1035197676, "balance": "100.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}, {"id": 766118925, "balance": "25.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2022-01-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); await shopify.rest.GiftCard.all({ session: session, - status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/gift_cards.json', - query: 'status=enabled', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936316, "balance": "25.00", "created_at": "2022-10-03T12:50:53-04:00", "updated_at": "2022-10-03T12:50:53-04:00", "currency": "USD", "initial_value": "25.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "ce2g", "order_id": null, "code": "b72c6222b9chce2g"}})); - - const gift_card = new shopify.rest.GiftCard({session: session}); - gift_card.initial_value = 25.0; - await gift_card.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-07/gift_cards.json', - query: '', - headers, - data: { "gift_card": {"initial_value": 25.0} } - }).toMatchMadeHttpRequest(); - }); - - it('test_4', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936319, "balance": "100.00", "created_at": "2022-10-03T12:51:09-04:00", "updated_at": "2022-10-03T12:51:09-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": "This is a note", "expires_on": null, "template_suffix": "gift_cards.birthday.liquid", "last_characters": "mnop", "order_id": null, "code": "abcdefghijklmnop"}})); - - const gift_card = new shopify.rest.GiftCard({session: session}); - gift_card.note = "This is a note"; - gift_card.initial_value = 100.0; - gift_card.code = "ABCD EFGH IJKL MNOP"; - gift_card.template_suffix = "gift_cards.birthday.liquid"; - await gift_card.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-07/gift_cards.json', - query: '', - headers, - data: { "gift_card": {"note": "This is a note", "initial_value": 100.0, "code": "ABCD EFGH IJKL MNOP", "template_suffix": "gift_cards.birthday.liquid"} } - }).toMatchMadeHttpRequest(); - }); - - it('test_5', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"id": 1035197676, "balance": "100.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}})); + queueMockResponse(JSON.stringify({"gift_card": {"id": 1035197676, "balance": "100.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}})); await shopify.rest.GiftCard.find({ session: session, @@ -120,12 +83,12 @@ describe('GiftCard resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"note": "Updating with a new note", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:58-04:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + it('test_4', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"expires_on": "2020-01-01", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:02-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "last_characters": "0d0d", "order_id": null}})); const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; - gift_card.note = "Updating with a new note"; + gift_card.expires_on = "2020-01-01"; await gift_card.save({}); expect({ @@ -134,16 +97,16 @@ describe('GiftCard resource', () => { path: '/admin/api/2022-07/gift_cards/1035197676.json', query: '', headers, - data: { "gift_card": {"note": "Updating with a new note"} } + data: { "gift_card": {"expires_on": "2020-01-01"} } }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"expires_on": "2020-01-01", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:51:03-04:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "last_characters": "0d0d", "order_id": null}})); + it('test_5', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"note": "Updating with a new note", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:10-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; - gift_card.expires_on = "2020-01-01"; + gift_card.note = "Updating with a new note"; await gift_card.save({}); expect({ @@ -152,47 +115,84 @@ describe('GiftCard resource', () => { path: '/admin/api/2022-07/gift_cards/1035197676.json', query: '', headers, - data: { "gift_card": {"expires_on": "2020-01-01"} } + data: { "gift_card": {"note": "Updating with a new note"} } }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { + it('test_6', async () => { queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.GiftCard.count({ session: session, - status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/gift_cards/count.json', - query: 'status=enabled', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_9', async () => { + it('test_7', async () => { queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.GiftCard.count({ session: session, + status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/gift_cards/count.json', - query: '', + query: 'status=enabled', headers, data: undefined }).toMatchMadeHttpRequest(); }); + it('test_8', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936318, "balance": "100.00", "created_at": "2023-01-03T12:30:11-05:00", "updated_at": "2023-01-03T12:30:11-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": "This is a note", "expires_on": null, "template_suffix": "gift_cards.birthday.liquid", "last_characters": "mnop", "order_id": null, "code": "abcdefghijklmnop"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.note = "This is a note"; + gift_card.initial_value = 100.0; + gift_card.code = "ABCD EFGH IJKL MNOP"; + gift_card.template_suffix = "gift_cards.birthday.liquid"; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"note": "This is a note", "initial_value": 100.0, "code": "ABCD EFGH IJKL MNOP", "template_suffix": "gift_cards.birthday.liquid"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936317, "balance": "25.00", "created_at": "2023-01-03T12:30:08-05:00", "updated_at": "2023-01-03T12:30:08-05:00", "currency": "USD", "initial_value": "25.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "fc53", "order_id": null, "code": "58he9ffdhhc4fc53"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.initial_value = 25.0; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"initial_value": 25.0} } + }).toMatchMadeHttpRequest(); + }); + it('test_10', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"disabled_at": "2022-10-03T12:50:50-04:00", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:50-04:00", "currency": "USD", "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + queueMockResponse(JSON.stringify({"gift_card": {"disabled_at": "2023-01-03T12:30:07-05:00", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:07-05:00", "currency": "USD", "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; @@ -211,7 +211,7 @@ describe('GiftCard resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1063936318, "balance": "10.00", "created_at": "2022-10-03T12:51:07-04:00", "updated_at": "2022-10-03T12:51:07-04:00", "currency": "USD", "initial_value": "10.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "mnop", "order_id": null}]})); + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1063936316, "balance": "10.00", "created_at": "2023-01-03T12:30:02-05:00", "updated_at": "2023-01-03T12:30:02-05:00", "currency": "USD", "initial_value": "10.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "mnop", "order_id": null}]})); await shopify.rest.GiftCard.search({ session: session, diff --git a/rest/admin/__tests__/2022-07/gift_card_adjustment.test.ts b/rest/admin/__tests__/2022-07/gift_card_adjustment.test.ts index 4cccf9b84..54c8249ca 100644 --- a/rest/admin/__tests__/2022-07/gift_card_adjustment.test.ts +++ b/rest/admin/__tests__/2022-07/gift_card_adjustment.test.ts @@ -31,7 +31,7 @@ describe('GiftCardAdjustment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"adjustments": [{"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}]})); + queueMockResponse(JSON.stringify({"adjustments": [{"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}]})); await shopify.rest.GiftCardAdjustment.all({ session: session, @@ -49,12 +49,13 @@ describe('GiftCardAdjustment resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273909, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-04-03T13:10:51-04:00", "created_at": "2022-10-03T13:10:51-04:00", "updated_at": "2022-10-03T13:10:51-04:00", "note": null, "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273912, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2023-01-03T12:44:55-05:00", "created_at": "2023-01-03T12:44:55-05:00", "updated_at": "2023-01-03T12:44:55-05:00", "note": null, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; gift_card_adjustment.amount = 10.0; - gift_card_adjustment.processed_at = "2022-04-03T13:10:51-04:00"; + gift_card_adjustment.remote_transaction_ref = "gift_card_app_transaction_193402"; + gift_card_adjustment.remote_transaction_url = "http://example.com/my-gift-card-app/gift_card_adjustments/193402"; await gift_card_adjustment.save({}); expect({ @@ -63,12 +64,12 @@ describe('GiftCardAdjustment resource', () => { path: '/admin/api/2022-07/gift_cards/1035197676/adjustments.json', query: '', headers, - data: { "adjustment": {"amount": 10.0, "processed_at": "2022-04-03T13:10:51-04:00"} } + data: { "adjustment": {"amount": 10.0, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273910, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-10-03T13:10:53-04:00", "created_at": "2022-10-03T13:10:53-04:00", "updated_at": "2022-10-03T13:10:53-04:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273911, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2023-01-03T12:44:54-05:00", "created_at": "2023-01-03T12:44:54-05:00", "updated_at": "2023-01-03T12:44:54-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; @@ -87,7 +88,7 @@ describe('GiftCardAdjustment resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273911, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "-20.00", "processed_at": "2022-10-03T13:10:54-04:00", "created_at": "2022-10-03T13:10:54-04:00", "updated_at": "2022-10-03T13:10:54-04:00", "note": "Customer spent $20 via external service", "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273913, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "-20.00", "processed_at": "2023-01-03T12:44:57-05:00", "created_at": "2023-01-03T12:44:57-05:00", "updated_at": "2023-01-03T12:44:57-05:00", "note": "Customer spent $20 via external service", "remote_transaction_ref": null, "remote_transaction_url": null}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; @@ -106,13 +107,12 @@ describe('GiftCardAdjustment resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273912, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-10-03T13:10:57-04:00", "created_at": "2022-10-03T13:10:57-04:00", "updated_at": "2022-10-03T13:10:57-04:00", "note": null, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273910, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-07-03T12:44:50-04:00", "created_at": "2023-01-03T12:44:50-05:00", "updated_at": "2023-01-03T12:44:50-05:00", "note": null, "remote_transaction_ref": null, "remote_transaction_url": null}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; gift_card_adjustment.amount = 10.0; - gift_card_adjustment.remote_transaction_ref = "gift_card_app_transaction_193402"; - gift_card_adjustment.remote_transaction_url = "http://example.com/my-gift-card-app/gift_card_adjustments/193402"; + gift_card_adjustment.processed_at = "2022-07-03T12:44:50-04:00"; await gift_card_adjustment.save({}); expect({ @@ -121,12 +121,12 @@ describe('GiftCardAdjustment resource', () => { path: '/admin/api/2022-07/gift_cards/1035197676/adjustments.json', query: '', headers, - data: { "adjustment": {"amount": 10.0, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"} } + data: { "adjustment": {"amount": 10.0, "processed_at": "2022-07-03T12:44:50-04:00"} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); await shopify.rest.GiftCardAdjustment.find({ session: session, diff --git a/rest/admin/__tests__/2022-07/image.test.ts b/rest/admin/__tests__/2022-07/image.test.ts index b78bbe29b..77477e6fb 100644 --- a/rest/admin/__tests__/2022-07/image.test.ts +++ b/rest/admin/__tests__/2022-07/image.test.ts @@ -31,290 +31,290 @@ describe('Image resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"images": [{"id": 1001473895, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:29-04:00", "updated_at": "2022-10-03T12:20:29-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814029", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473895"}]})); + queueMockResponse(JSON.stringify({"images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]})); await shopify.rest.Image.all({ session: session, product_id: 632910392, - since_id: "850703190", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products/632910392/images.json', - query: 'since_id=850703190', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]})); + queueMockResponse(JSON.stringify({"images": [{"id": 1001473900, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:38:59-05:00", "updated_at": "2023-01-03T12:38:59-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767539", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473900"}]})); await shopify.rest.Image.all({ session: session, product_id: 632910392, + since_id: "850703190", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products/632910392/images.json', - query: '', + query: 'since_id=850703190', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"count": 3})); + queueMockResponse(JSON.stringify({"image": {"width": 110, "height": 140, "position": 1, "alt": null, "id": 1001473901, "product_id": 632910392, "created_at": "2023-01-03T12:39:02-05:00", "updated_at": "2023-01-03T12:39:02-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767542", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473901"}})); - await shopify.rest.Image.count({ - session: session, - product_id: 632910392, - }); + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7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P0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392/images/count.json', + path: '/admin/api/2022-07/products/632910392/images.json', query: '', headers, - data: undefined + data: { "image": {"position": 1, "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8W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2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"count": 0})); + queueMockResponse(JSON.stringify({"image": {"id": 1001473905, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:39:23-05:00", "updated_at": "2023-01-03T12:39:23-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767563", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473905"}})); - await shopify.rest.Image.count({ - session: session, - product_id: 632910392, - since_id: "850703190", - }); + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.variant_ids = [ + 808950810, + 457924702 + ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aq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O7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392/images/count.json', - query: 'since_id=850703190', + path: '/admin/api/2022-07/products/632910392/images.json', + query: '', headers, - data: undefined + data: { "image": {"variant_ids": [808950810, 457924702], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhF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eB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"image": {"position": 1, "width": 110, "height": 140, "alt": null, "id": 1001473903, "product_id": 632910392, "created_at": "2023-01-03T12:39:08-05:00", "updated_at": "2023-01-03T12:39:08-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767548", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473903"}})); - await shopify.rest.Image.find({ - session: session, - product_id: 632910392, - id: 850703190, - }); + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up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XxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392/images/850703190.json', + path: '/admin/api/2022-07/products/632910392/images.json', query: '', headers, - data: undefined + data: { "image": {"position": 1, "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIr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q0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 2, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:20:39-04:00", "alt": "new alt tag content", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664814039", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"image": {"id": 1001473904, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:39:10-05:00", "updated_at": "2023-01-03T12:39:10-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-c155h.gif?v=1672767550", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473904"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.id = 850703190; - image.position = 2; - image.alt = "new alt tag content"; + image.src = "http://example.com/rails_logo.gif"; await image.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392/images/850703190.json', + path: '/admin/api/2022-07/products/632910392/images.json', query: '', headers, - data: { "image": {"position": 2, "alt": "new alt tag content"} } + data: { "image": {"src": "http://example.com/rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"image": {"updated_at": "2022-10-03T12:20:45-04:00", "id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664814045", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"image": {"id": 1001473896, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:38:46-05:00", "updated_at": "2023-01-03T12:38:46-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767526", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473896"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.id = 850703190; - image.metafields = [ - { - "key": "my_new_metafield", - "value": "my_new_value", - "type": "single_line_text_field", - "namespace": "tags" - } - ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKK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+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; await image.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392/images/850703190.json', + path: '/admin/api/2022-07/products/632910392/images.json', query: '', headers, - data: { "image": {"metafields": [{"key": "my_new_metafield", "value": "my_new_value", "type": "single_line_text_field", "namespace": "tags"}]} } + data: { "image": {"attachment": "R0lGODlhbgCMAPf/APbr48V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HbjlxygL31hO13tMrW7lwkB0BiUoR3x4EfmrYlCNjAF\nCRAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"count": 3})); - const image = new shopify.rest.Image({session: session}); - image.product_id = 632910392; - image.id = 850703190; - image.variant_ids = [ - 808950810, - 457924702 - ]; - await image.save({}); + await shopify.rest.Image.count({ + session: session, + product_id: 632910392, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-07/products/632910392/images/850703190.json', + path: '/admin/api/2022-07/products/632910392/images/count.json', query: '', headers, - data: { "image": {"variant_ids": [808950810, 457924702]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"count": 0})); - await shopify.rest.Image.delete({ + await shopify.rest.Image.count({ session: session, product_id: 632910392, - id: 850703190, + since_id: "850703190", }); expect({ - method: 'DELETE', + method: 'GET', domain, - path: '/admin/api/2022-07/products/632910392/images/850703190.json', - query: '', + path: '/admin/api/2022-07/products/632910392/images/count.json', + query: 'since_id=850703190', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 1001473896, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:33-04:00", "updated_at": "2022-10-03T12:20:33-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20221003-23488-mgiwm9.gif?v=1664814033", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473896"}})); + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); - const image = new shopify.rest.Image({session: session}); - image.product_id = 632910392; - image.src = "http://example.com/rails_logo.gif"; - await image.save({}); + await shopify.rest.Image.find({ + session: session, + product_id: 632910392, + id: 850703190, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/products/632910392/images.json', + path: '/admin/api/2022-07/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"src": "http://example.com/rails_logo.gif"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 1001473897, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:36-04:00", "updated_at": "2022-10-03T12:20:36-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814036", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473897"}})); + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:53-05:00", "alt": "new alt tag content", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672767533", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGd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JHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; + image.id = 850703190; + image.position = 2; + image.alt = "new alt tag content"; await image.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products/632910392/images.json', + path: '/admin/api/2022-07/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/P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l/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: { "image": {"position": 2, "alt": "new alt tag content"} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 1001473899, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:47-04:00", "updated_at": "2022-10-03T12:20:47-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814047", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473899"}})); + queueMockResponse(JSON.stringify({"image": {"updated_at": "2023-01-03T12:39:13-05:00", "id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672767553", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.variant_ids = [ - 808950810, - 457924702 + image.id = 850703190; + image.metafields = [ + { + "key": "my_new_metafield", + "value": "my_new_value", + "type": "single_line_text_field", + "namespace": "tags" + } ]; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uff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U2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; await image.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products/632910392/images.json', + path: '/admin/api/2022-07/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"variant_ids": [808950810, 457924702], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o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2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: { "image": {"metafields": [{"key": "my_new_metafield", "value": "my_new_value", "type": "single_line_text_field", "namespace": "tags"}]} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"image": {"position": 1, "width": 110, "height": 140, "alt": null, "id": 1001473900, "product_id": 632910392, "created_at": "2022-10-03T12:20:50-04:00", "updated_at": "2022-10-03T12:20:50-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814050", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473900"}})); + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.position = 1; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aM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OGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; + image.id = 850703190; + image.variant_ids = [ + 808950810, + 457924702 + ]; await image.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products/632910392/images.json', + path: '/admin/api/2022-07/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"position": 1, "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1ML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dLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: { "image": {"variant_ids": [808950810, 457924702]} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"image": {"width": 110, "height": 140, "position": 1, "alt": null, "id": 1001473904, "product_id": 632910392, "created_at": "2022-10-03T12:21:03-04:00", "updated_at": "2022-10-03T12:21:03-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814063", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473904"}})); + queueMockResponse(JSON.stringify({})); - const image = new shopify.rest.Image({session: session}); - image.product_id = 632910392; - image.position = 1; - image.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5c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CofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; - await image.save({}); + await shopify.rest.Image.delete({ + session: session, + product_id: 632910392, + id: 850703190, + }); expect({ - method: 'POST', + method: 'DELETE', domain, - path: '/admin/api/2022-07/products/632910392/images.json', + path: '/admin/api/2022-07/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"position": 1, "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXH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bnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: undefined }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/inventory_item.test.ts b/rest/admin/__tests__/2022-07/inventory_item.test.ts index b023acd66..b2055500b 100644 --- a/rest/admin/__tests__/2022-07/inventory_item.test.ts +++ b/rest/admin/__tests__/2022-07/inventory_item.test.ts @@ -31,7 +31,7 @@ describe('InventoryItem resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"inventory_items": [{"id": 39072856, "sku": "IPOD2008GREEN", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/39072856"}, {"id": 457924702, "sku": "IPOD2008BLACK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/457924702"}, {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}]})); + queueMockResponse(JSON.stringify({"inventory_items": [{"id": 39072856, "sku": "IPOD2008GREEN", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/39072856"}, {"id": 457924702, "sku": "IPOD2008BLACK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/457924702"}, {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}]})); await shopify.rest.InventoryItem.all({ session: session, @@ -49,7 +49,7 @@ describe('InventoryItem resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); await shopify.rest.InventoryItem.find({ session: session, @@ -67,7 +67,7 @@ describe('InventoryItem resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "new sku", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:11:09-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "new sku", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:07-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); const inventory_item = new shopify.rest.InventoryItem({session: session}); inventory_item.id = 808950810; @@ -85,7 +85,7 @@ describe('InventoryItem resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); const inventory_item = new shopify.rest.InventoryItem({session: session}); inventory_item.id = 808950810; diff --git a/rest/admin/__tests__/2022-07/inventory_level.test.ts b/rest/admin/__tests__/2022-07/inventory_level.test.ts index 70275c6ce..fcdb33487 100644 --- a/rest/admin/__tests__/2022-07/inventory_level.test.ts +++ b/rest/admin/__tests__/2022-07/inventory_level.test.ts @@ -31,7 +31,7 @@ describe('InventoryLevel resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 655441491, "available": 2, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 655441491, "available": 4, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 655441491, "available": 2, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 655441491, "available": 4, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); await shopify.rest.InventoryLevel.all({ session: session, @@ -49,44 +49,44 @@ describe('InventoryLevel resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}]})); await shopify.rest.InventoryLevel.all({ session: session, - inventory_item_ids: "808950810,39072856", - location_ids: "655441491,487838322", + inventory_item_ids: "808950810", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/inventory_levels.json', - query: 'inventory_item_ids=808950810%2C39072856&location_ids=655441491%2C487838322', + query: 'inventory_item_ids=808950810', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); await shopify.rest.InventoryLevel.all({ session: session, - inventory_item_ids: "808950810", + inventory_item_ids: "808950810,39072856", + location_ids: "655441491,487838322", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/inventory_levels.json', - query: 'inventory_item_ids=808950810', + query: 'inventory_item_ids=808950810%2C39072856&location_ids=655441491%2C487838322', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 6, "updated_at": "2022-10-03T13:14:39-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 6, "updated_at": "2023-01-03T13:03:33-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); const inventory_level = new shopify.rest.InventoryLevel({session: session}); @@ -124,7 +124,7 @@ describe('InventoryLevel resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 457924702, "location_id": 844681632, "available": 0, "updated_at": "2022-10-03T13:14:35-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702"}})); + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 457924702, "location_id": 844681632, "available": 0, "updated_at": "2023-01-03T13:03:42-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702"}})); const inventory_level = new shopify.rest.InventoryLevel({session: session}); @@ -143,7 +143,7 @@ describe('InventoryLevel resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 42, "updated_at": "2022-10-03T13:14:50-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 42, "updated_at": "2023-01-03T13:03:52-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); const inventory_level = new shopify.rest.InventoryLevel({session: session}); diff --git a/rest/admin/__tests__/2022-07/location.test.ts b/rest/admin/__tests__/2022-07/location.test.ts index 502623392..c322b9f6c 100644 --- a/rest/admin/__tests__/2022-07/location.test.ts +++ b/rest/admin/__tests__/2022-07/location.test.ts @@ -31,7 +31,7 @@ describe('Location resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"locations": [{"id": 655441491, "name": "50 Rideau Street", "address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "zip": "K1N 9J7", "province": "Ontario", "country": "CA", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "CA", "country_name": "Canada", "province_code": "ON", "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/655441491", "localized_country_name": "Canada", "localized_province_name": "Ontario"}, {"id": 24826418, "name": "Apple Api Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/24826418", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 844681632, "name": "Apple Cupertino", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/844681632", "localized_country_name": "United States", "localized_province_name": null}, {"id": 611870435, "name": "Apple Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/611870435", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322", "localized_country_name": "United States", "localized_province_name": null}]})); + queueMockResponse(JSON.stringify({"locations": [{"id": 655441491, "name": "50 Rideau Street", "address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "zip": "K1N 9J7", "province": "Ontario", "country": "CA", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "CA", "country_name": "Canada", "province_code": "ON", "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/655441491", "localized_country_name": "Canada", "localized_province_name": "Ontario"}, {"id": 24826418, "name": "Apple Api Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/24826418", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 844681632, "name": "Apple Cupertino", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/844681632", "localized_country_name": "United States", "localized_province_name": null}, {"id": 611870435, "name": "Apple Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/611870435", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322", "localized_country_name": "United States", "localized_province_name": null}]})); await shopify.rest.Location.all({ session: session, @@ -48,7 +48,7 @@ describe('Location resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"location": {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322"}})); + queueMockResponse(JSON.stringify({"location": {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322"}})); await shopify.rest.Location.find({ session: session, @@ -83,7 +83,7 @@ describe('Location resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 487838322, "available": 18, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 487838322, "available": 36, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 487838322, "available": 18, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 487838322, "available": 36, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}]})); await shopify.rest.Location.inventory_levels({ session: session, diff --git a/rest/admin/__tests__/2022-07/locations_for_move.test.ts b/rest/admin/__tests__/2022-07/locations_for_move.test.ts index 7dc52d36f..f2cfd9061 100644 --- a/rest/admin/__tests__/2022-07/locations_for_move.test.ts +++ b/rest/admin/__tests__/2022-07/locations_for_move.test.ts @@ -35,13 +35,13 @@ describe('LocationsForMove resource', () => { await shopify.rest.LocationsForMove.all({ session: session, - fulfillment_order_id: 1046000830, + fulfillment_order_id: 1046000829, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/fulfillment_orders/1046000830/locations_for_move.json', + path: '/admin/api/2022-07/fulfillment_orders/1046000829/locations_for_move.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/marketing_event.test.ts b/rest/admin/__tests__/2022-07/marketing_event.test.ts index 3b82e2df7..2889094f2 100644 --- a/rest/admin/__tests__/2022-07/marketing_event.test.ts +++ b/rest/admin/__tests__/2022-07/marketing_event.test.ts @@ -31,7 +31,7 @@ describe('MarketingEvent resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"marketing_events": [{"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2022-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}]})); + queueMockResponse(JSON.stringify({"marketing_events": [{"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2023-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}]})); await shopify.rest.MarketingEvent.all({ session: session, @@ -48,11 +48,11 @@ describe('MarketingEvent resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"marketing_event": {"id": 1069063883, "event_type": "ad", "remote_id": null, "started_at": "2022-12-15T00:00:00-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": null, "currency": null, "manage_url": null, "preview_url": null, "utm_campaign": "Christmas2022", "utm_source": "facebook", "utm_medium": "cpc", "budget_type": null, "description": null, "marketing_channel": "social", "paid": true, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": 1063897333, "admin_graphql_api_id": "gid://shopify/MarketingEvent/1069063883", "marketed_resources": []}})); + queueMockResponse(JSON.stringify({"marketing_event": {"id": 1069063883, "event_type": "ad", "remote_id": null, "started_at": "2023-12-14T19:00:00-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": null, "currency": null, "manage_url": null, "preview_url": null, "utm_campaign": "Christmas2023", "utm_source": "facebook", "utm_medium": "cpc", "budget_type": null, "description": null, "marketing_channel": "social", "paid": true, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": 1063897333, "admin_graphql_api_id": "gid://shopify/MarketingEvent/1069063883", "marketed_resources": []}})); const marketing_event = new shopify.rest.MarketingEvent({session: session}); - marketing_event.started_at = "2022-12-15"; - marketing_event.utm_campaign = "Christmas2022"; + marketing_event.started_at = "2023-12-15"; + marketing_event.utm_campaign = "Christmas2023"; marketing_event.utm_source = "facebook"; marketing_event.utm_medium = "cpc"; marketing_event.event_type = "ad"; @@ -67,7 +67,7 @@ describe('MarketingEvent resource', () => { path: '/admin/api/2022-07/marketing_events.json', query: '', headers, - data: { "marketing_event": {"started_at": "2022-12-15", "utm_campaign": "Christmas2022", "utm_source": "facebook", "utm_medium": "cpc", "event_type": "ad", "referring_domain": "facebook.com", "marketing_channel": "social", "paid": true} } + data: { "marketing_event": {"started_at": "2023-12-15", "utm_campaign": "Christmas2023", "utm_source": "facebook", "utm_medium": "cpc", "event_type": "ad", "referring_domain": "facebook.com", "marketing_channel": "social", "paid": true} } }).toMatchMadeHttpRequest(); }); @@ -89,7 +89,7 @@ describe('MarketingEvent resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"marketing_event": {"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2022-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + queueMockResponse(JSON.stringify({"marketing_event": {"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2023-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); await shopify.rest.MarketingEvent.find({ session: session, @@ -107,14 +107,14 @@ describe('MarketingEvent resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"marketing_event": {"started_at": "2022-02-01T19:00:00-05:00", "ended_at": "2022-02-02T19:00:00-05:00", "scheduled_to_end_at": "2022-02-03T19:00:00-05:00", "remote_id": "1000:2000", "currency": "CAD", "budget": "11.1", "budget_type": "daily", "id": 998730532, "event_type": "post", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + queueMockResponse(JSON.stringify({"marketing_event": {"started_at": "2023-02-01T19:00:00-05:00", "ended_at": "2023-02-02T19:00:00-05:00", "scheduled_to_end_at": "2023-02-03T19:00:00-05:00", "remote_id": "1000:2000", "currency": "CAD", "budget": "11.1", "budget_type": "daily", "id": 998730532, "event_type": "post", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); const marketing_event = new shopify.rest.MarketingEvent({session: session}); marketing_event.id = 998730532; marketing_event.remote_id = "1000:2000"; - marketing_event.started_at = "2022-02-02T00:00 +00:00"; - marketing_event.ended_at = "2022-02-03T00:00 +00:00"; - marketing_event.scheduled_to_end_at = "2022-02-04T00:00 +00:00"; + marketing_event.started_at = "2023-02-02T00:00 +00:00"; + marketing_event.ended_at = "2023-02-03T00:00 +00:00"; + marketing_event.scheduled_to_end_at = "2023-02-04T00:00 +00:00"; marketing_event.budget = "11.1"; marketing_event.budget_type = "daily"; marketing_event.currency = "CAD"; @@ -131,7 +131,7 @@ describe('MarketingEvent resource', () => { path: '/admin/api/2022-07/marketing_events/998730532.json', query: '', headers, - data: { "marketing_event": {"remote_id": "1000:2000", "started_at": "2022-02-02T00:00 +00:00", "ended_at": "2022-02-03T00:00 +00:00", "scheduled_to_end_at": "2022-02-04T00:00 +00:00", "budget": "11.1", "budget_type": "daily", "currency": "CAD", "utm_campaign": "other", "utm_source": "other", "utm_medium": "other", "event_type": "ad", "referring_domain": "instagram.com"} } + data: { "marketing_event": {"remote_id": "1000:2000", "started_at": "2023-02-02T00:00 +00:00", "ended_at": "2023-02-03T00:00 +00:00", "scheduled_to_end_at": "2023-02-04T00:00 +00:00", "budget": "11.1", "budget_type": "daily", "currency": "CAD", "utm_campaign": "other", "utm_source": "other", "utm_medium": "other", "event_type": "ad", "referring_domain": "instagram.com"} } }).toMatchMadeHttpRequest(); }); @@ -154,12 +154,12 @@ describe('MarketingEvent resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"engagements": [{"occurred_on": "2022-01-15", "fetched_at": null, "views_count": 0, "impressions_count": null, "clicks_count": 0, "favorites_count": 0, "comments_count": null, "shares_count": null, "ad_spend": "10.0", "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2022-01-16", "fetched_at": null, "views_count": 100, "impressions_count": null, "clicks_count": 50, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2022-01-17", "fetched_at": null, "views_count": 200, "impressions_count": null, "clicks_count": 100, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}]})); + queueMockResponse(JSON.stringify({"engagements": [{"occurred_on": "2023-01-15", "fetched_at": null, "views_count": 0, "impressions_count": null, "clicks_count": 0, "favorites_count": 0, "comments_count": null, "shares_count": null, "ad_spend": "10.0", "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2023-01-16", "fetched_at": null, "views_count": 100, "impressions_count": null, "clicks_count": 50, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2023-01-17", "fetched_at": null, "views_count": 200, "impressions_count": null, "clicks_count": 100, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}]})); const marketing_event = new shopify.rest.MarketingEvent({session: session}); marketing_event.id = 998730532; await marketing_event.engagements({ - body: {"engagements": [{"occurred_on": "2022-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2022-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2022-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]}, + body: {"engagements": [{"occurred_on": "2023-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2023-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2023-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]}, }); expect({ @@ -168,7 +168,7 @@ describe('MarketingEvent resource', () => { path: '/admin/api/2022-07/marketing_events/998730532/engagements.json', query: '', headers, - data: {"engagements": [{"occurred_on": "2022-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2022-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2022-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]} + data: {"engagements": [{"occurred_on": "2023-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2023-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2023-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]} }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/metafield.test.ts b/rest/admin/__tests__/2022-07/metafield.test.ts index 902ab62c0..9662f7db9 100644 --- a/rest/admin/__tests__/2022-07/metafield.test.ts +++ b/rest/admin/__tests__/2022-07/metafield.test.ts @@ -49,25 +49,25 @@ describe('Metafield resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 51714266, "namespace": "my_namespace", "key": "my_key", "value": "Hello", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/51714266"}, {"id": 116539875, "namespace": "descriptors", "key": "subtitle", "value": "The best ipod", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/116539875"}, {"id": 263497237, "namespace": "installments", "key": "disable", "value": true, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/263497237"}, {"id": 273160493, "namespace": "facts", "key": "isbn", "value": "978-0-14-004259-7", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/273160493"}, {"id": 524118066, "namespace": "facts", "key": "ean", "value": "0123456789012", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/524118066"}, {"id": 543636738, "namespace": "reviews", "key": "rating_count", "value": 1, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/543636738"}, {"id": 572384404, "namespace": "reviews", "key": "rating", "value": "{\"value\": \"3.5\", \"scale_min\": \"1.0\", \"scale_max\": \"5.0\"}", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "rating", "admin_graphql_api_id": "gid://shopify/Metafield/572384404"}, {"id": 613330208, "namespace": "shopify_filter", "key": "display", "value": "retina", "description": "This field keeps track of the type of display", "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/613330208"}, {"id": 779326701, "namespace": "facts", "key": "upc", "value": "012345678901", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/779326701"}, {"id": 845366454, "namespace": "translations", "key": "title_fr", "value": "produit", "description": "French product title", "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/845366454"}, {"id": 861799889, "namespace": "my_other_fields", "key": "organic", "value": true, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/861799889"}, {"id": 870326793, "namespace": "descriptors", "key": "care_guide", "value": "Wash in cold water", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": null, "admin_graphql_api_id": "gid://shopify/Metafield/870326793"}, {"id": 908250163, "namespace": "my_other_fields", "key": "shipping_policy", "value": "Ships for free in Canada", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/908250163"}, {"id": 925288667, "namespace": "my_other_fields", "key": "year_released", "value": 2019, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/925288667"}, {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}, {"id": 1029402048, "namespace": "my_other_fields", "key": "ingredients", "value": "[\"apple\", \"music\", \"u2\"]", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "list.single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1029402048"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 519046726, "namespace": "notes", "key": "descriptionription", "value": "Collection description", "description": "Custom Collection notes", "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/519046726"}, {"id": 624849518, "namespace": "global", "key": "description_tag", "value": "Some seo description value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/624849518"}, {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "632910392", "owner_resource": "product"}, + metafield: {"owner_id": "482865238", "owner_resource": "collection"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/metafields.json', - query: 'metafield%5Bowner_id%5D=632910392&metafield%5Bowner_resource%5D=product', + query: 'metafield%5Bowner_id%5D=482865238&metafield%5Bowner_resource%5D=collection', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}]})); await shopify.rest.Metafield.all({ session: session, @@ -85,7 +85,7 @@ describe('Metafield resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}]})); await shopify.rest.Metafield.all({ session: session, @@ -103,7 +103,7 @@ describe('Metafield resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}]})); await shopify.rest.Metafield.all({ session: session, @@ -121,54 +121,54 @@ describe('Metafield resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 1063298188, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2022-10-03T12:17:58-04:00", "updated_at": "2022-10-03T12:17:58-04:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1063298188"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 51714266, "namespace": "my_namespace", "key": "my_key", "value": "Hello", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/51714266"}, {"id": 116539875, "namespace": "descriptors", "key": "subtitle", "value": "The best ipod", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/116539875"}, {"id": 263497237, "namespace": "installments", "key": "disable", "value": true, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/263497237"}, {"id": 273160493, "namespace": "facts", "key": "isbn", "value": "978-0-14-004259-7", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/273160493"}, {"id": 524118066, "namespace": "facts", "key": "ean", "value": "0123456789012", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/524118066"}, {"id": 543636738, "namespace": "reviews", "key": "rating_count", "value": 1, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/543636738"}, {"id": 572384404, "namespace": "reviews", "key": "rating", "value": "{\"value\": \"3.5\", \"scale_min\": \"1.0\", \"scale_max\": \"5.0\"}", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "rating", "admin_graphql_api_id": "gid://shopify/Metafield/572384404"}, {"id": 613330208, "namespace": "shopify_filter", "key": "display", "value": "retina", "description": "This field keeps track of the type of display", "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/613330208"}, {"id": 779326701, "namespace": "facts", "key": "upc", "value": "012345678901", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/779326701"}, {"id": 845366454, "namespace": "translations", "key": "title_fr", "value": "produit", "description": "French product title", "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/845366454"}, {"id": 861799889, "namespace": "my_other_fields", "key": "organic", "value": true, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/861799889"}, {"id": 870326793, "namespace": "descriptors", "key": "care_guide", "value": "Wash in cold water", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": null, "admin_graphql_api_id": "gid://shopify/Metafield/870326793"}, {"id": 908250163, "namespace": "my_other_fields", "key": "shipping_policy", "value": "Ships for free in Canada", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/908250163"}, {"id": 925288667, "namespace": "my_other_fields", "key": "year_released", "value": 2019, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/925288667"}, {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}, {"id": 1029402048, "namespace": "my_other_fields", "key": "ingredients", "value": "[\"apple\", \"music\", \"u2\"]", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "list.single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1029402048"}]})); await shopify.rest.Metafield.all({ session: session, - since_id: "721389482", + metafield: {"owner_id": "632910392", "owner_resource": "product"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/metafields.json', - query: 'since_id=721389482', + query: 'metafield%5Bowner_id%5D=632910392&metafield%5Bowner_resource%5D=product', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"metafields": []})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "674387490", "owner_resource": "article"}, + metafield: {"owner_id": "850703190", "owner_resource": "product_image"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/metafields.json', - query: 'metafield%5Bowner_id%5D=674387490&metafield%5Bowner_resource%5D=article', + query: 'metafield%5Bowner_id%5D=850703190&metafield%5Bowner_resource%5D=product_image', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 519046726, "namespace": "notes", "key": "descriptionription", "value": "Collection description", "description": "Custom Collection notes", "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/519046726"}, {"id": 624849518, "namespace": "global", "key": "description_tag", "value": "Some seo description value", "description": null, "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/624849518"}, {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}]})); + queueMockResponse(JSON.stringify({"metafields": []})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "482865238", "owner_resource": "collection"}, + metafield: {"owner_id": "49148385", "owner_resource": "variants"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/metafields.json', - query: 'metafield%5Bowner_id%5D=482865238&metafield%5Bowner_resource%5D=collection', + query: 'metafield%5Bowner_id%5D=49148385&metafield%5Bowner_resource%5D=variants', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -179,234 +179,447 @@ describe('Metafield resource', () => { await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "49148385", "owner_resource": "variants"}, + metafield: {"owner_id": "674387490", "owner_resource": "article"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/metafields.json', - query: 'metafield%5Bowner_id%5D=49148385&metafield%5Bowner_resource%5D=variants', + query: 'metafield%5Bowner_id%5D=674387490&metafield%5Bowner_resource%5D=article', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}]})); await shopify.rest.Metafield.all({ session: session, + metafield: {"owner_id": "450789469", "owner_resource": "order"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/metafields.json', - query: '', + query: 'metafield%5Bowner_id%5D=450789469&metafield%5Bowner_resource%5D=order', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "450789469", "owner_resource": "order"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/metafields.json', - query: 'metafield%5Bowner_id%5D=450789469&metafield%5Bowner_resource%5D=order', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 1069229006, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:53:15-05:00", "updated_at": "2023-01-03T12:53:15-05:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069229006"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "850703190", "owner_resource": "product_image"}, + since_id: "721389482", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/metafields.json', - query: 'metafield%5Bowner_id%5D=850703190&metafield%5Bowner_resource%5D=product_image', + query: 'since_id=721389482', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228998, "namespace": "my_fields", "key": "sponsor", "value": "Shopify", "description": null, "owner_id": 382285388, "created_at": "2023-01-03T12:52:48-05:00", "updated_at": "2023-01-03T12:52:48-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228998"}})); - await shopify.rest.Metafield.count({ - session: session, - page_id: 131092082, - }); + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.namespace = "my_fields"; + metafield.key = "sponsor"; + metafield.type = "single_line_text_field"; + metafield.value = "Shopify"; + await metafield.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/pages/131092082/metafields/count.json', + path: '/admin/api/2022-07/blogs/382285388/metafields.json', query: '', headers, - data: undefined + data: { "metafield": {"namespace": "my_fields", "key": "sponsor", "type": "single_line_text_field", "value": "Shopify"} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"count": 3})); + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228972, "namespace": "my_fields", "key": "discount", "value": "25%", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:50:28-05:00", "updated_at": "2023-01-03T12:50:28-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228972"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.namespace = "my_fields"; + metafield.key = "discount"; + metafield.type = "single_line_text_field"; + metafield.value = "25%"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/collections/482865238/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "discount", "type": "single_line_text_field", "value": "25%"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228983, "namespace": "discounts", "key": "special", "value": "yes", "description": null, "owner_id": 207119551, "created_at": "2023-01-03T12:51:01-05:00", "updated_at": "2023-01-03T12:51:01-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228983"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.namespace = "discounts"; + metafield.key = "special"; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/customers/207119551/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "discounts", "key": "special", "value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069229003, "namespace": "my_fields", "key": "purchase_order", "value": "97453", "description": null, "owner_id": 622762746, "created_at": "2023-01-03T12:53:03-05:00", "updated_at": "2023-01-03T12:53:03-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069229003"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "97453"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/draft_orders/622762746/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "97453"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228969, "namespace": "my_fields", "key": "subtitle", "value": "A subtitle for my page", "description": null, "owner_id": 131092082, "created_at": "2023-01-03T12:49:57-05:00", "updated_at": "2023-01-03T12:49:57-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228969"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.namespace = "my_fields"; + metafield.key = "subtitle"; + metafield.type = "single_line_text_field"; + metafield.value = "A subtitle for my page"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/pages/131092082/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "subtitle", "type": "single_line_text_field", "value": "A subtitle for my page"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228994, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:51:54-05:00", "updated_at": "2023-01-03T12:51:54-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228994"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.namespace = "inventory"; + metafield.key = "warehouse"; + metafield.value = 25; + metafield.type = "number_integer"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/products/632910392/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "inventory", "key": "warehouse", "value": 25, "type": "number_integer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228985, "namespace": "translaction", "key": "title_spanish", "value": "botas", "description": null, "owner_id": 850703190, "created_at": "2023-01-03T12:51:06-05:00", "updated_at": "2023-01-03T12:51:06-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228985"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.namespace = "translaction"; + metafield.key = "title_spanish"; + metafield.type = "single_line_text_field"; + metafield.value = "botas"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/product_images/850703190/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "translaction", "key": "title_spanish", "type": "single_line_text_field", "value": "botas"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228995, "namespace": "my_fields", "key": "liner_material", "value": "synthetic leather", "description": null, "owner_id": 49148385, "created_at": "2023-01-03T12:52:21-05:00", "updated_at": "2023-01-03T12:52:21-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228995"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.namespace = "my_fields"; + metafield.key = "liner_material"; + metafield.type = "single_line_text_field"; + metafield.value = "synthetic leather"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/variants/49148385/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "liner_material", "type": "single_line_text_field", "value": "synthetic leather"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228982, "namespace": "my_fields", "key": "category", "value": "outdoors", "description": null, "owner_id": 674387490, "created_at": "2023-01-03T12:50:58-05:00", "updated_at": "2023-01-03T12:50:58-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228982"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.namespace = "my_fields"; + metafield.key = "category"; + metafield.type = "single_line_text_field"; + metafield.value = "outdoors"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/articles/674387490/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "category", "type": "single_line_text_field", "value": "outdoors"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069229001, "namespace": "my_fields", "key": "purchase_order", "value": "123", "description": null, "owner_id": 450789469, "created_at": "2023-01-03T12:52:57-05:00", "updated_at": "2023-01-03T12:52:57-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069229001"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "123"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/orders/450789469/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "123"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228973, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:50:31-05:00", "updated_at": "2023-01-03T12:50:31-05:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228973"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.namespace = "inventory"; + metafield.key = "warehouse"; + metafield.value = 25; + metafield.type = "number_integer"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "inventory", "key": "warehouse", "value": 25, "type": "number_integer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + queueMockResponse(JSON.stringify({"count": 0})); await shopify.rest.Metafield.count({ session: session, - collection_id: 482865238, + blog_id: 382285388, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/collections/482865238/metafields/count.json', + path: '/admin/api/2022-07/blogs/382285388/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_15', async () => { - queueMockResponse(JSON.stringify({"count": 0})); + it('test_25', async () => { + queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.Metafield.count({ session: session, - variant_id: 49148385, + collection_id: 482865238, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/variants/49148385/metafields/count.json', + path: '/admin/api/2022-07/collections/482865238/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_16', async () => { + it('test_26', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - order_id: 450789469, + customer_id: 207119551, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/orders/450789469/metafields/count.json', + path: '/admin/api/2022-07/customers/207119551/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_17', async () => { + it('test_27', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, + draft_order_id: 622762746, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/metafields/count.json', + path: '/admin/api/2022-07/draft_orders/622762746/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_18', async () => { + it('test_28', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - draft_order_id: 622762746, + page_id: 131092082, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/draft_orders/622762746/metafields/count.json', + path: '/admin/api/2022-07/pages/131092082/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_19', async () => { - queueMockResponse(JSON.stringify({"count": 0})); + it('test_29', async () => { + queueMockResponse(JSON.stringify({"count": 16})); await shopify.rest.Metafield.count({ session: session, - blog_id: 382285388, + product_id: 632910392, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/blogs/382285388/metafields/count.json', + path: '/admin/api/2022-07/products/632910392/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_20', async () => { + it('test_30', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - customer_id: 207119551, + product_image_id: 850703190, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/customers/207119551/metafields/count.json', + path: '/admin/api/2022-07/product_images/850703190/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_21', async () => { - queueMockResponse(JSON.stringify({"count": 16})); + it('test_31', async () => { + queueMockResponse(JSON.stringify({"count": 0})); await shopify.rest.Metafield.count({ session: session, - product_id: 632910392, + variant_id: 49148385, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/products/632910392/metafields/count.json', + path: '/admin/api/2022-07/variants/49148385/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_22', async () => { + it('test_32', async () => { queueMockResponse(JSON.stringify({"count": 0})); await shopify.rest.Metafield.count({ @@ -424,64 +637,62 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_23', async () => { + it('test_33', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - product_image_id: 850703190, + order_id: 450789469, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/product_images/850703190/metafields/count.json', + path: '/admin/api/2022-07/orders/450789469/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_24', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 323119633, "namespace": "my_fields", "key": "color", "value": "Pink", "description": null, "owner_id": 808950810, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + it('test_34', async () => { + queueMockResponse(JSON.stringify({"count": 1})); - await shopify.rest.Metafield.find({ + await shopify.rest.Metafield.count({ session: session, - variant_id: 49148385, - id: 323119633, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/variants/49148385/metafields/323119633.json', + path: '/admin/api/2022-07/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_25', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + it('test_35', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 534526895, "namespace": "translation", "key": "title_fr", "value": "Le iPod", "description": "Blog French title translation", "owner_id": 241253187, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); await shopify.rest.Metafield.find({ session: session, - product_image_id: 850703190, - id: 625663657, + blog_id: 382285388, + id: 534526895, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/product_images/850703190/metafields/625663657.json', + path: '/admin/api/2022-07/blogs/382285388/metafields/534526895.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_26', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + it('test_36', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); await shopify.rest.Metafield.find({ session: session, @@ -499,8 +710,27 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_27', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + it('test_37', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + await shopify.rest.Metafield.find({ + session: session, + customer_id: 207119551, + id: 220591908, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2022-07/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_38', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); await shopify.rest.Metafield.find({ session: session, @@ -518,102 +748,103 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_28', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + it('test_39', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); await shopify.rest.Metafield.find({ session: session, - product_id: 632910392, - id: 1001077698, + page_id: 131092082, + id: 290519330, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/products/632910392/metafields/1001077698.json', + path: '/admin/api/2022-07/pages/131092082/metafields/290519330.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_29', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + it('test_40', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); await shopify.rest.Metafield.find({ session: session, - id: 721389482, + product_id: 632910392, + id: 1001077698, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/metafields/721389482.json', + path: '/admin/api/2022-07/products/632910392/metafields/1001077698.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_30', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + it('test_41', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); await shopify.rest.Metafield.find({ session: session, - customer_id: 207119551, - id: 220591908, + product_image_id: 850703190, + id: 625663657, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/customers/207119551/metafields/220591908.json', + path: '/admin/api/2022-07/product_images/850703190/metafields/625663657.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_31', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 534526895, "namespace": "translation", "key": "title_fr", "value": "Le iPod", "description": "Blog French title translation", "owner_id": 241253187, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + it('test_42', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 323119633, "namespace": "my_fields", "key": "color", "value": "Pink", "description": null, "owner_id": 808950810, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); await shopify.rest.Metafield.find({ session: session, - blog_id: 382285388, - id: 534526895, + variant_id: 49148385, + id: 323119633, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/blogs/382285388/metafields/534526895.json', + path: '/admin/api/2022-07/variants/49148385/metafields/323119633.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_32', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + it('test_43', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 838981074, "namespace": "translation", "key": "title_fr", "value": "Le Article", "description": "Article French title translation", "owner_id": 134645308, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); await shopify.rest.Metafield.find({ session: session, - page_id: 131092082, - id: 290519330, + article_id: 674387490, + id: 838981074, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/pages/131092082/metafields/290519330.json', + path: '/admin/api/2022-07/articles/674387490/metafields/838981074.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_33', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + it('test_44', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); await shopify.rest.Metafield.find({ session: session, @@ -631,64 +862,282 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_34', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 838981074, "namespace": "translation", "key": "title_fr", "value": "Le Article", "description": "Article French title translation", "owner_id": 134645308, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + it('test_45', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); await shopify.rest.Metafield.find({ session: session, - article_id: 674387490, - id: 838981074, + id: 721389482, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/articles/674387490/metafields/838981074.json', + path: '/admin/api/2022-07/metafields/721389482.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_35', async () => { + it('test_46', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated blog title", "owner_id": 241253187, "namespace": "translation", "key": "title_fr", "id": 534526895, "description": "Blog French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:53:17-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.id = 534526895; + metafield.value = "a translated blog title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/blogs/382285388/metafields/534526895.json', + query: '', + headers, + data: { "metafield": {"value": "a translated blog title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_47', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "seo title", "owner_id": 482865238, "namespace": "global", "key": "title_tag", "id": 1010236510, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:49:17-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.id = 1010236510; + metafield.value = "seo title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/collections/482865238/metafields/1010236510.json', + query: '', + headers, + data: { "metafield": {"value": "seo title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_48', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "yes", "owner_id": 207119551, "namespace": "discounts", "key": "returning_customer", "id": 220591908, "description": "Customer deserves discount", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:50:56-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.id = 220591908; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: { "metafield": {"value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_49', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "110000", "owner_id": 622762746, "namespace": "notes", "key": "note", "id": 106172460, "description": "This is for notes", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:51:31-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.id = 106172460; + metafield.value = "110000"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/draft_orders/622762746/metafields/106172460.json', + query: '', + headers, + data: { "metafield": {"value": "110000", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_50', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "An updated translation", "owner_id": 131092082, "namespace": "translation", "key": "title_fr", "id": 290519330, "description": "Page French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:39-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.id = 290519330; + metafield.value = "An updated translation"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/pages/131092082/metafields/290519330.json', + query: '', + headers, + data: { "metafield": {"value": "An updated translation", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_51', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "having fun", "owner_id": 632910392, "namespace": "my_fields", "key": "best_for", "id": 1001077698, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:51:25-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.id = 1001077698; + metafield.value = "having fun"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/products/632910392/metafields/1001077698.json', + query: '', + headers, + data: { "metafield": {"value": "having fun", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_52', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "translated description", "owner_id": 850703190, "namespace": "translation", "key": "title_fr", "id": 625663657, "description": "French product image title", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:31-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.id = 625663657; + metafield.value = "translated description"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/product_images/850703190/metafields/625663657.json', + query: '', + headers, + data: { "metafield": {"value": "translated description", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_53', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "Red", "owner_id": 808950810, "namespace": "my_fields", "key": "color", "id": 323119633, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:53:00-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.id = 323119633; + metafield.value = "Red"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/variants/49148385/metafields/323119633.json', + query: '', + headers, + data: { "metafield": {"value": "Red", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_54', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "something new", "owner_id": 548380009, "namespace": "affiliates", "key": "app_key", "id": 721389482, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:02-05:00", "owner_resource": "shop", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.id = 721389482; + metafield.value = "something new"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/metafields/721389482.json', + query: '', + headers, + data: { "metafield": {"value": "something new", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_55', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated title", "owner_id": 134645308, "namespace": "translation", "key": "title_fr", "id": 838981074, "description": "Article French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:50:36-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.id = 838981074; + metafield.value = "a translated title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/articles/674387490/metafields/838981074.json', + query: '', + headers, + data: { "metafield": {"value": "a translated title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_56', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "Provided a discount code", "owner_id": 450789469, "namespace": "notes", "key": "buyer", "id": 915396079, "description": "This field is for buyer notes", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:49:41-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.id = 915396079; + metafield.value = "Provided a discount code"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-07/orders/450789469/metafields/915396079.json', + query: '', + headers, + data: { "metafield": {"value": "Provided a discount code", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_57', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - product_image_id: 850703190, - id: 625663657, + blog_id: 382285388, + id: 534526895, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/product_images/850703190/metafields/625663657.json', + path: '/admin/api/2022-07/blogs/382285388/metafields/534526895.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_36', async () => { + it('test_58', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - draft_order_id: 622762746, - id: 106172460, + collection_id: 482865238, + id: 1010236510, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/draft_orders/622762746/metafields/106172460.json', + path: '/admin/api/2022-07/collections/482865238/metafields/1010236510.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_37', async () => { + it('test_59', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ @@ -707,120 +1156,121 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_38', async () => { + it('test_60', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - collection_id: 482865238, - id: 1010236510, + draft_order_id: 622762746, + id: 106172460, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/collections/482865238/metafields/1010236510.json', + path: '/admin/api/2022-07/draft_orders/622762746/metafields/106172460.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_39', async () => { + it('test_61', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - blog_id: 382285388, - id: 534526895, + page_id: 131092082, + id: 290519330, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/blogs/382285388/metafields/534526895.json', + path: '/admin/api/2022-07/pages/131092082/metafields/290519330.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_40', async () => { + it('test_62', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - id: 721389482, + product_id: 632910392, + id: 1001077698, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/metafields/721389482.json', + path: '/admin/api/2022-07/products/632910392/metafields/1001077698.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_41', async () => { + it('test_63', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - variant_id: 49148385, - id: 323119633, + product_image_id: 850703190, + id: 625663657, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/variants/49148385/metafields/323119633.json', + path: '/admin/api/2022-07/product_images/850703190/metafields/625663657.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_42', async () => { + it('test_64', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - page_id: 131092082, - id: 290519330, + variant_id: 49148385, + id: 323119633, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/pages/131092082/metafields/290519330.json', + path: '/admin/api/2022-07/variants/49148385/metafields/323119633.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_43', async () => { + it('test_65', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - product_id: 632910392, - id: 1001077698, + article_id: 674387490, + id: 838981074, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/products/632910392/metafields/1001077698.json', + path: '/admin/api/2022-07/articles/674387490/metafields/838981074.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_44', async () => { + it('test_66', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ @@ -839,19 +1289,18 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_45', async () => { + it('test_67', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - article_id: 674387490, - id: 838981074, + id: 721389482, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/articles/674387490/metafields/838981074.json', + path: '/admin/api/2022-07/metafields/721389482.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/mobile_platform_application.test.ts b/rest/admin/__tests__/2022-07/mobile_platform_application.test.ts index 3f2ce1b3b..af180501b 100644 --- a/rest/admin/__tests__/2022-07/mobile_platform_application.test.ts +++ b/rest/admin/__tests__/2022-07/mobile_platform_application.test.ts @@ -31,7 +31,7 @@ describe('MobilePlatformApplication resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_applications": [{"id": 1066176058, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:58-05:00", "updated_at": "2022-11-29T17:07:58-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true}, {"id": 1066176059, "application_id": "com.example", "platform": "android", "created_at": "2022-11-29T17:07:58-05:00", "updated_at": "2022-11-29T17:07:58-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false}]})); + queueMockResponse(JSON.stringify({"mobile_platform_applications": [{"id": 1066175996, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:47-05:00", "updated_at": "2023-01-03T12:42:47-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}, {"id": 1066175997, "application_id": "com.example", "platform": "android", "created_at": "2023-01-03T12:42:47-05:00", "updated_at": "2023-01-03T12:42:47-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}]})); await shopify.rest.MobilePlatformApplication.all({ session: session, @@ -48,7 +48,7 @@ describe('MobilePlatformApplication resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176055, "application_id": "com.example", "platform": "android", "created_at": "2022-11-29T17:07:53-05:00", "updated_at": "2022-11-29T17:07:53-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176002, "application_id": "com.example", "platform": "android", "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:42:58-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); mobile_platform_application.platform = "android"; @@ -70,7 +70,7 @@ describe('MobilePlatformApplication resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176052, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:49-05:00", "updated_at": "2022-11-29T17:07:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176000, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:54-05:00", "updated_at": "2023-01-03T12:42:54-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); mobile_platform_application.platform = "ios"; @@ -90,17 +90,17 @@ describe('MobilePlatformApplication resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176053, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:49-05:00", "updated_at": "2022-11-29T17:07:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066175998, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:49-05:00", "updated_at": "2023-01-03T12:42:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); await shopify.rest.MobilePlatformApplication.find({ session: session, - id: 1066176053, + id: 1066175998, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/mobile_platform_applications/1066176053.json', + path: '/admin/api/2022-07/mobile_platform_applications/1066175998.json', query: '', headers, data: undefined @@ -108,52 +108,56 @@ describe('MobilePlatformApplication resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "id": 1066176057, "created_at": "2022-11-29T17:07:56-05:00", "updated_at": "2022-11-29T17:07:58-05:00"}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "id": 1066175999, "created_at": "2023-01-03T12:42:50-05:00", "updated_at": "2023-01-03T12:42:52-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); - mobile_platform_application.id = 1066176057; + mobile_platform_application.id = 1066175999; mobile_platform_application.application_id = "com.example.news.app"; mobile_platform_application.platform = "android"; - mobile_platform_application.created_at = "2022-11-29T17:07:56-05:00"; - mobile_platform_application.updated_at = "2022-11-29T17:07:56-05:00"; + mobile_platform_application.created_at = "2023-01-03T12:42:50-05:00"; + mobile_platform_application.updated_at = "2023-01-03T12:42:50-05:00"; mobile_platform_application.sha256_cert_fingerprints = [ "14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5" ]; mobile_platform_application.enabled_universal_or_app_links = true; mobile_platform_application.enabled_shared_webcredentials = false; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; await mobile_platform_application.save({}); expect({ method: 'PUT', domain, - path: '/admin/api/2022-07/mobile_platform_applications/1066176057.json', + path: '/admin/api/2022-07/mobile_platform_applications/1066175999.json', query: '', headers, - data: { "mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "created_at": "2022-11-29T17:07:56-05:00", "updated_at": "2022-11-29T17:07:56-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false} } + data: { "mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "created_at": "2023-01-03T12:42:50-05:00", "updated_at": "2023-01-03T12:42:50-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "id": 1066176054, "created_at": "2022-11-29T17:07:50-05:00", "updated_at": "2022-11-29T17:07:52-05:00"}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "id": 1066176003, "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:43:00-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); - mobile_platform_application.id = 1066176054; + mobile_platform_application.id = 1066176003; mobile_platform_application.application_id = "A1B2.ca.domain.app"; mobile_platform_application.platform = "ios"; - mobile_platform_application.created_at = "2022-11-29T17:07:50-05:00"; - mobile_platform_application.updated_at = "2022-11-29T17:07:50-05:00"; + mobile_platform_application.created_at = "2023-01-03T12:42:58-05:00"; + mobile_platform_application.updated_at = "2023-01-03T12:42:58-05:00"; mobile_platform_application.sha256_cert_fingerprints = []; mobile_platform_application.enabled_universal_or_app_links = true; mobile_platform_application.enabled_shared_webcredentials = true; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; await mobile_platform_application.save({}); expect({ method: 'PUT', domain, - path: '/admin/api/2022-07/mobile_platform_applications/1066176054.json', + path: '/admin/api/2022-07/mobile_platform_applications/1066176003.json', query: '', headers, - data: { "mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:50-05:00", "updated_at": "2022-11-29T17:07:50-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true} } + data: { "mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:42:58-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null} } }).toMatchMadeHttpRequest(); }); @@ -162,13 +166,13 @@ describe('MobilePlatformApplication resource', () => { await shopify.rest.MobilePlatformApplication.delete({ session: session, - id: 1066176056, + id: 1066176001, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-07/mobile_platform_applications/1066176056.json', + path: '/admin/api/2022-07/mobile_platform_applications/1066176001.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/order.test.ts b/rest/admin/__tests__/2022-07/order.test.ts index 25a5a4421..d845289c8 100644 --- a/rest/admin/__tests__/2022-07/order.test.ts +++ b/rest/admin/__tests__/2022-07/order.test.ts @@ -31,7 +31,7 @@ describe('Order resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -49,7 +49,7 @@ describe('Order resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -85,7 +85,7 @@ describe('Order resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -103,7 +103,7 @@ describe('Order resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "authorized", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:49-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "authorized", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:50-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -121,18 +121,18 @@ describe('Order resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 1073459967, "admin_graphql_api_id": "gid://shopify/Order/1073459967", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:13:16-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/81b17d6d6ffa8c0b72f0e55af850e748/authenticate?key=f4f59da955f9c30e59bab8cbe1d0ea6a", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:16-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "81b17d6d6ffa8c0b72f0e55af850e748", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_usd": "199.00", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:16-05:00", "user_id": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823177, "admin_graphql_api_id": "gid://shopify/LineItem/1071823177", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "refunds": [], "shipping_lines": []}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 1073459972, "admin_graphql_api_id": "gid://shopify/Order/1073459972", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:28:16-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/3598b8ae8cac731d0e7996f0d2d09e1d/authenticate?key=966f252275757105ae9b631628c76c1a", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:28:16-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "3598b8ae8cac731d0e7996f0d2d09e1d", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_usd": "199.00", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:16-05:00", "user_id": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823184, "admin_graphql_api_id": "gid://shopify/LineItem/1071823184", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "refunds": [], "shipping_lines": []}]})); await shopify.rest.Order.all({ session: session, - ids: "1073459967", + ids: "1073459972", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/orders.json', - query: 'ids=1073459967', + query: 'ids=1073459972', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -158,7 +158,7 @@ describe('Order resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); await shopify.rest.Order.find({ session: session, @@ -212,7 +212,7 @@ describe('Order resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": "2022-11-28T17:12:48-05:00", "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:48-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": "2023-01-03T12:26:44-05:00", "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:44-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -229,7 +229,7 @@ describe('Order resource', () => { }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:14:32-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:29-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -246,7 +246,7 @@ describe('Order resource', () => { }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -263,7 +263,7 @@ describe('Order resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "bogus", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:14:20-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361463, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "created_at": "2022-11-28T17:14:20-05:00", "note": null, "order_id": 450789469, "processed_at": "2022-11-28T17:14:20-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [], "transactions": [{"id": 1068278479, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278479", "amount": "10.00", "authorization": null, "created_at": "2022-11-28T17:14:20-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278478, "payment_id": "c901414060.3", "processed_at": "2022-11-28T17:14:20-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}], "refund_line_items": [{"id": 1058498308, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498309, "line_item_id": 518995019, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498310, "line_item_id": 703073504, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "bogus", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:21-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361462, "admin_graphql_api_id": "gid://shopify/Refund/929361462", "created_at": "2023-01-03T12:27:21-05:00", "note": null, "order_id": 450789469, "processed_at": "2023-01-03T12:27:21-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [], "transactions": [{"id": 1068278471, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278471", "amount": "10.00", "authorization": null, "created_at": "2023-01-03T12:27:21-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278470, "payment_id": "c901414060.3", "processed_at": "2023-01-03T12:27:21-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}], "refund_line_items": [{"id": 1058498307, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498308, "line_item_id": 518995019, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498309, "line_item_id": 703073504, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -282,12 +282,12 @@ describe('Order resource', () => { }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "gift_card", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus", "gift_card"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:48-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361462, "admin_graphql_api_id": "gid://shopify/Refund/929361462", "created_at": "2022-11-28T17:13:48-05:00", "note": "Customer made a mistake", "order_id": 450789469, "processed_at": "2022-11-28T17:13:48-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [{"id": 1030976842, "amount": "89.64", "amount_set": {"shop_money": {"amount": "89.64", "currency_code": "USD"}, "presentment_money": {"amount": "89.64", "currency_code": "USD"}}, "kind": "refund_discrepancy", "order_id": 450789469, "reason": "Refund discrepancy", "refund_id": 929361462, "tax_amount": "0.00", "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}], "transactions": [{"id": 1068278475, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278475", "amount": "10.00", "authorization": null, "created_at": "2022-11-28T17:13:47-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278473, "payment_id": "c901414060.4", "processed_at": "2022-11-28T17:13:47-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}, {"id": 1068278476, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278476", "amount": "100.00", "authorization": null, "created_at": "2022-11-28T17:13:47-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "gift_card", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 1068278474, "payment_id": "c901414060.5", "processed_at": "2022-11-28T17:13:47-05:00", "receipt": {"gift_card_id": 1035197676, "gift_card_last_characters": "0d0d"}, "source_name": "755357713", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 1058498307, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "gift_card", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus", "gift_card"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:49-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361463, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "created_at": "2023-01-03T12:27:49-05:00", "note": "Customer made a mistake", "order_id": 450789469, "processed_at": "2023-01-03T12:27:49-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [{"id": 1030976842, "amount": "89.64", "amount_set": {"shop_money": {"amount": "89.64", "currency_code": "USD"}, "presentment_money": {"amount": "89.64", "currency_code": "USD"}}, "kind": "refund_discrepancy", "order_id": 450789469, "reason": "Refund discrepancy", "refund_id": 929361463, "tax_amount": "0.00", "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}], "transactions": [{"id": 1068278477, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278477", "amount": "10.00", "authorization": null, "created_at": "2023-01-03T12:27:48-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278475, "payment_id": "c901414060.4", "processed_at": "2023-01-03T12:27:48-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}, {"id": 1068278478, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278478", "amount": "100.00", "authorization": null, "created_at": "2023-01-03T12:27:49-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "gift_card", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 1068278476, "payment_id": "c901414060.5", "processed_at": "2023-01-03T12:27:49-05:00", "receipt": {"gift_card_id": 1035197676, "gift_card_last_characters": "0d0d"}, "source_name": "755357713", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 1058498310, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; await order.cancel({ - body: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278473, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278474, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}}, + body: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278475, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278476, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}}, }); expect({ @@ -296,12 +296,12 @@ describe('Order resource', () => { path: '/admin/api/2022-07/orders/450789469/cancel.json', query: '', headers, - data: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278473, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278474, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}} + data: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278475, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278476, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}} }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459964, "admin_graphql_api_id": "gid://shopify/Order/1073459964", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:12:59-05:00", "currency": "EUR", "current_subtotal_price": "224.97", "current_subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "current_total_duties_set": null, "current_total_price": "238.47", "current_total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "current_total_tax": "13.50", "current_total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/a11600292b5e91907c5846e0cfb3ad6f/authenticate?key=497840c834d9e9f67f790e0b61be5505", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "EUR", "processed_at": "2022-11-28T17:12:59-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "224.97", "subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "tags": "", "tax_lines": [{"price": "13.50", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "a11600292b5e91907c5846e0cfb3ad6f", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_line_items_price": "224.97", "total_line_items_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "total_outstanding": "0.00", "total_price": "238.47", "total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_tax": "13.50", "total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:59-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 3, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1300, "name": "Big Brown Bear Boots", "price": "74.99", "price_set": {"shop_money": {"amount": "74.99", "currency_code": "EUR"}, "presentment_money": {"amount": "74.99", "currency_code": "EUR"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 3, "requires_shipping": true, "sku": null, "taxable": true, "title": "Big Brown Bear Boots", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "13.50", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "rate": 0.06, "title": "State tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459962, "admin_graphql_api_id": "gid://shopify/Order/1073459962", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:26:04-05:00", "currency": "EUR", "current_subtotal_price": "224.97", "current_subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "current_total_duties_set": null, "current_total_price": "238.47", "current_total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "current_total_tax": "13.50", "current_total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/319b6019f95405472f9713cef70a99a8/authenticate?key=e81d0103ae0eb50bf94365dca29df99f", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "EUR", "processed_at": "2023-01-03T12:26:04-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "224.97", "subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "tags": "", "tax_lines": [{"price": "13.50", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "319b6019f95405472f9713cef70a99a8", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_line_items_price": "224.97", "total_line_items_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "total_outstanding": "0.00", "total_price": "238.47", "total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_tax": "13.50", "total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:04-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823172, "admin_graphql_api_id": "gid://shopify/LineItem/1071823172", "fulfillable_quantity": 3, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1300, "name": "Big Brown Bear Boots", "price": "74.99", "price_set": {"shop_money": {"amount": "74.99", "currency_code": "EUR"}, "presentment_money": {"amount": "74.99", "currency_code": "EUR"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 3, "requires_shipping": true, "sku": null, "taxable": true, "title": "Big Brown Bear Boots", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "13.50", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "rate": 0.06, "title": "State tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -341,7 +341,7 @@ describe('Order resource', () => { }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459970, "admin_graphql_api_id": "gid://shopify/Order/1073459970", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2022-11-28T17:13:25-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "partially_paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/d11dd9362564953962cadfdddd0c0935/authenticate?key=efac2a267fb959addd217bdd2b351c7d", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:25-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "d11dd9362564953962cadfdddd0c0935", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "149.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:25-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339457, "email": "paul.norman@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:25-05:00", "updated_at": "2022-11-28T17:13:26-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:25-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339457", "default_address": {"id": 1053317288, "customer_id": 1073339457, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823182, "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459968, "admin_graphql_api_id": "gid://shopify/Order/1073459968", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2023-01-03T12:27:26-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "partially_paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/668a72716da908e6a2e789db29dbedd6/authenticate?key=c0faefec830fe2bad8902a643f111263", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:26-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "668a72716da908e6a2e789db29dbedd6", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "149.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:26-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339475, "email": "paul.norman@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:26-05:00", "updated_at": "2023-01-03T12:27:26-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:26-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339475", "default_address": {"id": 1053317307, "customer_id": 1073339475, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823178, "admin_graphql_api_id": "gid://shopify/LineItem/1071823178", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -397,7 +397,7 @@ describe('Order resource', () => { }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459966, "admin_graphql_api_id": "gid://shopify/Order/1073459966", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2022-11-28T17:13:12-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "pending", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/e4ba4f4434be3f23a5dc574958531a6b/authenticate?key=b6e7804ea89d507bc7e3d112e75a85d3", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:12-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "e4ba4f4434be3f23a5dc574958531a6b", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:12-05:00", "user_id": null, "billing_address": null, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:13:12-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823176, "admin_graphql_api_id": "gid://shopify/LineItem/1071823176", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459965, "admin_graphql_api_id": "gid://shopify/Order/1073459965", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2023-01-03T12:26:32-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "pending", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/c7b936bf26ad5a982dcfa44a5685c79d/authenticate?key=94ef0aea48ebaa2a5c5ca9e24d1e6636", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:26:32-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "c7b936bf26ad5a982dcfa44a5685c79d", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:32-05:00", "user_id": null, "billing_address": null, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:26:33-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823175, "admin_graphql_api_id": "gid://shopify/LineItem/1071823175", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -423,7 +423,7 @@ describe('Order resource', () => { }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459973, "admin_graphql_api_id": "gid://shopify/Order/1073459973", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2022-11-28T17:13:54-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/685d637f0424874611dfd0fb62f495a1/authenticate?key=f08e8c7e76d35afbc5147f84c7067379", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:54-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "685d637f0424874611dfd0fb62f495a1", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:54-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339460, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:54-05:00", "updated_at": "2022-11-28T17:13:54-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:54-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339460"}, "discount_applications": [], "fulfillments": [{"id": 1069019863, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019863", "created_at": "2022-11-28T17:13:55-05:00", "location_id": 24826418, "name": "#1002.1", "order_id": 1073459973, "origin_address": {}, "receipt": {}, "service": "shipwire-app", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2022-11-28T17:13:55-05:00", "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459973, "admin_graphql_api_id": "gid://shopify/Order/1073459973", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:28:24-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/db6850dd9d41e9787662d53205610280/authenticate?key=ef5e08b9b4f5dc44de217e892a73330b", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:28:24-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "db6850dd9d41e9787662d53205610280", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:24-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339477, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:28:24-05:00", "updated_at": "2023-01-03T12:28:24-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:28:24-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339477"}, "discount_applications": [], "fulfillments": [{"id": 1069019863, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019863", "created_at": "2023-01-03T12:28:25-05:00", "location_id": 24826418, "name": "#1002.1", "order_id": 1073459973, "origin_address": {}, "receipt": {}, "service": "shipwire-app", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2023-01-03T12:28:25-05:00", "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.email = "foo@example.com"; @@ -452,7 +452,7 @@ describe('Order resource', () => { }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459969, "admin_graphql_api_id": "gid://shopify/Order/1073459969", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:13:23-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/40b4ff84b38cfb28ae9a30426f47a3ad/authenticate?key=38925de427ae572efde807c6cbd93779", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:23-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "40b4ff84b38cfb28ae9a30426f47a3ad", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:23-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823181, "admin_graphql_api_id": "gid://shopify/LineItem/1071823181", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459969, "admin_graphql_api_id": "gid://shopify/Order/1073459969", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:27:30-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/48b0719e537c3c333216675180fc0662/authenticate?key=e072883103b424ca776545c12110edd4", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:30-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "48b0719e537c3c333216675180fc0662", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:30-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823179, "admin_graphql_api_id": "gid://shopify/LineItem/1071823179", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -474,7 +474,7 @@ describe('Order resource', () => { }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459972, "admin_graphql_api_id": "gid://shopify/Order/1073459972", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2022-11-28T17:13:33-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/8e116c24823eec49a7cc6298924db5ee/authenticate?key=e12e99638b289b07f1416ce16e199c24", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:33-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "8e116c24823eec49a7cc6298924db5ee", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:33-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339459, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:32-05:00", "updated_at": "2022-11-28T17:13:33-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:32-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339459"}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823184, "admin_graphql_api_id": "gid://shopify/LineItem/1071823184", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459967, "admin_graphql_api_id": "gid://shopify/Order/1073459967", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:27:09-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/a322d3b3d1add5bb8671897946a69cbe/authenticate?key=338368464f7b33742721bf04547e1c0b", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:09-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "a322d3b3d1add5bb8671897946a69cbe", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:09-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339474, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:09-05:00", "updated_at": "2023-01-03T12:27:10-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:09-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339474"}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823177, "admin_graphql_api_id": "gid://shopify/LineItem/1071823177", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.email = "foo@example.com"; @@ -498,7 +498,7 @@ describe('Order resource', () => { }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459971, "admin_graphql_api_id": "gid://shopify/Order/1073459971", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2022-11-28T17:13:29-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/e7cefc24914c10ff6c254415f85e6931/authenticate?key=52d7e27a9be1af5a3e5305a06989dca7", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:29-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "e7cefc24914c10ff6c254415f85e6931", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:29-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339458, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:29-05:00", "updated_at": "2022-11-28T17:13:30-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:29-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339458"}, "discount_applications": [], "fulfillments": [{"id": 1069019862, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019862", "created_at": "2022-11-28T17:13:30-05:00", "location_id": 487838322, "name": "#1002.1", "order_id": 1073459971, "origin_address": {}, "receipt": {}, "service": "manual", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2022-11-28T17:13:30-05:00", "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459964, "admin_graphql_api_id": "gid://shopify/Order/1073459964", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:26:15-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/eecea5ec1db2273b6c5a895c8e13ff58/authenticate?key=a22af164f7a9206bb9254a0724447566", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:26:15-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "eecea5ec1db2273b6c5a895c8e13ff58", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:15-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339473, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:26:15-05:00", "updated_at": "2023-01-03T12:26:16-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:26:15-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339473"}, "discount_applications": [], "fulfillments": [{"id": 1069019862, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019862", "created_at": "2023-01-03T12:26:15-05:00", "location_id": 487838322, "name": "#1002.1", "order_id": 1073459964, "origin_address": {}, "receipt": {}, "service": "manual", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2023-01-03T12:26:15-05:00", "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.email = "foo@example.com"; @@ -524,7 +524,7 @@ describe('Order resource', () => { }); it('test_23', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459962, "admin_graphql_api_id": "gid://shopify/Order/1073459962", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2022-11-28T17:12:22-05:00", "currency": "USD", "current_subtotal_price": "181.09", "current_subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_discounts": "17.91", "current_total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "181.09", "current_total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "FAKE30", "amount": "17.91", "type": "percentage"}], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/cafd791ccfe1480135cba4179151c1a0/authenticate?key=a1f1594e66904b77e01ef5754d5a0145", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": "+18885551234", "presentment_currency": "USD", "processed_at": "2022-11-28T17:12:22-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "181.09", "subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "cafd791ccfe1480135cba4179151c1a0", "total_discounts": "17.91", "total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "131.09", "total_price": "181.09", "total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:22-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339456, "email": "jane@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:12:21-05:00", "updated_at": "2022-11-28T17:12:22-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:12:22-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317286, "customer_id": 1073339456, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "manual", "value": "9.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "FAKE30", "description": "FAKE30"}], "fulfillments": [], "line_items": [{"id": 1071823172, "admin_graphql_api_id": "gid://shopify/LineItem/1071823172", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "17.91", "amount_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459971, "admin_graphql_api_id": "gid://shopify/Order/1073459971", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2023-01-03T12:27:42-05:00", "currency": "USD", "current_subtotal_price": "181.09", "current_subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_discounts": "17.91", "current_total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "181.09", "current_total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "FAKE30", "amount": "17.91", "type": "percentage"}], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1b22331bf230d2f5b192b6c2965aff1/authenticate?key=a77ee802fb9a5928d3e50b38497a0710", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": "+18885551234", "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:42-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "181.09", "subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "b1b22331bf230d2f5b192b6c2965aff1", "total_discounts": "17.91", "total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "131.09", "total_price": "181.09", "total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:42-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339476, "email": "jane@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:41-05:00", "updated_at": "2023-01-03T12:27:42-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:41-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339476", "default_address": {"id": 1053317309, "customer_id": 1073339476, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "manual", "value": "9.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "FAKE30", "description": "FAKE30"}], "fulfillments": [], "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "17.91", "amount_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -583,7 +583,7 @@ describe('Order resource', () => { }); it('test_24', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459968, "admin_graphql_api_id": "gid://shopify/Order/1073459968", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:13:20-05:00", "currency": "USD", "current_subtotal_price": "255.92", "current_subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "270.37", "current_total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "current_total_tax": "14.45", "current_total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/85556fb7bf0703395d3e0f7eba8f2675/authenticate?key=36f4e65925a0d2312050634eed0e7650", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:20-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "255.92", "subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "10.20", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "10.20", "currency_code": "USD"}, "presentment_money": {"amount": "10.20", "currency_code": "USD"}}, "channel_liable": null}, {"price": "4.25", "rate": 0.025, "title": "County tax", "price_set": {"shop_money": {"amount": "4.25", "currency_code": "USD"}, "presentment_money": {"amount": "4.25", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "85556fb7bf0703395d3e0f7eba8f2675", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "255.92", "total_line_items_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "total_outstanding": "270.37", "total_price": "270.37", "total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "14.45", "total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:20-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823178, "admin_graphql_api_id": "gid://shopify/LineItem/1071823178", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1700, "name": "Red Leather Coat", "price": "129.99", "price_set": {"shop_money": {"amount": "129.99", "currency_code": "USD"}, "presentment_money": {"amount": "129.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": true, "title": "Red Leather Coat", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "7.81", "price_set": {"shop_money": {"amount": "7.81", "currency_code": "USD"}, "presentment_money": {"amount": "7.81", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "3.26", "price_set": {"shop_money": {"amount": "3.26", "currency_code": "USD"}, "presentment_money": {"amount": "3.26", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}, {"id": 1071823179, "admin_graphql_api_id": "gid://shopify/LineItem/1071823179", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 750, "name": "Blue Suede Shoes", "price": "85.95", "price_set": {"shop_money": {"amount": "85.95", "currency_code": "USD"}, "presentment_money": {"amount": "85.95", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": false, "title": "Blue Suede Shoes", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [], "duties": [], "discount_allocations": []}, {"id": 1071823180, "admin_graphql_api_id": "gid://shopify/LineItem/1071823180", "fulfillable_quantity": 2, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 320, "name": "Raspberry Beret", "price": "19.99", "price_set": {"shop_money": {"amount": "19.99", "currency_code": "USD"}, "presentment_money": {"amount": "19.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 2, "requires_shipping": true, "sku": null, "taxable": true, "title": "Raspberry Beret", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "2.39", "price_set": {"shop_money": {"amount": "2.39", "currency_code": "USD"}, "presentment_money": {"amount": "2.39", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "0.99", "price_set": {"shop_money": {"amount": "0.99", "currency_code": "USD"}, "presentment_money": {"amount": "0.99", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459970, "admin_graphql_api_id": "gid://shopify/Order/1073459970", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:27:34-05:00", "currency": "USD", "current_subtotal_price": "255.92", "current_subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "270.37", "current_total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "current_total_tax": "14.45", "current_total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/c92054d234b69c849746dd1dd0d1e3c5/authenticate?key=28bd5e97da3a1ed1e62ef43b0349ab20", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:34-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "255.92", "subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "10.20", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "10.20", "currency_code": "USD"}, "presentment_money": {"amount": "10.20", "currency_code": "USD"}}, "channel_liable": null}, {"price": "4.25", "rate": 0.025, "title": "County tax", "price_set": {"shop_money": {"amount": "4.25", "currency_code": "USD"}, "presentment_money": {"amount": "4.25", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "c92054d234b69c849746dd1dd0d1e3c5", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "255.92", "total_line_items_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "total_outstanding": "270.37", "total_price": "270.37", "total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "14.45", "total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:34-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823180, "admin_graphql_api_id": "gid://shopify/LineItem/1071823180", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1700, "name": "Red Leather Coat", "price": "129.99", "price_set": {"shop_money": {"amount": "129.99", "currency_code": "USD"}, "presentment_money": {"amount": "129.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": true, "title": "Red Leather Coat", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "7.81", "price_set": {"shop_money": {"amount": "7.81", "currency_code": "USD"}, "presentment_money": {"amount": "7.81", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "3.26", "price_set": {"shop_money": {"amount": "3.26", "currency_code": "USD"}, "presentment_money": {"amount": "3.26", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}, {"id": 1071823181, "admin_graphql_api_id": "gid://shopify/LineItem/1071823181", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 750, "name": "Blue Suede Shoes", "price": "85.95", "price_set": {"shop_money": {"amount": "85.95", "currency_code": "USD"}, "presentment_money": {"amount": "85.95", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": false, "title": "Blue Suede Shoes", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [], "duties": [], "discount_allocations": []}, {"id": 1071823182, "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "fulfillable_quantity": 2, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 320, "name": "Raspberry Beret", "price": "19.99", "price_set": {"shop_money": {"amount": "19.99", "currency_code": "USD"}, "presentment_money": {"amount": "19.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 2, "requires_shipping": true, "sku": null, "taxable": true, "title": "Raspberry Beret", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "2.39", "price_set": {"shop_money": {"amount": "2.39", "currency_code": "USD"}, "presentment_money": {"amount": "2.39", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "0.99", "price_set": {"shop_money": {"amount": "0.99", "currency_code": "USD"}, "presentment_money": {"amount": "0.99", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -633,7 +633,7 @@ describe('Order resource', () => { }); it('test_25', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:14:23-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:22-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -658,7 +658,7 @@ describe('Order resource', () => { }); it('test_26', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": "Customer contacted us about a custom engraving on this iPod", "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:41-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": "Customer contacted us about a custom engraving on this iPod", "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:57-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -676,7 +676,7 @@ describe('Order resource', () => { }); it('test_27', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "colour", "value": "red"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:57-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "colour", "value": "red"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:22-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -699,7 +699,7 @@ describe('Order resource', () => { }); it('test_28', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "a-different@email.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "a-different@email.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:43-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "a-different@email.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "a-different@email.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:53-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -717,7 +717,7 @@ describe('Order resource', () => { }); it('test_29', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+15145556677", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:52-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+15145556677", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:07-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -735,7 +735,7 @@ describe('Order resource', () => { }); it('test_30', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": true, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:39-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": true, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:36-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -753,7 +753,7 @@ describe('Order resource', () => { }); it('test_31', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:36-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:27-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -771,7 +771,7 @@ describe('Order resource', () => { }); it('test_32', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "External, Inbound, Outbound", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:18-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "External, Inbound, Outbound", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:09-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -789,7 +789,7 @@ describe('Order resource', () => { }); it('test_33', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:58-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "123 Ship Street", "phone": "+1(502)-459-2181", "city": "Shipsville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:07-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "123 Ship Street", "phone": "+1(502)-459-2181", "city": "Shipsville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; diff --git a/rest/admin/__tests__/2022-07/page.test.ts b/rest/admin/__tests__/2022-07/page.test.ts index 2dd1ba47f..e36168cba 100644 --- a/rest/admin/__tests__/2022-07/page.test.ts +++ b/rest/admin/__tests__/2022-07/page.test.ts @@ -31,116 +31,140 @@ describe('Page resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"pages": [{"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}]})); + queueMockResponse(JSON.stringify({"pages": [{"id": 108828309, "title": "Sample Page", "shop_id": 548380009, "handle": "sample", "body_html": "

this is a sample page.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}, {"id": 322471, "title": "Support", "shop_id": 548380009, "handle": "support", "body_html": "

Come in store for support.

", "author": "Dennis", "created_at": "2009-07-15T20:00:00-04:00", "updated_at": "2009-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"}, {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}]})); await shopify.rest.Page.all({ session: session, - since_id: "108828309", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/pages.json', - query: 'since_id=108828309', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"pages": [{"id": 108828309, "title": "Sample Page", "shop_id": 548380009, "handle": "sample", "body_html": "

this is a sample page.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}, {"id": 322471, "title": "Support", "shop_id": 548380009, "handle": "support", "body_html": "

Come in store for support.

", "author": "Dennis", "created_at": "2009-07-15T20:00:00-04:00", "updated_at": "2009-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"}, {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}]})); + queueMockResponse(JSON.stringify({"pages": [{"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}]})); await shopify.rest.Page.all({ session: session, + since_id: "108828309", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/pages.json', - query: '', + query: 'since_id=108828309', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"count": 4})); + queueMockResponse(JSON.stringify({"page": {"id": 1025371373, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:23:38-05:00", "updated_at": "2023-01-03T12:23:38-05:00", "published_at": "2023-01-03T12:23:38-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371373"}})); - await shopify.rest.Page.count({ - session: session, - }); + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + await page.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/pages/count.json', + path: '/admin/api/2022-07/pages.json', query: '', headers, - data: undefined + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"page": {"id": 1025371369, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:22:57-05:00", "updated_at": "2023-01-03T12:22:57-05:00", "published_at": "2023-01-03T12:22:57-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371369"}})); - await shopify.rest.Page.find({ - session: session, - id: 131092082, - }); + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.metafields = [ + { + "key": "new", + "value": "new value", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await page.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/pages/131092082.json', + path: '/admin/api/2022-07/pages.json', query: '', headers, - data: undefined + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "author": "Christopher Gorski", "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "handle": "new-warranty", "title": "New warranty", "id": 131092082, "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"page": {"id": 1025371374, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:23:49-05:00", "updated_at": "2023-01-03T12:23:49-05:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371374"}})); const page = new shopify.rest.Page({session: session}); - page.id = 131092082; - page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; - page.author = "Christopher Gorski"; - page.title = "New warranty"; - page.handle = "new-warranty"; + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.published = false; await page.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/pages/131092082.json', + path: '/admin/api/2022-07/pages.json', query: '', headers, - data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "author": "Christopher Gorski", "title": "New warranty", "handle": "new-warranty"} } + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "published": false} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "title": "Terms of Services", "handle": "tos", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:05-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"count": 4})); - const page = new shopify.rest.Page({session: session}); - page.id = 131092082; - page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; - await page.save({}); + await shopify.rest.Page.count({ + session: session, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-07/pages/131092082.json', + path: '/admin/api/2022-07/pages/count.json', query: '', headers, - data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:06-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"page": {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + + await shopify.rest.Page.find({ + session: session, + id: 131092082, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2022-07/pages/131092082.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:26-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); page.id = 131092082; @@ -164,8 +188,8 @@ describe('Page resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": null, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:11-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + it('test_9', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": null, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:07-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); page.id = 131092082; @@ -182,8 +206,8 @@ describe('Page resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_9', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": "2022-10-03T12:54:12-04:00", "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:12-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + it('test_10', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": "2023-01-03T12:23:46-05:00", "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:46-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); page.id = 131092082; @@ -200,84 +224,60 @@ describe('Page resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_10', async () => { - queueMockResponse(JSON.stringify({})); - - await shopify.rest.Page.delete({ - session: session, - id: 131092082, - }); - - expect({ - method: 'DELETE', - domain, - path: '/admin/api/2022-07/pages/131092082.json', - query: '', - headers, - data: undefined - }).toMatchMadeHttpRequest(); - }); - it('test_11', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 1025371368, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2022-10-03T12:53:50-04:00", "updated_at": "2022-10-03T12:53:50-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371368"}})); + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "author": "Christopher Gorski", "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "handle": "new-warranty", "title": "New warranty", "id": 131092082, "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:28-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); - page.title = "Warranty information"; - page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; - page.published = false; + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; + page.author = "Christopher Gorski"; + page.title = "New warranty"; + page.handle = "new-warranty"; await page.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/pages.json', + path: '/admin/api/2022-07/pages/131092082.json', query: '', headers, - data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "published": false} } + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "author": "Christopher Gorski", "title": "New warranty", "handle": "new-warranty"} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 1025371371, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2022-10-03T12:54:10-04:00", "updated_at": "2022-10-03T12:54:10-04:00", "published_at": "2022-10-03T12:54:10-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371371"}})); + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "title": "Terms of Services", "handle": "tos", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:08-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); - page.title = "Warranty information"; - page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; - page.metafields = [ - { - "key": "new", - "value": "new value", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; await page.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/pages.json', + path: '/admin/api/2022-07/pages/131092082.json', query: '', headers, - data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

"} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 1025371374, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2022-10-03T12:54:22-04:00", "updated_at": "2022-10-03T12:54:22-04:00", "published_at": "2022-10-03T12:54:22-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371374"}})); + queueMockResponse(JSON.stringify({})); - const page = new shopify.rest.Page({session: session}); - page.title = "Warranty information"; - page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; - await page.save({}); + await shopify.rest.Page.delete({ + session: session, + id: 131092082, + }); expect({ - method: 'POST', + method: 'DELETE', domain, - path: '/admin/api/2022-07/pages.json', + path: '/admin/api/2022-07/pages/131092082.json', query: '', headers, - data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"} } + data: undefined }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/payment.test.ts b/rest/admin/__tests__/2022-07/payment.test.ts index 034d77997..9e146101c 100644 --- a/rest/admin/__tests__/2022-07/payment.test.ts +++ b/rest/admin/__tests__/2022-07/payment.test.ts @@ -31,7 +31,7 @@ describe('Payment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"payment": {"id": 1071573807, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2023, "customer_id": 207119551}, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}, {"id": 1071573807, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2023, "customer_id": 207119551}}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2022-10-03T12:52:28-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2023, "customer_id": 207119551}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + queueMockResponse(JSON.stringify({"payment": {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}, {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:42:43-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); const payment = new shopify.rest.Payment({session: session}); payment.checkout_id = "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x"; @@ -41,7 +41,7 @@ describe('Payment resource', () => { "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" }; payment.amount = "398.00"; - payment.session_id = "global-98c9624a14e5f4b0"; + payment.session_id = "global-d127b9b88aa1043d"; payment.unique_token = "client-side-idempotency-token"; await payment.save({}); @@ -51,12 +51,12 @@ describe('Payment resource', () => { path: '/admin/api/2022-07/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments.json', query: '', headers, - data: { "payment": {"request_details": {"ip_address": "123.1.1.1", "accept_language": "en-US,en;q=0.8,fr;q=0.6", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, "amount": "398.00", "session_id": "global-98c9624a14e5f4b0", "unique_token": "client-side-idempotency-token"} } + data: { "payment": {"request_details": {"ip_address": "123.1.1.1", "accept_language": "en-US,en;q=0.8,fr;q=0.6", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, "amount": "398.00", "session_id": "global-d127b9b88aa1043d", "unique_token": "client-side-idempotency-token"} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}]})); + queueMockResponse(JSON.stringify({"payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}]})); await shopify.rest.Payment.all({ session: session, @@ -74,7 +74,7 @@ describe('Payment resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:24-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278472, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:24-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278472, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:23-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278482, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:23-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278482, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); await shopify.rest.Payment.find({ session: session, @@ -93,7 +93,7 @@ describe('Payment resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:41-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278473, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:41-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278473, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:30-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278483, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:30-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278483, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); await shopify.rest.Payment.find({ session: session, diff --git a/rest/admin/__tests__/2022-07/payment_gateway.test.ts b/rest/admin/__tests__/2022-07/payment_gateway.test.ts index a11a88951..6f4c928aa 100644 --- a/rest/admin/__tests__/2022-07/payment_gateway.test.ts +++ b/rest/admin/__tests__/2022-07/payment_gateway.test.ts @@ -31,42 +31,60 @@ describe('PaymentGateway resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2022-10-03T12:24:45-04:00", "credential4": null, "attachment": null}]})); + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:58-05:00", "credential4": null, "attachment": null}, {"disabled": true, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": false, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}]})); await shopify.rest.PaymentGateway.all({ session: session, - disabled: "false", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/payment_gateways.json', - query: 'disabled=false', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2022-10-03T12:24:52-04:00", "credential4": null, "attachment": null}, {"disabled": true, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": false, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}]})); + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:52-05:00", "credential4": null, "attachment": null}]})); await shopify.rest.PaymentGateway.all({ session: session, + disabled: "false", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/payment_gateways.json', - query: '', + query: 'disabled=false', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"payment": {"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2022-10-03T12:24:50-04:00", "credential4": null, "attachment": null}})); + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 1048196722, "name": "authorize_net", "provider_id": 7, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club", "jcb"], "processing_method": "direct", "service_name": "Authorize.net", "metadata": {}, "created_at": "2023-01-03T12:21:57-05:00", "updated_at": "2023-01-03T12:21:57-05:00", "credential1": "someone@example.com", "credential3": null, "credential4": null, "attachment": null}})); + + const payment_gateway = new shopify.rest.PaymentGateway({session: session}); + payment_gateway.credential1 = "someone@example.com"; + payment_gateway.provider_id = 7; + await payment_gateway.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/payment_gateways.json', + query: '', + headers, + data: { "payment_gateway": {"credential1": "someone@example.com", "provider_id": 7} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"payment": {"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:54-05:00", "credential4": null, "attachment": null}})); await shopify.rest.PaymentGateway.find({ session: session, @@ -83,8 +101,8 @@ describe('PaymentGateway resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_4', async () => { - queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": true, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:24:52-04:00"}})); + it('test_5', async () => { + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": true, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:22:03-05:00"}})); const payment_gateway = new shopify.rest.PaymentGateway({session: session}); payment_gateway.id = 170508070; @@ -101,7 +119,7 @@ describe('PaymentGateway resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { + it('test_6', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.PaymentGateway.delete({ @@ -119,22 +137,4 @@ describe('PaymentGateway resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 1048196722, "name": "authorize_net", "provider_id": 7, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club", "jcb"], "processing_method": "direct", "service_name": "Authorize.net", "metadata": {}, "created_at": "2022-10-03T12:24:47-04:00", "updated_at": "2022-10-03T12:24:47-04:00", "credential1": "someone@example.com", "credential3": null, "credential4": null, "attachment": null}})); - - const payment_gateway = new shopify.rest.PaymentGateway({session: session}); - payment_gateway.credential1 = "someone@example.com"; - payment_gateway.provider_id = 7; - await payment_gateway.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-07/payment_gateways.json', - query: '', - headers, - data: { "payment_gateway": {"credential1": "someone@example.com", "provider_id": 7} } - }).toMatchMadeHttpRequest(); - }); - }); diff --git a/rest/admin/__tests__/2022-07/policy.test.ts b/rest/admin/__tests__/2022-07/policy.test.ts index d9e234913..042dcc32e 100644 --- a/rest/admin/__tests__/2022-07/policy.test.ts +++ b/rest/admin/__tests__/2022-07/policy.test.ts @@ -31,7 +31,7 @@ describe('Policy resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"policies": [{"body": "You have 30 days to get a refund", "created_at": "2022-10-03T12:52:45-04:00", "updated_at": "2022-10-03T12:52:45-04:00", "handle": "refund-policy", "title": "Refund policy", "url": "https://jsmith.myshopify.com/548380009/policies/878590288"}]})); + queueMockResponse(JSON.stringify({"policies": [{"body": "You have 30 days to get a refund", "created_at": "2023-01-03T12:39:49-05:00", "updated_at": "2023-01-03T12:39:49-05:00", "handle": "refund-policy", "title": "Refund policy", "url": "https://jsmith.myshopify.com/548380009/policies/878590288"}]})); await shopify.rest.Policy.all({ session: session, diff --git a/rest/admin/__tests__/2022-07/price_rule.test.ts b/rest/admin/__tests__/2022-07/price_rule.test.ts index 9f2b49ca4..7cae103ee 100644 --- a/rest/admin/__tests__/2022-07/price_rule.test.ts +++ b/rest/admin/__tests__/2022-07/price_rule.test.ts @@ -31,7 +31,7 @@ describe('PriceRule resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341478, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "allocation_limit": 3, "once_per_customer": false, "usage_limit": null, "starts_at": "2018-03-21T20:00:00-04:00", "ends_at": null, "created_at": "2022-10-03T12:24:17-04:00", "updated_at": "2022-10-03T12:24:17-04:00", "entitled_product_ids": [921728736], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [841564295], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "Buy2iPodsGetiPodTouchForFree", "admin_graphql_api_id": "gid://shopify/PriceRule/996341478"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341481, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "allocation_limit": 3, "once_per_customer": false, "usage_limit": null, "starts_at": "2018-03-21T20:00:00-04:00", "ends_at": null, "created_at": "2023-01-03T12:06:59-05:00", "updated_at": "2023-01-03T12:06:59-05:00", "entitled_product_ids": [921728736], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [841564295], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "Buy2iPodsGetiPodTouchForFree", "admin_graphql_api_id": "gid://shopify/PriceRule/996341481"}})); const price_rule = new shopify.rest.PriceRule({session: session}); price_rule.title = "Buy2iPodsGetiPodTouchForFree"; @@ -66,20 +66,16 @@ describe('PriceRule resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341479, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "allocation_limit": null, "once_per_customer": false, "usage_limit": 20, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2022-10-03T12:24:18-04:00", "updated_at": "2022-10-03T12:24:18-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "FREESHIPPING", "admin_graphql_api_id": "gid://shopify/PriceRule/996341479"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341478, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:46-05:00", "updated_at": "2023-01-03T12:06:46-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/996341478"}})); const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.title = "FREESHIPPING"; - price_rule.target_type = "shipping_line"; + price_rule.title = "SUMMERSALE10OFF"; + price_rule.target_type = "line_item"; price_rule.target_selection = "all"; - price_rule.allocation_method = "each"; - price_rule.value_type = "percentage"; - price_rule.value = "-100.0"; - price_rule.usage_limit = 20; + price_rule.allocation_method = "across"; + price_rule.value_type = "fixed_amount"; + price_rule.value = "-10.0"; price_rule.customer_selection = "all"; - price_rule.prerequisite_subtotal_range = { - "greater_than_or_equal_to": "50.0" - }; price_rule.starts_at = "2017-01-19T17:59:10Z"; await price_rule.save({}); @@ -89,21 +85,24 @@ describe('PriceRule resource', () => { path: '/admin/api/2022-07/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "FREESHIPPING", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "value_type": "percentage", "value": "-100.0", "usage_limit": 20, "customer_selection": "all", "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "starts_at": "2017-01-19T17:59:10Z"} } + data: { "price_rule": {"title": "SUMMERSALE10OFF", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "starts_at": "2017-01-19T17:59:10Z"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341480, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2022-10-03T12:24:22-04:00", "updated_at": "2022-10-03T12:24:22-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/996341480"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341480, "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:56-05:00", "updated_at": "2023-01-03T12:06:56-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [841564295], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "15OFFCOLLECTION", "admin_graphql_api_id": "gid://shopify/PriceRule/996341480"}})); const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.title = "SUMMERSALE10OFF"; + price_rule.title = "15OFFCOLLECTION"; price_rule.target_type = "line_item"; - price_rule.target_selection = "all"; + price_rule.target_selection = "entitled"; price_rule.allocation_method = "across"; - price_rule.value_type = "fixed_amount"; - price_rule.value = "-10.0"; + price_rule.value_type = "percentage"; + price_rule.value = "-15.0"; price_rule.customer_selection = "all"; + price_rule.entitled_collection_ids = [ + 841564295 + ]; price_rule.starts_at = "2017-01-19T17:59:10Z"; await price_rule.save({}); @@ -113,24 +112,25 @@ describe('PriceRule resource', () => { path: '/admin/api/2022-07/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "SUMMERSALE10OFF", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "starts_at": "2017-01-19T17:59:10Z"} } + data: { "price_rule": {"title": "15OFFCOLLECTION", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "entitled_collection_ids": [841564295], "starts_at": "2017-01-19T17:59:10Z"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341481, "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2022-10-03T12:24:29-04:00", "updated_at": "2022-10-03T12:24:29-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [841564295], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "15OFFCOLLECTION", "admin_graphql_api_id": "gid://shopify/PriceRule/996341481"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341479, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "allocation_limit": null, "once_per_customer": false, "usage_limit": 20, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:52-05:00", "updated_at": "2023-01-03T12:06:52-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "FREESHIPPING", "admin_graphql_api_id": "gid://shopify/PriceRule/996341479"}})); const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.title = "15OFFCOLLECTION"; - price_rule.target_type = "line_item"; - price_rule.target_selection = "entitled"; - price_rule.allocation_method = "across"; + price_rule.title = "FREESHIPPING"; + price_rule.target_type = "shipping_line"; + price_rule.target_selection = "all"; + price_rule.allocation_method = "each"; price_rule.value_type = "percentage"; - price_rule.value = "-15.0"; + price_rule.value = "-100.0"; + price_rule.usage_limit = 20; price_rule.customer_selection = "all"; - price_rule.entitled_collection_ids = [ - 841564295 - ]; + price_rule.prerequisite_subtotal_range = { + "greater_than_or_equal_to": "50.0" + }; price_rule.starts_at = "2017-01-19T17:59:10Z"; await price_rule.save({}); @@ -140,93 +140,93 @@ describe('PriceRule resource', () => { path: '/admin/api/2022-07/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "15OFFCOLLECTION", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "entitled_collection_ids": [841564295], "starts_at": "2017-01-19T17:59:10Z"} } + data: { "price_rule": {"title": "FREESHIPPING", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "value_type": "percentage", "value": "-100.0", "usage_limit": 20, "customer_selection": "all", "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "starts_at": "2017-01-19T17:59:10Z"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:24:20-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "WINTER SALE", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}, {"id": 106886544, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2023-01-01T12:05:09-05:00", "ends_at": "2023-01-05T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "TENOFF", "admin_graphql_api_id": "gid://shopify/PriceRule/106886544"}]})); - const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.id = 507328175; - price_rule.title = "WINTER SALE"; - await price_rule.save({}); + await shopify.rest.PriceRule.all({ + session: session, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-07/price_rules/507328175.json', + path: '/admin/api/2022-07/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "WINTER SALE"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}]})); - await shopify.rest.PriceRule.find({ + await shopify.rest.PriceRule.all({ session: session, - id: 507328175, + since_id: "106886545", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/price_rules/507328175.json', - query: '', + path: '/admin/api/2022-07/price_rules.json', + query: 'since_id=106886545', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:55-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "WINTER SALE", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); - await shopify.rest.PriceRule.delete({ - session: session, - id: 507328175, - }); + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.id = 507328175; + price_rule.title = "WINTER SALE"; + await price_rule.save({}); expect({ - method: 'DELETE', + method: 'PUT', domain, path: '/admin/api/2022-07/price_rules/507328175.json', query: '', headers, - data: undefined + data: { "price_rule": {"title": "WINTER SALE"} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}]})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); - await shopify.rest.PriceRule.all({ + await shopify.rest.PriceRule.find({ session: session, - since_id: "106886545", + id: 507328175, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/price_rules.json', - query: 'since_id=106886545', + path: '/admin/api/2022-07/price_rules/507328175.json', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}, {"id": 106886544, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-10-01T12:15:55-04:00", "ends_at": "2022-10-05T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "TENOFF", "admin_graphql_api_id": "gid://shopify/PriceRule/106886544"}]})); + queueMockResponse(JSON.stringify({})); - await shopify.rest.PriceRule.all({ + await shopify.rest.PriceRule.delete({ session: session, + id: 507328175, }); expect({ - method: 'GET', + method: 'DELETE', domain, - path: '/admin/api/2022-07/price_rules.json', + path: '/admin/api/2022-07/price_rules/507328175.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/product.test.ts b/rest/admin/__tests__/2022-07/product.test.ts index 543eee87b..426b21c4f 100644 --- a/rest/admin/__tests__/2022-07/product.test.ts +++ b/rest/admin/__tests__/2022-07/product.test.ts @@ -31,60 +31,60 @@ describe('Product resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, + ids: "632910392,921728736", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products.json', - query: '', + query: 'ids=632910392%2C921728736', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, - ids: "632910392,921728736", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products.json', - query: 'ids=632910392%2C921728736', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}, {"id": 921728736, "title": "IPod Touch 8GB", "images": []}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, - fields: "id,images,title", + since_id: "632910392", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products.json', - query: 'fields=id%2Cimages%2Ctitle', + query: 'since_id=632910392', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); await shopify.rest.Product.all({ session: session, @@ -102,364 +102,344 @@ describe('Product resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, - since_id: "632910392", + presentment_currencies: "USD", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products.json', - query: 'since_id=632910392', + query: 'presentment_currencies=USD', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}, {"id": 921728736, "title": "IPod Touch 8GB", "images": []}]})); await shopify.rest.Product.all({ session: session, - presentment_currencies: "USD", + fields: "id,images,title", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products.json', - query: 'presentment_currencies=USD', + query: 'fields=id%2Cimages%2Ctitle', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559591, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:24-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:24-04:00", "published_at": "2022-09-28T16:39:24-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, Big Air, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/1071559591", "variants": [{"id": 1070325046, "product_id": 1071559591, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:24-04:00", "updated_at": "2022-09-28T16:39:24-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325046, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325046"}], "options": [{"id": 1055547204, "product_id": 1071559591, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"count": 2})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.tags = [ - "Barnes & Noble", - "Big Air", - "John's Fav" - ]; - await product.save({}); + await shopify.rest.Product.count({ + session: session, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/products.json', + path: '/admin/api/2022-07/products/count.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "tags": ["Barnes & Noble", "Big Air", "John's Fav"]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559592, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:26-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:26-04:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559592", "variants": [{"id": 1070325047, "product_id": 1071559592, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:26-04:00", "updated_at": "2022-09-28T16:39:26-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325047, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325047"}], "options": [{"id": 1055547205, "product_id": 1071559592, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"count": 1})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.published = false; - await product.save({}); + await shopify.rest.Product.count({ + session: session, + collection_id: "841564295", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/products.json', - query: '', + path: '/admin/api/2022-07/products/count.json', + query: 'collection_id=841564295', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559593, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:28-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:28-04:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559593", "variants": [{"id": 1070325048, "product_id": 1071559593, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:28-04:00", "updated_at": "2022-09-28T16:39:28-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325048, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325048"}], "options": [{"id": 1055547206, "product_id": 1071559593, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.status = "draft"; - await product.save({}); + await shopify.rest.Product.find({ + session: session, + id: 632910392, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/products.json', + path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "status": "draft"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559594, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:29-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:30-04:00", "published_at": "2022-09-28T16:39:29-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559594", "variants": [{"id": 1070325049, "product_id": 1071559594, "title": "First", "price": "10.00", "sku": "123", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "First", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:30-04:00", "updated_at": "2022-09-28T16:39:30-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325049, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "10.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325049"}, {"id": 1070325050, "product_id": 1071559594, "title": "Second", "price": "20.00", "sku": "123", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Second", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:30-04:00", "updated_at": "2022-09-28T16:39:30-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325050, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "20.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325050"}], "options": [{"id": 1055547207, "product_id": 1071559594, "name": "Title", "position": 1, "values": ["First", "Second"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.variants = [ - { - "option1": "First", - "price": "10.00", - "sku": "123" - }, - { - "option1": "Second", - "price": "20.00", - "sku": "123" - } - ]; - await product.save({}); + await shopify.rest.Product.find({ + session: session, + id: 632910392, + fields: "id,images,title", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/products.json', - query: '', + path: '/admin/api/2022-07/products/632910392.json', + query: 'fields=id%2Cimages%2Ctitle', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "First", "price": "10.00", "sku": "123"}, {"option1": "Second", "price": "20.00", "sku": "123"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559595, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:32-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:32-04:00", "published_at": "2022-09-28T16:39:32-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559595", "variants": [{"id": 1070325051, "product_id": 1071559595, "title": "Blue / 155", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Blue", "option2": "155", "option3": null, "created_at": "2022-09-28T16:39:32-04:00", "updated_at": "2022-09-28T16:39:32-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325051, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325051"}, {"id": 1070325052, "product_id": 1071559595, "title": "Black / 159", "price": "0.00", "sku": "", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Black", "option2": "159", "option3": null, "created_at": "2022-09-28T16:39:32-04:00", "updated_at": "2022-09-28T16:39:32-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325052, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325052"}], "options": [{"id": 1055547208, "product_id": 1071559595, "name": "Color", "position": 1, "values": ["Blue", "Black"]}, {"id": 1055547209, "product_id": 1071559595, "name": "Size", "position": 2, "values": ["155", "159"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:19-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.variants = [ - { - "option1": "Blue", - "option2": "155" - }, - { - "option1": "Black", - "option2": "159" - } - ]; - product.options = [ - { - "name": "Color", - "values": [ - "Blue", - "Black" - ] - }, + product.id = 632910392; + product.metafields = [ { - "name": "Size", - "values": [ - "155", - "159" - ] + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" } ]; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products.json', + path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "Blue", "option2": "155"}, {"option1": "Black", "option2": "159"}], "options": [{"name": "Color", "values": ["Blue", "Black"]}, {"name": "Size", "values": ["155", "159"]}]} } + data: { "product": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559596, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:34-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:34-04:00", "published_at": "2022-09-28T16:39:34-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559596", "variants": [{"id": 1070325053, "product_id": 1071559596, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:34-04:00", "updated_at": "2022-09-28T16:39:34-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325053, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325053"}], "options": [{"id": 1055547210, "product_id": 1071559596, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473898, "product_id": 1071559596, "position": 1, "created_at": "2022-09-28T16:39:34-04:00", "updated_at": "2022-09-28T16:39:34-04:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664397574", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473898"}], "image": {"id": 1001473898, "product_id": 1071559596, "position": 1, "created_at": "2022-09-28T16:39:34-04:00", "updated_at": "2022-09-28T16:39:34-04:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664397574", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473898"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:07-05:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.images = [ - { - "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" - } - ]; + product.id = 632910392; + product.published = false; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products.json', + path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}]} } + data: { "product": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559597, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:36-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:37-04:00", "published_at": "2022-09-28T16:39:36-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559597", "variants": [{"id": 1070325054, "product_id": 1071559597, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:36-04:00", "updated_at": "2022-09-28T16:39:36-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325054, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325054"}], "options": [{"id": 1055547211, "product_id": 1071559597, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473899, "product_id": 1071559597, "position": 1, "created_at": "2022-09-28T16:39:36-04:00", "updated_at": "2022-09-28T16:39:36-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20220928-1971383-vfpdob.gif?v=1664397576", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473899"}], "image": {"id": 1001473899, "product_id": 1071559597, "position": 1, "created_at": "2022-09-28T16:39:36-04:00", "updated_at": "2022-09-28T16:39:36-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20220928-1971383-vfpdob.gif?v=1664397576", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473899"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:25-05:00", "published_at": "2023-01-03T12:59:24-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.images = [ - { - "src": "http://example.com/rails_logo.gif" - } - ]; + product.id = 632910392; + product.published = true; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products.json', + path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"src": "http://example.com/rails_logo.gif"}]} } + data: { "product": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559598, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:40-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:40-04:00", "published_at": "2022-09-28T16:39:40-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559598", "variants": [{"id": 1070325055, "product_id": 1071559598, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:40-04:00", "updated_at": "2022-09-28T16:39:40-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325055, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325055"}], "options": [{"id": 1055547212, "product_id": 1071559598, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "Updated Product Title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:21-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "2000.00", "sku": "Updating the Product SKU", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:00:20-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.metafields_global_title_tag = "Product SEO Title"; - product.metafields_global_description_tag = "Product SEO Description"; + product.id = 632910392; + product.title = "Updated Product Title"; + product.variants = [ + { + "id": 808950810, + "price": "2000.00", + "sku": "Updating the Product SKU" + }, + { + "id": 49148385 + }, + { + "id": 39072856 + }, + { + "id": 457924702 + } + ]; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products.json', + path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields_global_title_tag": "Product SEO Title", "metafields_global_description_tag": "Product SEO Description"} } + data: { "product": {"title": "Updated Product Title", "variants": [{"id": 808950810, "price": "2000.00", "sku": "Updating the Product SKU"}, {"id": 49148385}, {"id": 39072856}, {"id": 457924702}]} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559599, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:42-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:42-04:00", "published_at": "2022-09-28T16:39:42-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559599", "variants": [{"id": 1070325056, "product_id": 1071559599, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:42-04:00", "updated_at": "2022-09-28T16:39:42-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325056, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325056"}], "options": [{"id": 1055547213, "product_id": 1071559599, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:02:22-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 1001473910, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T13:02:22-05:00", "updated_at": "2023-01-03T13:02:22-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-3uie15.gif?v=1672768942", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473910"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.metafields = [ + product.id = 632910392; + product.images = [ { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" + "id": 850703190 + }, + { + "id": 562641783 + }, + { + "id": 378407906 + }, + { + "src": "http://example.com/rails_logo.gif" } ]; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products.json', + path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "product": {"images": [{"id": 850703190}, {"id": 562641783}, {"id": 378407906}, {"src": "http://example.com/rails_logo.gif"}]} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"count": 2})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:57-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:59:57-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [], "image": null}})); - await shopify.rest.Product.count({ - session: session, - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = []; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-07/products/count.json', + path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: undefined + data: { "product": {"images": []} } }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:01:34-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 850703190, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}], "image": {"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}}})); - await shopify.rest.Product.count({ - session: session, - collection_id: "841564295", - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = [ + { + "id": 850703190, + "position": 3 + }, + { + "id": 562641783, + "position": 2 + }, + { + "id": 378407906, + "position": 1 + } + ]; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-07/products/count.json', - query: 'collection_id=841564295', + path: '/admin/api/2022-07/products/632910392.json', + query: '', headers, - data: undefined + data: { "product": {"images": [{"id": 850703190, "position": 3}, {"id": 562641783, "position": 2}, {"id": 378407906, "position": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:02:16-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Black", "Green", "Red", "Pink"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); - await shopify.rest.Product.find({ - session: session, - id: 632910392, - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.variants = [ + { + "id": 457924702 + }, + { + "id": 39072856 + }, + { + "id": 49148385 + }, + { + "id": 808950810 + } + ]; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: undefined + data: { "product": {"variants": [{"id": 457924702}, {"id": 39072856}, {"id": 49148385}, {"id": 808950810}]} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); - await shopify.rest.Product.find({ - session: session, - id: 632910392, - fields: "id,images,title", - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.metafields_global_title_tag = "Brand new title"; + product.metafields_global_description_tag = "Brand new description"; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-07/products/632910392.json', - query: 'fields=id%2Cimages%2Ctitle', + query: '', headers, - data: undefined + data: { "product": {"metafields_global_title_tag": "Brand new title", "metafields_global_description_tag": "Brand new description"} } }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "New product title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:20-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:11-05:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); product.id = 632910392; - product.title = "New product title"; + product.status = "draft"; await product.save({}); expect({ @@ -468,16 +448,16 @@ describe('Product resource', () => { path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"title": "New product title"} } + data: { "product": {"status": "draft"} } }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:22-04:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:46-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); product.id = 632910392; - product.status = "draft"; + product.tags = "Barnes & Noble, John's Fav"; await product.save({}); expect({ @@ -486,16 +466,16 @@ describe('Product resource', () => { path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"status": "draft"} } + data: { "product": {"tags": "Barnes & Noble, John's Fav"} } }).toMatchMadeHttpRequest(); }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:24-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "New product title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:01:10-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); product.id = 632910392; - product.tags = "Barnes & Noble, John's Fav"; + product.title = "New product title"; await product.save({}); expect({ @@ -504,215 +484,231 @@ describe('Product resource', () => { path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"tags": "Barnes & Noble, John's Fav"} } + data: { "product": {"title": "New product title"} } }).toMatchMadeHttpRequest(); }); it('test_23', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:26-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:26-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({})); - const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.images = []; - await product.save({}); + await shopify.rest.Product.delete({ + session: session, + id: 632910392, + }); expect({ - method: 'PUT', + method: 'DELETE', domain, path: '/admin/api/2022-07/products/632910392.json', query: '', headers, - data: { "product": {"images": []} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_24', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:30-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 1001473901, "product_id": 632910392, "position": 4, "created_at": "2022-09-28T16:40:30-04:00", "updated_at": "2022-09-28T16:40:30-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20220928-1971383-urea82.gif?v=1664397630", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473901"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559595, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:02:18-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:02:18-05:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559595", "variants": [{"id": 1070325052, "product_id": 1071559595, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:02:18-05:00", "updated_at": "2023-01-03T13:02:18-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325052, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325052"}], "options": [{"id": 1055547207, "product_id": 1071559595, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.images = [ - { - "id": 850703190 - }, - { - "id": 562641783 - }, - { - "id": 378407906 - }, - { - "src": "http://example.com/rails_logo.gif" - } - ]; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.status = "draft"; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392.json', + path: '/admin/api/2022-07/products.json', query: '', headers, - data: { "product": {"images": [{"id": 850703190}, {"id": 562641783}, {"id": 378407906}, {"src": "http://example.com/rails_logo.gif"}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "status": "draft"} } }).toMatchMadeHttpRequest(); }); it('test_25', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:33-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:33-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397633", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 850703190, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:33-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397633", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}], "image": {"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:33-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397633", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559585, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:56-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:56-05:00", "published_at": "2023-01-03T13:00:56-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559585", "variants": [{"id": 1070325040, "product_id": 1071559585, "title": "First", "price": "10.00", "sku": "123", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "First", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:56-05:00", "updated_at": "2023-01-03T13:00:56-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325040, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "10.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325040"}, {"id": 1070325041, "product_id": 1071559585, "title": "Second", "price": "20.00", "sku": "123", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Second", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:56-05:00", "updated_at": "2023-01-03T13:00:56-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325041, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "20.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325041"}], "options": [{"id": 1055547196, "product_id": 1071559585, "name": "Title", "position": 1, "values": ["First", "Second"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.images = [ - { - "id": 850703190, - "position": 3 - }, + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.variants = [ { - "id": 562641783, - "position": 2 + "option1": "First", + "price": "10.00", + "sku": "123" }, { - "id": 378407906, - "position": 1 + "option1": "Second", + "price": "20.00", + "sku": "123" } ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392.json', + path: '/admin/api/2022-07/products.json', query: '', headers, - data: { "product": {"images": [{"id": 850703190, "position": 3}, {"id": 562641783, "position": 2}, {"id": 378407906, "position": 1}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "First", "price": "10.00", "sku": "123"}, {"option1": "Second", "price": "20.00", "sku": "123"}]} } }).toMatchMadeHttpRequest(); }); it('test_26', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:36-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Black", "Green", "Red", "Pink"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559582, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:15-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:15-05:00", "published_at": "2023-01-03T13:00:15-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559582", "variants": [{"id": 1070325035, "product_id": 1071559582, "title": "Blue / 155", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Blue", "option2": "155", "option3": null, "created_at": "2023-01-03T13:00:15-05:00", "updated_at": "2023-01-03T13:00:15-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325035, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325035"}, {"id": 1070325036, "product_id": 1071559582, "title": "Black / 159", "price": "0.00", "sku": "", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Black", "option2": "159", "option3": null, "created_at": "2023-01-03T13:00:15-05:00", "updated_at": "2023-01-03T13:00:15-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325036, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325036"}], "options": [{"id": 1055547192, "product_id": 1071559582, "name": "Color", "position": 1, "values": ["Blue", "Black"]}, {"id": 1055547193, "product_id": 1071559582, "name": "Size", "position": 2, "values": ["155", "159"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; product.variants = [ { - "id": 457924702 + "option1": "Blue", + "option2": "155" }, { - "id": 39072856 - }, + "option1": "Black", + "option2": "159" + } + ]; + product.options = [ { - "id": 49148385 + "name": "Color", + "values": [ + "Blue", + "Black" + ] }, { - "id": 808950810 + "name": "Size", + "values": [ + "155", + "159" + ] } ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392.json', + path: '/admin/api/2022-07/products.json', query: '', headers, - data: { "product": {"variants": [{"id": 457924702}, {"id": 39072856}, {"id": 49148385}, {"id": 808950810}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "Blue", "option2": "155"}, {"option1": "Black", "option2": "159"}], "options": [{"name": "Color", "values": ["Blue", "Black"]}, {"name": "Size", "values": ["155", "159"]}]} } }).toMatchMadeHttpRequest(); }); it('test_27', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "Updated Product Title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:40-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "2000.00", "sku": "Updating the Product SKU", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:40-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559586, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:01:04-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:01:04-05:00", "published_at": "2023-01-03T13:01:04-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "Barnes & Noble, Big Air, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/1071559586", "variants": [{"id": 1070325042, "product_id": 1071559586, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:01:04-05:00", "updated_at": "2023-01-03T13:01:04-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325042, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325042"}], "options": [{"id": 1055547197, "product_id": 1071559586, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.title = "Updated Product Title"; - product.variants = [ - { - "id": 808950810, - "price": "2000.00", - "sku": "Updating the Product SKU" - }, - { - "id": 49148385 - }, - { - "id": 39072856 - }, - { - "id": 457924702 - } + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.tags = [ + "Barnes & Noble", + "Big Air", + "John's Fav" ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392.json', + path: '/admin/api/2022-07/products.json', query: '', headers, - data: { "product": {"title": "Updated Product Title", "variants": [{"id": 808950810, "price": "2000.00", "sku": "Updating the Product SKU"}, {"id": 49148385}, {"id": 39072856}, {"id": 457924702}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "tags": ["Barnes & Noble", "Big Air", "John's Fav"]} } }).toMatchMadeHttpRequest(); }); it('test_28', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559578, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T12:59:53-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T12:59:53-05:00", "published_at": "2023-01-03T12:59:53-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559578", "variants": [{"id": 1070325031, "product_id": 1071559578, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325031, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325031"}], "options": [{"id": 1055547186, "product_id": 1071559578, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473906, "product_id": 1071559578, "position": 1, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-j94qo6.gif?v=1672768793", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473906"}], "image": {"id": 1001473906, "product_id": 1071559578, "position": 1, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-j94qo6.gif?v=1672768793", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473906"}}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.metafields_global_title_tag = "Brand new title"; - product.metafields_global_description_tag = "Brand new description"; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "src": "http://example.com/rails_logo.gif" + } + ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392.json', + path: '/admin/api/2022-07/products.json', query: '', headers, - data: { "product": {"metafields_global_title_tag": "Brand new title", "metafields_global_description_tag": "Brand new description"} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"src": "http://example.com/rails_logo.gif"}]} } }).toMatchMadeHttpRequest(); }); it('test_29', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:45-04:00", "published_at": "2022-09-28T16:40:45-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559583, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:23-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:23-05:00", "published_at": "2023-01-03T13:00:23-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559583", "variants": [{"id": 1070325037, "product_id": 1071559583, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325037, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325037"}], "options": [{"id": 1055547194, "product_id": 1071559583, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473907, "product_id": 1071559583, "position": 1, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768823", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473907"}], "image": {"id": 1001473907, "product_id": 1071559583, "position": 1, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768823", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473907"}}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.published = true; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + } + ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392.json', + path: '/admin/api/2022-07/products.json', query: '', headers, - data: { "product": {"published": true} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}]} } }).toMatchMadeHttpRequest(); }); it('test_30', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:47-04:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559581, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:09-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:09-05:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559581", "variants": [{"id": 1070325034, "product_id": 1071559581, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:09-05:00", "updated_at": "2023-01-03T13:00:09-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325034, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325034"}], "options": [{"id": 1055547191, "product_id": 1071559581, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; product.published = false; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392.json', + path: '/admin/api/2022-07/products.json', query: '', headers, - data: { "product": {"published": false} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "published": false} } }).toMatchMadeHttpRequest(); }); it('test_31', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:49-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559576, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T12:59:44-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T12:59:44-05:00", "published_at": "2023-01-03T12:59:44-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559576", "variants": [{"id": 1070325030, "product_id": 1071559576, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T12:59:44-05:00", "updated_at": "2023-01-03T12:59:44-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325030, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325030"}], "options": [{"id": 1055547183, "product_id": 1071559576, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; product.metafields = [ { "key": "new", @@ -724,30 +720,34 @@ describe('Product resource', () => { await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392.json', + path: '/admin/api/2022-07/products.json', query: '', headers, - data: { "product": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_32', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559584, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:52-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:52-05:00", "published_at": "2023-01-03T13:00:52-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559584", "variants": [{"id": 1070325039, "product_id": 1071559584, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:52-05:00", "updated_at": "2023-01-03T13:00:52-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325039, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325039"}], "options": [{"id": 1055547195, "product_id": 1071559584, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); - await shopify.rest.Product.delete({ - session: session, - id: 632910392, - }); + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.metafields_global_title_tag = "Product SEO Title"; + product.metafields_global_description_tag = "Product SEO Description"; + await product.save({}); expect({ - method: 'DELETE', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392.json', + path: '/admin/api/2022-07/products.json', query: '', headers, - data: undefined + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields_global_title_tag": "Product SEO Title", "metafields_global_description_tag": "Product SEO Description"} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/product_listing.test.ts b/rest/admin/__tests__/2022-07/product_listing.test.ts index 8cf425bb5..93c309bb6 100644 --- a/rest/admin/__tests__/2022-07/product_listing.test.ts +++ b/rest/admin/__tests__/2022-07/product_listing.test.ts @@ -31,7 +31,7 @@ describe('ProductListing resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"product_listings": [{"product_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "handle": "ipod-nano", "product_type": "Cult Products", "title": "IPod Nano - 8GB", "vendor": "Apple", "available": true, "tags": "Emotive, Flash Memory, MP3, Music", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 808950810, "title": "Pink", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Pink"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008PINK", "barcode": "1234_pink", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 10, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": 562641783, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}, {"id": 49148385, "title": "Red", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Red"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008RED", "barcode": "1234_red", "taxable": true, "position": 2, "available": true, "inventory_policy": "continue", "inventory_quantity": 20, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}, {"id": 39072856, "title": "Green", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Green"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008GREEN", "barcode": "1234_green", "taxable": true, "position": 3, "available": true, "inventory_policy": "continue", "inventory_quantity": 30, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}, {"id": 457924702, "title": "Black", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008BLACK", "barcode": "1234_black", "taxable": true, "position": 4, "available": true, "inventory_policy": "continue", "inventory_quantity": 40, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [{"id": 850703190, "created_at": "2022-10-03T12:15:55-04:00", "position": 1, "updated_at": "2022-10-03T12:15:55-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "width": 123, "height": 456}, {"id": 562641783, "created_at": "2022-10-03T12:15:55-04:00", "position": 2, "updated_at": "2022-10-03T12:15:55-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "variant_ids": [808950810], "width": 123, "height": 456}, {"id": 378407906, "created_at": "2022-10-03T12:15:55-04:00", "position": 3, "updated_at": "2022-10-03T12:15:55-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "width": 123, "height": 456}], "options": [{"id": 594680422, "name": "Color", "product_id": 632910392, "position": 1, "values": ["Pink", "Red", "Green", "Black"]}]}, {"product_id": 921728736, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}]})); + queueMockResponse(JSON.stringify({"product_listings": [{"product_id": 632910392, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "handle": "ipod-nano", "product_type": "Cult Products", "title": "IPod Nano - 8GB", "vendor": "Apple", "available": true, "tags": "Emotive, Flash Memory, MP3, Music", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 808950810, "title": "Pink", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Pink"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008PINK", "barcode": "1234_pink", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 10, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": 562641783, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 49148385, "title": "Red", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Red"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008RED", "barcode": "1234_red", "taxable": true, "position": 2, "available": true, "inventory_policy": "continue", "inventory_quantity": 20, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 39072856, "title": "Green", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Green"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008GREEN", "barcode": "1234_green", "taxable": true, "position": 3, "available": true, "inventory_policy": "continue", "inventory_quantity": 30, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 457924702, "title": "Black", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008BLACK", "barcode": "1234_black", "taxable": true, "position": 4, "available": true, "inventory_policy": "continue", "inventory_quantity": 40, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [{"id": 850703190, "created_at": "2023-01-03T12:05:09-05:00", "position": 1, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672765509", "variant_ids": [], "width": 123, "height": 456}, {"id": 562641783, "created_at": "2023-01-03T12:05:09-05:00", "position": 2, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672765509", "variant_ids": [808950810], "width": 123, "height": 456}, {"id": 378407906, "created_at": "2023-01-03T12:05:09-05:00", "position": 3, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672765509", "variant_ids": [], "width": 123, "height": 456}], "options": [{"id": 594680422, "name": "Color", "product_id": 632910392, "position": 1, "values": ["Pink", "Red", "Green", "Black"]}]}, {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}]})); await shopify.rest.ProductListing.all({ session: session, @@ -82,7 +82,7 @@ describe('ProductListing resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); await shopify.rest.ProductListing.find({ session: session, @@ -100,7 +100,7 @@ describe('ProductListing resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); const product_listing = new shopify.rest.ProductListing({session: session}); product_listing.product_id = 921728736; diff --git a/rest/admin/__tests__/2022-07/product_resource_feedback.test.ts b/rest/admin/__tests__/2022-07/product_resource_feedback.test.ts index a0801d1e8..2c1c2a4f9 100644 --- a/rest/admin/__tests__/2022-07/product_resource_feedback.test.ts +++ b/rest/admin/__tests__/2022-07/product_resource_feedback.test.ts @@ -31,7 +31,7 @@ describe('ProductResourceFeedback resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T13:22:08-04:00", "updated_at": "2022-10-03T13:22:08-04:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2022-10-03T13:07:13-04:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2022-10-03T13:22:08-04:00", "state": "requires_action"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:45:42-05:00", "updated_at": "2023-01-03T12:45:42-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2023-01-03T12:45:40-05:00", "state": "requires_action"}})); const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); product_resource_feedback.product_id = 632910392; @@ -39,8 +39,8 @@ describe('ProductResourceFeedback resource', () => { product_resource_feedback.messages = [ "Needs at least one image." ]; - product_resource_feedback.resource_updated_at = "2022-10-03T13:07:13-04:00"; - product_resource_feedback.feedback_generated_at = "2022-10-03T17:22:08.114485Z"; + product_resource_feedback.resource_updated_at = "2023-01-03T12:21:36-05:00"; + product_resource_feedback.feedback_generated_at = "2023-01-03T17:45:40.928568Z"; await product_resource_feedback.save({}); expect({ @@ -49,18 +49,18 @@ describe('ProductResourceFeedback resource', () => { path: '/admin/api/2022-07/products/632910392/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "requires_action", "messages": ["Needs at least one image."], "resource_updated_at": "2022-10-03T13:07:13-04:00", "feedback_generated_at": "2022-10-03T17:22:08.114485Z"} } + data: { "resource_feedback": {"state": "requires_action", "messages": ["Needs at least one image."], "resource_updated_at": "2023-01-03T12:21:36-05:00", "feedback_generated_at": "2023-01-03T17:45:40.928568Z"} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T13:22:10-04:00", "updated_at": "2022-10-03T13:22:10-04:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2022-10-03T13:07:13-04:00", "messages": [], "feedback_generated_at": "2022-10-03T13:22:09-04:00", "state": "success"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:45:45-05:00", "updated_at": "2023-01-03T12:45:45-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": [], "feedback_generated_at": "2023-01-03T12:45:44-05:00", "state": "success"}})); const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); product_resource_feedback.product_id = 632910392; product_resource_feedback.state = "success"; - product_resource_feedback.resource_updated_at = "2022-10-03T13:07:13-04:00"; - product_resource_feedback.feedback_generated_at = "2022-10-03T17:22:09.073706Z"; + product_resource_feedback.resource_updated_at = "2023-01-03T12:21:36-05:00"; + product_resource_feedback.feedback_generated_at = "2023-01-03T17:45:44.063762Z"; await product_resource_feedback.save({}); expect({ @@ -69,12 +69,12 @@ describe('ProductResourceFeedback resource', () => { path: '/admin/api/2022-07/products/632910392/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "success", "resource_updated_at": "2022-10-03T13:07:13-04:00", "feedback_generated_at": "2022-10-03T17:22:09.073706Z"} } + data: { "resource_feedback": {"state": "success", "resource_updated_at": "2023-01-03T12:21:36-05:00", "feedback_generated_at": "2023-01-03T17:45:44.063762Z"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2022-10-03T13:22:11-04:00", "updated_at": "2022-10-03T13:22:11-04:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2022-10-03T13:07:13-04:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2022-10-03T12:22:11-04:00", "state": "requires_action"}]})); + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2023-01-03T12:45:45-05:00", "updated_at": "2023-01-03T12:45:45-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2023-01-03T11:45:45-05:00", "state": "requires_action"}]})); await shopify.rest.ProductResourceFeedback.all({ session: session, diff --git a/rest/admin/__tests__/2022-07/recurring_application_charge.test.ts b/rest/admin/__tests__/2022-07/recurring_application_charge.test.ts index 50128a5f5..1301fab67 100644 --- a/rest/admin/__tests__/2022-07/recurring_application_charge.test.ts +++ b/rest/admin/__tests__/2022-07/recurring_application_charge.test.ts @@ -31,12 +31,13 @@ describe('RecurringApplicationCharge resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266947, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:52:52-04:00", "updated_at": "2022-10-03T12:52:52-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266947", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266947/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBANeWT06EmF1dG9fYWN0aXZhdGVU--fd1fceece89091b9d39f3c13b2b6ba1868c07823"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266949, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:35-05:00", "updated_at": "2023-01-03T13:06:35-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 5, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266949", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266949/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAVeWT06EmF1dG9fYWN0aXZhdGVU--9b5c79476bf6e10095d51a27255892c04e5dd4fa"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + recurring_application_charge.trial_days = 5; await recurring_application_charge.save({}); expect({ @@ -45,18 +46,19 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-07/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com"} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "trial_days": 5} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266950, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:52:58-04:00", "updated_at": "2022-10-03T12:52:58-04:00", "test": true, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266950", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266950/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAZeWT06EmF1dG9fYWN0aXZhdGVU--c5d071902db4f2e27dd740432882625a5fab74c9"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266951, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:39-05:00", "updated_at": "2023-01-03T13:06:39-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": null, "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266951", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266951/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAdeWT06EmF1dG9fYWN0aXZhdGVU--4e07fb141094c2ffacfcff713a2dc85eab38a229"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; - recurring_application_charge.test = true; + recurring_application_charge.capped_amount = 100; + recurring_application_charge.terms = "$1 for 1000 emails"; await recurring_application_charge.save({}); expect({ @@ -65,19 +67,17 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-07/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "capped_amount": 100, "terms": "$1 for 1000 emails"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266951, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:52:59-04:00", "updated_at": "2022-10-03T12:52:59-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": null, "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266951", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266951/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAdeWT06EmF1dG9fYWN0aXZhdGVU--c1960487d59ce5a37a7ff2dfa85ca64c904b92cd"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266952, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:41-05:00", "updated_at": "2023-01-03T13:06:41-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266952", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266952/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAheWT06EmF1dG9fYWN0aXZhdGVU--c278a9ebe0e4885c8b9df2be46598c9b9abf0731"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; - recurring_application_charge.capped_amount = 100; - recurring_application_charge.terms = "$1 for 1000 emails"; await recurring_application_charge.save({}); expect({ @@ -86,18 +86,18 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-07/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "capped_amount": 100, "terms": "$1 for 1000 emails"} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266954, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:53:11-04:00", "updated_at": "2022-10-03T12:53:11-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 5, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266954", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266954/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBApeWT06EmF1dG9fYWN0aXZhdGVU--784a3d7ab3ffbe680e66bc9b6017f0b19a84eb94"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266954, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:51-05:00", "updated_at": "2023-01-03T13:06:51-05:00", "test": true, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266954", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266954/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBApeWT06EmF1dG9fYWN0aXZhdGVU--f0a955813cb17f90e052cdbc976832ce6f213068"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; - recurring_application_charge.trial_days = 5; + recurring_application_charge.test = true; await recurring_application_charge.save({}); expect({ @@ -106,22 +106,21 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-07/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "trial_days": 5} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "pending", "return_url": "http://yourapp.example.org", "billing_on": "2022-10-03", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVU--b5f90d04779cc5242b396e4054f2e650c5dace1c"}})); + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "accepted", "return_url": "http://yourapp.example.org", "billing_on": "2023-01-03", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:06:22-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195"}]})); - await shopify.rest.RecurringApplicationCharge.find({ + await shopify.rest.RecurringApplicationCharge.all({ session: session, - id: 455696195, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/recurring_application_charges/455696195.json', + path: '/admin/api/2022-07/recurring_application_charges.json', query: '', headers, data: undefined @@ -129,52 +128,53 @@ describe('RecurringApplicationCharge resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 1029266947, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:21-05:00", "updated_at": "2023-01-03T13:06:21-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266947", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266947/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBANeWT06EmF1dG9fYWN0aXZhdGVU--4e6554253be678506a3421452fb801fd291e6db7"}]})); - await shopify.rest.RecurringApplicationCharge.delete({ + await shopify.rest.RecurringApplicationCharge.all({ session: session, - id: 455696195, + since_id: "455696195", }); expect({ - method: 'DELETE', + method: 'GET', domain, - path: '/admin/api/2022-07/recurring_application_charges/455696195.json', - query: '', + path: '/admin/api/2022-07/recurring_application_charges.json', + query: 'since_id=455696195', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 1029266953, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:53:09-04:00", "updated_at": "2022-10-03T12:53:09-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266953", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266953/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAleWT06EmF1dG9fYWN0aXZhdGVU--1255bd14c50f77b5a2bab1190e116c8784e01280"}]})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "pending", "return_url": "http://yourapp.example.org", "billing_on": "2023-01-03", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVU--b5f90d04779cc5242b396e4054f2e650c5dace1c"}})); - await shopify.rest.RecurringApplicationCharge.all({ + await shopify.rest.RecurringApplicationCharge.find({ session: session, - since_id: "455696195", + id: 455696195, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/recurring_application_charges.json', - query: 'since_id=455696195', + path: '/admin/api/2022-07/recurring_application_charges/455696195.json', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "accepted", "return_url": "http://yourapp.example.org", "billing_on": "2022-10-03", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:53:11-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195"}]})); + queueMockResponse(JSON.stringify({})); - await shopify.rest.RecurringApplicationCharge.all({ + await shopify.rest.RecurringApplicationCharge.delete({ session: session, + id: 455696195, }); expect({ - method: 'GET', + method: 'DELETE', domain, - path: '/admin/api/2022-07/recurring_application_charges.json', + path: '/admin/api/2022-07/recurring_application_charges/455696195.json', query: '', headers, data: undefined @@ -182,7 +182,7 @@ describe('RecurringApplicationCharge resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"return_url": "http://yourapp.example.org/", "id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "active", "billing_on": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:53:07-04:00", "test": null, "activated_on": "2022-10-03", "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": "2022-10-03", "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://yourapp.example.org/?charge_id=455696195", "update_capped_amount_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_update_capped_amount?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVG--4fa9614788ca5e1cf650a7e46ca7681295b568d8"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"return_url": "http://yourapp.example.org/", "id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "active", "billing_on": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:06:19-05:00", "test": null, "activated_on": "2023-01-03", "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": "2023-01-03", "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://yourapp.example.org/?charge_id=455696195", "update_capped_amount_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_update_capped_amount?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVG--c9d104c0a19c52b84fa17360f32abc13aae86935"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.id = 455696195; diff --git a/rest/admin/__tests__/2022-07/redirect.test.ts b/rest/admin/__tests__/2022-07/redirect.test.ts index 89b79f901..0ac76a920 100644 --- a/rest/admin/__tests__/2022-07/redirect.test.ts +++ b/rest/admin/__tests__/2022-07/redirect.test.ts @@ -174,7 +174,7 @@ describe('Redirect resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"redirect": {"id": 984542199, "path": "/ipod", "target": "/pages/itunes"}})); + queueMockResponse(JSON.stringify({"redirect": {"id": 984542200, "path": "/ipod", "target": "/pages/itunes"}})); const redirect = new shopify.rest.Redirect({session: session}); redirect.path = "/ipod"; @@ -192,7 +192,7 @@ describe('Redirect resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"redirect": {"id": 984542200, "path": "/forums", "target": "http://forums.apple.com/"}})); + queueMockResponse(JSON.stringify({"redirect": {"id": 984542199, "path": "/forums", "target": "http://forums.apple.com/"}})); const redirect = new shopify.rest.Redirect({session: session}); redirect.path = "http://www.apple.com/forums"; diff --git a/rest/admin/__tests__/2022-07/refund.test.ts b/rest/admin/__tests__/2022-07/refund.test.ts index fe4ec889b..b07ab556e 100644 --- a/rest/admin/__tests__/2022-07/refund.test.ts +++ b/rest/admin/__tests__/2022-07/refund.test.ts @@ -31,7 +31,7 @@ describe('Refund resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"refunds": [{"id": 509562969, "order_id": 450789469, "created_at": "2022-10-03T12:44:45-04:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2022-10-03T12:44:45-04:00", "restock": true, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}]})); + queueMockResponse(JSON.stringify({"refunds": [{"id": 509562969, "order_id": 450789469, "created_at": "2023-01-03T12:56:35-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2023-01-03T12:56:35-05:00", "restock": true, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}]})); await shopify.rest.Refund.all({ session: session, @@ -49,18 +49,28 @@ describe('Refund resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"refund": {"id": 929361463, "order_id": 450789469, "created_at": "2022-10-03T12:51:57-04:00", "note": null, "user_id": null, "processed_at": "2022-10-03T12:51:57-04:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "refund_line_items": [], "transactions": [{"id": 1068278470, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-10-03T12:51:57-04:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2022-10-03T12:51:57-04:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "currency_exchange_adjustment": null, "amount": "5.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278470"}], "order_adjustments": [{"id": 1030976842, "order_id": 450789469, "refund_id": 929361463, "amount": "-5.00", "tax_amount": "0.00", "kind": "shipping_refund", "reason": "Shipping refund", "amount_set": {"shop_money": {"amount": "-5.00", "currency_code": "USD"}, "presentment_money": {"amount": "-5.00", "currency_code": "USD"}}, "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}]}})); + queueMockResponse(JSON.stringify({"refund": {"id": 929361465, "order_id": 450789469, "created_at": "2023-01-03T13:05:55-05:00", "note": "wrong size", "user_id": null, "processed_at": "2023-01-03T13:05:55-05:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/929361465", "refund_line_items": [{"location_id": null, "restock_type": "no_restock", "quantity": 1, "id": 1058498312, "line_item_id": 518995019, "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 1068278491, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T13:05:54-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2023-01-03T13:05:54-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "41.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278491"}], "order_adjustments": []}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; refund.currency = "USD"; + refund.notify = true; + refund.note = "wrong size"; refund.shipping = { - "amount": 5.0 + "full_refund": true }; + refund.refund_line_items = [ + { + "line_item_id": 518995019, + "quantity": 1, + "restock_type": "return", + "location_id": 487838322 + } + ]; refund.transactions = [ { "parent_id": 801038806, - "amount": 5.0, + "amount": 41.94, "kind": "refund", "gateway": "bogus" } @@ -73,33 +83,23 @@ describe('Refund resource', () => { path: '/admin/api/2022-07/orders/450789469/refunds.json', query: '', headers, - data: { "refund": {"currency": "USD", "shipping": {"amount": 5.0}, "transactions": [{"parent_id": 801038806, "amount": 5.0, "kind": "refund", "gateway": "bogus"}]} } + data: { "refund": {"currency": "USD", "notify": true, "note": "wrong size", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "return", "location_id": 487838322}], "transactions": [{"parent_id": 801038806, "amount": 41.94, "kind": "refund", "gateway": "bogus"}]} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"refund": {"id": 929361464, "order_id": 450789469, "created_at": "2022-10-03T12:52:06-04:00", "note": "wrong size", "user_id": null, "processed_at": "2022-10-03T12:52:06-04:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/Refund/929361464", "refund_line_items": [{"location_id": null, "restock_type": "no_restock", "quantity": 1, "id": 1058498308, "line_item_id": 518995019, "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 1068278471, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-10-03T12:52:05-04:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2022-10-03T12:52:05-04:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "currency_exchange_adjustment": null, "amount": "41.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278471"}], "order_adjustments": []}})); + queueMockResponse(JSON.stringify({"refund": {"id": 929361466, "order_id": 450789469, "created_at": "2023-01-03T13:05:59-05:00", "note": null, "user_id": null, "processed_at": "2023-01-03T13:05:59-05:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/929361466", "refund_line_items": [], "transactions": [{"id": 1068278492, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T13:05:59-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2023-01-03T13:05:59-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "5.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278492"}], "order_adjustments": [{"id": 1030976843, "order_id": 450789469, "refund_id": 929361466, "amount": "-5.00", "tax_amount": "0.00", "kind": "shipping_refund", "reason": "Shipping refund", "amount_set": {"shop_money": {"amount": "-5.00", "currency_code": "USD"}, "presentment_money": {"amount": "-5.00", "currency_code": "USD"}}, "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}]}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; refund.currency = "USD"; - refund.notify = true; - refund.note = "wrong size"; refund.shipping = { - "full_refund": true + "amount": 5.0 }; - refund.refund_line_items = [ - { - "line_item_id": 518995019, - "quantity": 1, - "restock_type": "return", - "location_id": 487838322 - } - ]; refund.transactions = [ { "parent_id": 801038806, - "amount": 41.94, + "amount": 5.0, "kind": "refund", "gateway": "bogus" } @@ -112,12 +112,12 @@ describe('Refund resource', () => { path: '/admin/api/2022-07/orders/450789469/refunds.json', query: '', headers, - data: { "refund": {"currency": "USD", "notify": true, "note": "wrong size", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "return", "location_id": 487838322}], "transactions": [{"parent_id": 801038806, "amount": 41.94, "kind": "refund", "gateway": "bogus"}]} } + data: { "refund": {"currency": "USD", "shipping": {"amount": 5.0}, "transactions": [{"parent_id": 801038806, "amount": 5.0, "kind": "refund", "gateway": "bogus"}]} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"refund": {"id": 509562969, "order_id": 450789469, "created_at": "2022-10-03T12:44:45-04:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2022-10-03T12:44:45-04:00", "restock": true, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "c901414060.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}})); + queueMockResponse(JSON.stringify({"refund": {"id": 509562969, "order_id": 450789469, "created_at": "2023-01-03T12:56:35-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2023-01-03T12:56:35-05:00", "restock": true, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}})); await shopify.rest.Refund.find({ session: session, @@ -136,12 +136,12 @@ describe('Refund resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "2.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "2.00", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; await refund.calculate({ - body: {"refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + body: {"refund": {"currency": "USD", "shipping": {"amount": 2.0}}}, }); expect({ @@ -150,17 +150,17 @@ describe('Refund resource', () => { path: '/admin/api/2022-07/orders/450789469/refunds/calculate.json', query: '', headers, - data: { "refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + data: { "refund": {"currency": "USD", "shipping": {"amount": 2.0}} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; await refund.calculate({ - body: {"refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + body: {"refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, }); expect({ @@ -169,17 +169,17 @@ describe('Refund resource', () => { path: '/admin/api/2022-07/orders/450789469/refunds/calculate.json', query: '', headers, - data: { "refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + data: { "refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "2.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_line_items": [], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "2.00", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; await refund.calculate({ - body: {"refund": {"currency": "USD", "shipping": {"amount": 2.0}}}, + body: {"refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, }); expect({ @@ -188,7 +188,7 @@ describe('Refund resource', () => { path: '/admin/api/2022-07/orders/450789469/refunds/calculate.json', query: '', headers, - data: { "refund": {"currency": "USD", "shipping": {"amount": 2.0}} } + data: { "refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/report.test.ts b/rest/admin/__tests__/2022-07/report.test.ts index 96e94a3bc..906d55899 100644 --- a/rest/admin/__tests__/2022-07/report.test.ts +++ b/rest/admin/__tests__/2022-07/report.test.ts @@ -31,113 +31,95 @@ describe('Report resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2022-10-03T12:44:45-04:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}, {"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, + since_id: "123", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/reports.json', - query: '', + query: 'since_id=123', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2022-10-03T12:44:45-04:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, - updated_at_min: "2005-07-31 15:57:11 EDT -04:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/reports.json', - query: 'updated_at_min=2005-07-31+15%3A57%3A11+EDT+-04%3A00', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales"}, {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}]})); await shopify.rest.Report.all({ session: session, - ids: "517154478", + fields: "id,shopify_ql", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/reports.json', - query: 'ids=517154478', + query: 'fields=id%2Cshopify_ql', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}, {"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2022-10-03T12:44:45-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, - since_id: "123", + ids: "517154478", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/reports.json', - query: 'since_id=123', + query: 'ids=517154478', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales"}, {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, - fields: "id,shopify_ql", + updated_at_min: "2005-07-31 15:57:11 EDT -04:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/reports.json', - query: 'fields=id%2Cshopify_ql', + query: 'updated_at_min=2005-07-31+15%3A57%3A11+EDT+-04%3A00', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"report": {"id": 1016888664, "name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales", "updated_at": "2022-10-03T12:53:33-04:00", "category": "custom_app_reports"}})); - - const report = new shopify.rest.Report({session: session}); - report.name = "A new app report"; - report.shopify_ql = "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"; - await report.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-07/reports.json', - query: '', - headers, - data: { "report": {"name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"} } - }).toMatchMadeHttpRequest(); - }); - - it('test_7', async () => { queueMockResponse(JSON.stringify({"report": {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}})); await shopify.rest.Report.find({ @@ -155,7 +137,7 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { + it('test_7', async () => { queueMockResponse(JSON.stringify({"report": {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}})); await shopify.rest.Report.find({ @@ -174,8 +156,8 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_9', async () => { - queueMockResponse(JSON.stringify({"report": {"name": "Changed Report Name", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -12m UNTIL today ORDER BY total_sales", "id": 517154478, "updated_at": "2022-10-03T12:53:27-04:00", "category": "custom_app_reports"}})); + it('test_8', async () => { + queueMockResponse(JSON.stringify({"report": {"name": "Changed Report Name", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -12m UNTIL today ORDER BY total_sales", "id": 517154478, "updated_at": "2023-01-03T12:47:04-05:00", "category": "custom_app_reports"}})); const report = new shopify.rest.Report({session: session}); report.id = 517154478; @@ -193,7 +175,7 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_10', async () => { + it('test_9', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Report.delete({ @@ -211,4 +193,22 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); + it('test_10', async () => { + queueMockResponse(JSON.stringify({"report": {"id": 1016888664, "name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales", "updated_at": "2023-01-03T12:46:45-05:00", "category": "custom_app_reports"}})); + + const report = new shopify.rest.Report({session: session}); + report.name = "A new app report"; + report.shopify_ql = "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"; + await report.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/reports.json', + query: '', + headers, + data: { "report": {"name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"} } + }).toMatchMadeHttpRequest(); + }); + }); diff --git a/rest/admin/__tests__/2022-07/resource_feedback.test.ts b/rest/admin/__tests__/2022-07/resource_feedback.test.ts index cbd9396f4..ba0ea8ab6 100644 --- a/rest/admin/__tests__/2022-07/resource_feedback.test.ts +++ b/rest/admin/__tests__/2022-07/resource_feedback.test.ts @@ -31,14 +31,14 @@ describe('ResourceFeedback resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T12:45:53-04:00", "updated_at": "2022-10-03T12:45:53-04:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2022-10-03T12:45:51-04:00", "state": "requires_action"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:53:47-05:00", "updated_at": "2023-01-03T12:53:47-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T12:53:46-05:00", "state": "requires_action"}})); const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); resource_feedback.state = "requires_action"; resource_feedback.messages = [ "is not connected. Connect your account to use this sales channel." ]; - resource_feedback.feedback_generated_at = "2022-10-03T16:45:51.594730Z"; + resource_feedback.feedback_generated_at = "2023-01-03T17:53:46.212756Z"; await resource_feedback.save({}); expect({ @@ -47,16 +47,16 @@ describe('ResourceFeedback resource', () => { path: '/admin/api/2022-07/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "requires_action", "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2022-10-03T16:45:51.594730Z"} } + data: { "resource_feedback": {"state": "requires_action", "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T17:53:46.212756Z"} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T12:45:55-04:00", "updated_at": "2022-10-03T12:45:55-04:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": [], "feedback_generated_at": "2022-10-03T12:45:53-04:00", "state": "success"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:53:50-05:00", "updated_at": "2023-01-03T12:53:50-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": [], "feedback_generated_at": "2023-01-03T12:53:49-05:00", "state": "success"}})); const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); resource_feedback.state = "success"; - resource_feedback.feedback_generated_at = "2022-10-03T16:45:53.872041Z"; + resource_feedback.feedback_generated_at = "2023-01-03T17:53:49.185362Z"; await resource_feedback.save({}); expect({ @@ -65,12 +65,12 @@ describe('ResourceFeedback resource', () => { path: '/admin/api/2022-07/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "success", "feedback_generated_at": "2022-10-03T16:45:53.872041Z"} } + data: { "resource_feedback": {"state": "success", "feedback_generated_at": "2023-01-03T17:53:49.185362Z"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2022-10-03T12:45:57-04:00", "updated_at": "2022-10-03T12:45:57-04:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2022-10-03T11:45:57-04:00", "state": "requires_action"}]})); + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2023-01-03T12:53:44-05:00", "updated_at": "2023-01-03T12:53:44-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T11:53:44-05:00", "state": "requires_action"}]})); await shopify.rest.ResourceFeedback.all({ session: session, diff --git a/rest/admin/__tests__/2022-07/script_tag.test.ts b/rest/admin/__tests__/2022-07/script_tag.test.ts index 17b7b7901..3728ba61f 100644 --- a/rest/admin/__tests__/2022-07/script_tag.test.ts +++ b/rest/admin/__tests__/2022-07/script_tag.test.ts @@ -31,59 +31,77 @@ describe('ScriptTag resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}]})); + queueMockResponse(JSON.stringify({"script_tags": [{"id": 421379493, "src": "https://js.example.org/bar.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}, {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); await shopify.rest.ScriptTag.all({ session: session, - since_id: "421379493", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/script_tags.json', - query: 'since_id=421379493', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}]})); + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); await shopify.rest.ScriptTag.all({ session: session, - src: "https://js.example.org/foo.js", + since_id: "421379493", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/script_tags.json', - query: 'src=https%3A%2F%2Fjs.example.org%2Ffoo.js', + query: 'since_id=421379493', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"script_tags": [{"id": 421379493, "src": "https://js.example.org/bar.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}, {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}]})); + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); await shopify.rest.ScriptTag.all({ session: session, + src: "https://js.example.org/foo.js", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/script_tags.json', - query: '', + query: 'src=https%3A%2F%2Fjs.example.org%2Ffoo.js', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"id": 870402688, "src": "https://example.com/my_script.js", "event": "onload", "created_at": "2023-01-03T12:54:19-05:00", "updated_at": "2023-01-03T12:54:19-05:00", "display_scope": "all", "cache": false}})); + + const script_tag = new shopify.rest.ScriptTag({session: session}); + script_tag.event = "onload"; + script_tag.src = "https://example.com/my_script.js"; + await script_tag.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-07/script_tags.json', + query: '', + headers, + data: { "script_tag": {"event": "onload", "src": "https://example.com/my_script.js"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { queueMockResponse(JSON.stringify({"count": 2})); await shopify.rest.ScriptTag.count({ @@ -100,8 +118,8 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { - queueMockResponse(JSON.stringify({"script_tag": {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all", "cache": false}})); + it('test_6', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all", "cache": false}})); await shopify.rest.ScriptTag.find({ session: session, @@ -118,8 +136,8 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"script_tag": {"src": "https://somewhere-else.com/another.js", "cache": false, "id": 596726825, "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:46:10-04:00", "display_scope": "all"}})); + it('test_7', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"src": "https://somewhere-else.com/another.js", "cache": false, "id": 596726825, "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:54:18-05:00", "display_scope": "all"}})); const script_tag = new shopify.rest.ScriptTag({session: session}); script_tag.id = 596726825; @@ -136,7 +154,7 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { + it('test_8', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.ScriptTag.delete({ @@ -154,22 +172,4 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { - queueMockResponse(JSON.stringify({"script_tag": {"id": 870402687, "src": "https://example.com/my_script.js", "event": "onload", "created_at": "2022-10-03T12:46:20-04:00", "updated_at": "2022-10-03T12:46:20-04:00", "display_scope": "all", "cache": false}})); - - const script_tag = new shopify.rest.ScriptTag({session: session}); - script_tag.event = "onload"; - script_tag.src = "https://example.com/my_script.js"; - await script_tag.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-07/script_tags.json', - query: '', - headers, - data: { "script_tag": {"event": "onload", "src": "https://example.com/my_script.js"} } - }).toMatchMadeHttpRequest(); - }); - }); diff --git a/rest/admin/__tests__/2022-07/shop.test.ts b/rest/admin/__tests__/2022-07/shop.test.ts index f943ac9ce..0bf00a96e 100644 --- a/rest/admin/__tests__/2022-07/shop.test.ts +++ b/rest/admin/__tests__/2022-07/shop.test.ts @@ -31,7 +31,7 @@ describe('Shop resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"shop": {"id": 548380009, "name": "John Smith Test Store", "email": "j.smith@example.com", "domain": "shop.apple.com", "province": "California", "country": "US", "address1": "1 Infinite Loop", "zip": "95014", "city": "Cupertino", "source": null, "phone": "1231231234", "latitude": 45.45, "longitude": -75.43, "primary_locale": "en", "address2": "Suite 100", "created_at": "2007-12-31T19:00:00-05:00", "updated_at": "2022-10-03T13:22:14-04:00", "country_code": "US", "country_name": "United States", "currency": "USD", "customer_email": "customers@apple.com", "timezone": "(GMT-05:00) Eastern Time (US & Canada)", "iana_timezone": "America/New_York", "shop_owner": "John Smith", "money_format": "${{amount}}", "money_with_currency_format": "${{amount}} USD", "weight_unit": "lb", "province_code": "CA", "taxes_included": null, "auto_configure_tax_inclusivity": null, "tax_shipping": null, "county_taxes": true, "plan_display_name": "Shopify Plus", "plan_name": "enterprise", "has_discounts": true, "has_gift_cards": true, "myshopify_domain": "jsmith.myshopify.com", "google_apps_domain": null, "google_apps_login_enabled": null, "money_in_emails_format": "${{amount}}", "money_with_currency_in_emails_format": "${{amount}} USD", "eligible_for_payments": true, "requires_extra_payments_agreement": false, "password_enabled": false, "has_storefront": true, "eligible_for_card_reader_giveaway": false, "finances": true, "primary_location_id": 655441491, "cookie_consent_level": "implicit", "visitor_tracking_consent_preference": "allow_all", "checkout_api_supported": true, "multi_location_enabled": true, "setup_required": false, "pre_launch_enabled": false, "enabled_presentment_currencies": ["USD"], "transactional_sms_disabled": false, "marketing_sms_consent_enabled_at_checkout": false}})); + queueMockResponse(JSON.stringify({"shop": {"id": 548380009, "name": "John Smith Test Store", "email": "j.smith@example.com", "domain": "shop.apple.com", "province": "California", "country": "US", "address1": "1 Infinite Loop", "zip": "95014", "city": "Cupertino", "source": null, "phone": "1231231234", "latitude": 45.45, "longitude": -75.43, "primary_locale": "en", "address2": "Suite 100", "created_at": "2007-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:55:05-05:00", "country_code": "US", "country_name": "United States", "currency": "USD", "customer_email": "customers@apple.com", "timezone": "(GMT-05:00) Eastern Time (US & Canada)", "iana_timezone": "America/New_York", "shop_owner": "John Smith", "money_format": "${{amount}}", "money_with_currency_format": "${{amount}} USD", "weight_unit": "lb", "province_code": "CA", "taxes_included": null, "auto_configure_tax_inclusivity": null, "tax_shipping": null, "county_taxes": true, "plan_display_name": "Shopify Plus", "plan_name": "enterprise", "has_discounts": true, "has_gift_cards": true, "myshopify_domain": "jsmith.myshopify.com", "google_apps_domain": null, "google_apps_login_enabled": null, "money_in_emails_format": "${{amount}}", "money_with_currency_in_emails_format": "${{amount}} USD", "eligible_for_payments": true, "requires_extra_payments_agreement": false, "password_enabled": false, "has_storefront": true, "eligible_for_card_reader_giveaway": false, "finances": true, "primary_location_id": 655441491, "cookie_consent_level": "implicit", "visitor_tracking_consent_preference": "allow_all", "checkout_api_supported": true, "multi_location_enabled": true, "setup_required": false, "pre_launch_enabled": false, "enabled_presentment_currencies": ["USD"], "transactional_sms_disabled": false, "marketing_sms_consent_enabled_at_checkout": false}})); await shopify.rest.Shop.all({ session: session, diff --git a/rest/admin/__tests__/2022-07/smart_collection.test.ts b/rest/admin/__tests__/2022-07/smart_collection.test.ts index 6202ad5a7..f3bb8794c 100644 --- a/rest/admin/__tests__/2022-07/smart_collection.test.ts +++ b/rest/admin/__tests__/2022-07/smart_collection.test.ts @@ -31,42 +31,42 @@ describe('SmartCollection resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001318, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T12:43:30-05:00", "body_html": null, "published_at": "2023-01-03T12:43:29-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001318"}]})); await shopify.rest.SmartCollection.all({ session: session, + since_id: "482865238", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/smart_collections.json', - query: '', + query: 'since_id=482865238', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001333, "handle": "ipods-1", "title": "IPods", "updated_at": "2022-10-03T13:16:25-04:00", "body_html": null, "published_at": "2022-10-03T13:16:25-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001333"}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); await shopify.rest.SmartCollection.all({ session: session, - since_id: "482865238", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/smart_collections.json', - query: 'since_id=482865238', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); await shopify.rest.SmartCollection.all({ session: session, @@ -84,211 +84,194 @@ describe('SmartCollection resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001348, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:18:29-04:00", "body_html": null, "published_at": "2022-10-03T13:18:29-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001348"}, {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001324, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:44:05-05:00", "body_html": null, "published_at": "2023-01-03T12:44:05-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001324"}, {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); await shopify.rest.SmartCollection.all({ session: session, - ids: "482865238,1063001348", + ids: "482865238,1063001324", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/smart_collections.json', - query: 'ids=482865238%2C1063001348', + query: 'ids=482865238%2C1063001324', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001332, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:16:20-04:00", "body_html": null, "published_at": "2022-10-03T13:16:20-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001332"}})); + queueMockResponse(JSON.stringify({"count": 1})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - await smart_collection.save({}); + await shopify.rest.SmartCollection.count({ + session: session, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/smart_collections.json', + path: '/admin/api/2022-07/smart_collections/count.json', query: '', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001336, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:17:01-04:00", "body_html": null, "published_at": "2022-10-03T13:16:55-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001336", "image": {"created_at": "2022-10-03T13:16:58-04:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-4mmir0.gif?v=1664817421"}}})); + queueMockResponse(JSON.stringify({"count": 1})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - smart_collection.image = { - "src": "http://example.com/rails_logo.gif", - "alt": "Rails Logo" - }; - await smart_collection.save({}); + await shopify.rest.SmartCollection.count({ + session: session, + product_id: "632910392", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/smart_collections.json', - query: '', + path: '/admin/api/2022-07/smart_collections/count.json', + query: 'product_id=632910392', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001339, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:17:45-04:00", "body_html": null, "published_at": "2022-10-03T13:17:42-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001339", "image": {"created_at": "2022-10-03T13:17:45-04:00", "alt": "iPod", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664817465"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 2, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - smart_collection.image = { - "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", - "alt": "iPod" - }; - await smart_collection.save({}); + await shopify.rest.SmartCollection.find({ + session: session, + id: 482865238, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-07/smart_collections.json', + path: '/admin/api/2022-07/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", "alt": "iPod"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001346, "handle": "ipods-1", "title": "IPods", "updated_at": "2022-10-03T13:18:22-04:00", "body_html": null, "published_at": "2022-10-03T13:18:22-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001346"}})); + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": null, "updated_at": "2023-01-03T12:43:43-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "IPods"; - smart_collection.rules = [ - { - "column": "title", - "relation": "starts_with", - "condition": "iPod" - } - ]; + smart_collection.id = 482865238; + smart_collection.published = false; await smart_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/smart_collections.json', + path: '/admin/api/2022-07/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"title": "IPods", "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}]} } + data: { "smart_collection": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001347, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:18:27-04:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001347"}})); + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": "2023-01-03T12:43:23-05:00", "updated_at": "2023-01-03T12:43:23-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - smart_collection.published = false; + smart_collection.id = 482865238; + smart_collection.published = true; await smart_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/smart_collections.json', + path: '/admin/api/2022-07/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published": false} } + data: { "smart_collection": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

The best selling ipod ever

", "handle": "smart-ipods", "updated_at": "2023-01-03T12:44:13-05:00", "id": 482865238, "sort_order": "manual", "title": "Smart iPods", "disjunctive": false, "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"}})); - await shopify.rest.SmartCollection.count({ - session: session, - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = ""; + smart_collection.updated_at = "2023-01-03T12:44:12-05:00"; + smart_collection.title = "Smart iPods"; + smart_collection.handle = "smart-ipods"; + smart_collection.body_html = "

The best selling ipod ever

"; + smart_collection.published_at = "2008-02-01T19:00:00-05:00"; + smart_collection.sort_order = "manual"; + smart_collection.template_suffix = null; + smart_collection.disjunctive = false; + smart_collection.rules = [ + { + "column": "type", + "relation": "equals", + "condition": "Cult Products" + } + ]; + smart_collection.published_scope = "web"; + smart_collection.admin_graphql_api_id = "gid://shopify/Collection/482865238"; + await smart_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-07/smart_collections/count.json', + path: '/admin/api/2022-07/smart_collections/482865238.json', query: '', headers, - data: undefined + data: { "smart_collection": {"image": "", "updated_at": "2023-01-03T12:44:12-05:00", "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2023-01-03T12:44:35-05:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:44:35-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672767875"}}})); - await shopify.rest.SmartCollection.count({ - session: session, - product_id: "632910392", - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTf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zsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; + await smart_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-07/smart_collections/count.json', - query: 'product_id=632910392', + path: '/admin/api/2022-07/smart_collections/482865238.json', + query: '', headers, - data: undefined + data: { "smart_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR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C80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 2, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2023-01-03T12:43:34-05:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"alt": "Rails logo", "created_at": "2023-01-03T12:43:32-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-iapzkx.gif?v=1672767814"}}})); - await shopify.rest.SmartCollection.find({ - session: session, - id: 482865238, - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "alt": "Rails logo" + }; + await smart_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-07/smart_collections/482865238.json', query: '', headers, - data: undefined + data: { "smart_collection": {"image": {"alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": "2022-10-03T13:15:44-04:00", "updated_at": "2022-10-03T13:15:45-04:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

5000 songs in your pocket

", "title": "Smart iPods", "handle": "smart-ipods", "id": 482865238, "updated_at": "2023-01-03T12:44:20-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); smart_collection.id = 482865238; - smart_collection.published = true; + smart_collection.body_html = "

5000 songs in your pocket

"; await smart_collection.save({}); expect({ @@ -297,137 +280,154 @@ describe('SmartCollection resource', () => { path: '/admin/api/2022-07/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"published": true} } + data: { "smart_collection": {"body_html": "

5000 songs in your pocket

"} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2022-10-03T13:15:58-04:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"alt": "Rails logo", "created_at": "2022-10-03T13:15:53-04:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-m6oibt.gif?v=1664817358"}}})); + queueMockResponse(JSON.stringify({})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.image = { - "alt": "Rails logo" - }; - await smart_collection.save({}); + await shopify.rest.SmartCollection.delete({ + session: session, + id: 482865238, + }); expect({ - method: 'PUT', + method: 'DELETE', domain, path: '/admin/api/2022-07/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"image": {"alt": "Rails logo"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2022-10-03T13:16:15-04:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:16:15-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1664817375"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001315, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:20-05:00", "body_html": null, "published_at": "2023-01-03T12:43:20-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001315", "image": {"created_at": "2023-01-03T12:43:20-05:00", "alt": "iPod", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672767800"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; smart_collection.image = { - "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hS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He+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", - "alt": "Rails logo" + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", + "alt": "iPod" }; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/smart_collections/482865238.json', + path: '/admin/api/2022-07/smart_collections.json', query: '', headers, - data: { "smart_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZRPLIgMZUeJ+jKvrAlK6AhJ65A\nMpMpKuC3j5obIsRwS7hAN8l/YtvDvnYXHbAoLI47SIUsOMenorF4gO/m4+fH\npo4vLZ8oKMukqp0cJbhVSMV2UuPR0bAfMLIrL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relation": "equals", "condition": "Apple"}], "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", "alt": "iPod"}} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

5000 songs in your pocket

", "title": "Smart iPods", "handle": "smart-ipods", "id": 482865238, "updated_at": "2022-10-03T13:16:36-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001314, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:18-05:00", "body_html": null, "published_at": "2023-01-03T12:43:18-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001314", "image": {"created_at": "2023-01-03T12:43:18-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-xezjfo.gif?v=1672767798"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.body_html = "

5000 songs in your pocket

"; + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + smart_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/smart_collections/482865238.json', + path: '/admin/api/2022-07/smart_collections.json', query: '', headers, - data: { "smart_collection": {"body_html": "

5000 songs in your pocket

"} } + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

The best selling ipod ever

", "handle": "smart-ipods", "updated_at": "2022-10-03T13:17:09-04:00", "id": 482865238, "sort_order": "manual", "title": "Smart iPods", "disjunctive": false, "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001313, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:16-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001313"}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.image = ""; - smart_collection.updated_at = "2022-10-03T13:17:08-04:00"; - smart_collection.title = "Smart iPods"; - smart_collection.handle = "smart-ipods"; - smart_collection.body_html = "

The best selling ipod ever

"; - smart_collection.published_at = "2008-02-01T19:00:00-05:00"; - smart_collection.sort_order = "manual"; - smart_collection.template_suffix = null; - smart_collection.disjunctive = false; + smart_collection.title = "Macbooks"; smart_collection.rules = [ { - "column": "type", + "column": "vendor", "relation": "equals", - "condition": "Cult Products" + "condition": "Apple" } ]; - smart_collection.published_scope = "web"; - smart_collection.admin_graphql_api_id = "gid://shopify/Collection/482865238"; + smart_collection.published = false; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/smart_collections/482865238.json', + path: '/admin/api/2022-07/smart_collections.json', query: '', headers, - data: { "smart_collection": {"image": "", "updated_at": "2022-10-03T13:17:08-04:00", "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"} } + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published": false} } }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": null, "updated_at": "2022-10-03T13:17:23-04:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001326, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T12:44:09-05:00", "body_html": null, "published_at": "2023-01-03T12:44:09-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001326"}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.published = false; + smart_collection.title = "IPods"; + smart_collection.rules = [ + { + "column": "title", + "relation": "starts_with", + "condition": "iPod" + } + ]; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/smart_collections/482865238.json', + path: '/admin/api/2022-07/smart_collections.json', query: '', headers, - data: { "smart_collection": {"published": false} } + data: { "smart_collection": {"title": "IPods", "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}]} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001329, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:44:38-05:00", "body_html": null, "published_at": "2023-01-03T12:44:38-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001329"}})); - await shopify.rest.SmartCollection.delete({ - session: session, - id: 482865238, - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + await smart_collection.save({}); expect({ - method: 'DELETE', + method: 'POST', domain, - path: '/admin/api/2022-07/smart_collections/482865238.json', + path: '/admin/api/2022-07/smart_collections.json', query: '', headers, - data: undefined + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}]} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-07/storefront_access_token.test.ts b/rest/admin/__tests__/2022-07/storefront_access_token.test.ts index 9c626be52..5a4f87610 100644 --- a/rest/admin/__tests__/2022-07/storefront_access_token.test.ts +++ b/rest/admin/__tests__/2022-07/storefront_access_token.test.ts @@ -31,7 +31,7 @@ describe('StorefrontAccessToken resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"storefront_access_token": {"access_token": "45ca0032e77093b648d94244e45fab27", "access_scope": "unauthenticated_read_product_listings", "created_at": "2022-10-03T13:03:45-04:00", "id": 1003303990, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/1003303990", "title": "Test"}})); + queueMockResponse(JSON.stringify({"storefront_access_token": {"access_token": "b3ababb5c68d0062d5619d853abf6efa", "access_scope": "unauthenticated_read_product_listings", "created_at": "2023-01-03T12:44:44-05:00", "id": 1003303990, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/1003303990", "title": "Test"}})); const storefront_access_token = new shopify.rest.StorefrontAccessToken({session: session}); storefront_access_token.title = "Test"; @@ -48,7 +48,7 @@ describe('StorefrontAccessToken resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"storefront_access_tokens": [{"access_token": "378d95641257a4ab3feff967ee234f4d", "access_scope": "unauthenticated_read_product_listings", "created_at": "2022-10-03T12:44:45-04:00", "id": 755357713, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/755357713", "title": "API Client Extension"}]})); + queueMockResponse(JSON.stringify({"storefront_access_tokens": [{"access_token": "378d95641257a4ab3feff967ee234f4d", "access_scope": "unauthenticated_read_product_listings", "created_at": "2023-01-03T12:21:36-05:00", "id": 755357713, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/755357713", "title": "API Client Extension"}]})); await shopify.rest.StorefrontAccessToken.all({ session: session, diff --git a/rest/admin/__tests__/2022-07/tender_transaction.test.ts b/rest/admin/__tests__/2022-07/tender_transaction.test.ts index 198af9793..1223ff4c7 100644 --- a/rest/admin/__tests__/2022-07/tender_transaction.test.ts +++ b/rest/admin/__tests__/2022-07/tender_transaction.test.ts @@ -31,107 +31,107 @@ describe('TenderTransaction resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222834, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222852, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222851, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - since_id: "1011222833", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/tender_transactions.json', - query: 'since_id=1011222833', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222835, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222858, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - processed_at_max: "2005-08-06 10:22:51 -0400", + since_id: "1011222857", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/tender_transactions.json', - query: 'processed_at_max=2005-08-06+10%3A22%3A51+-0400', + query: 'since_id=1011222857', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222837, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222855, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222856, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - processed_at_max: "2005-08-05 10:22:51 -0400", + order: "processed_at ASC", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/tender_transactions.json', - query: 'processed_at_max=2005-08-05+10%3A22%3A51+-0400', + query: 'order=processed_at+ASC', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222844, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222843, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222842, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, + processed_at_min: "2005-08-06 10:22:51 -0400", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/tender_transactions.json', - query: '', + query: 'processed_at_min=2005-08-06+10%3A22%3A51+-0400', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222848, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222853, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - processed_at_min: "2005-08-06 10:22:51 -0400", + processed_at_max: "2005-08-06 10:22:51 -0400", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/tender_transactions.json', - query: 'processed_at_min=2005-08-06+10%3A22%3A51+-0400', + query: 'processed_at_max=2005-08-06+10%3A22%3A51+-0400', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222849, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222850, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222843, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - order: "processed_at ASC", + processed_at_max: "2005-08-05 10:22:51 -0400", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/tender_transactions.json', - query: 'order=processed_at+ASC', + query: 'processed_at_max=2005-08-05+10%3A22%3A51+-0400', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-07/theme.test.ts b/rest/admin/__tests__/2022-07/theme.test.ts index ff40fbe18..70b46da11 100644 --- a/rest/admin/__tests__/2022-07/theme.test.ts +++ b/rest/admin/__tests__/2022-07/theme.test.ts @@ -31,7 +31,7 @@ describe('Theme resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"themes": [{"id": 828155753, "name": "Comfort", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}, {"id": 976877075, "name": "Preview of Parallax", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "demo", "theme_store_id": 688, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/976877075"}, {"id": 752253240, "name": "Sandbox", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}]})); + queueMockResponse(JSON.stringify({"themes": [{"id": 828155753, "name": "Comfort", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}, {"id": 976877075, "name": "Preview of Parallax", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "demo", "theme_store_id": 688, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/976877075"}, {"id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}]})); await shopify.rest.Theme.all({ session: session, @@ -48,7 +48,7 @@ describe('Theme resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"theme": {"id": 1049083723, "name": "Lemongrass", "created_at": "2022-10-03T13:05:00-04:00", "updated_at": "2022-10-03T13:05:00-04:00", "role": "unpublished", "theme_store_id": null, "previewable": false, "processing": true, "admin_graphql_api_id": "gid://shopify/Theme/1049083723"}})); + queueMockResponse(JSON.stringify({"theme": {"id": 1049083723, "name": "Lemongrass", "created_at": "2023-01-03T12:25:57-05:00", "updated_at": "2023-01-03T12:25:57-05:00", "role": "unpublished", "theme_store_id": null, "previewable": false, "processing": true, "admin_graphql_api_id": "gid://shopify/Theme/1049083723"}})); const theme = new shopify.rest.Theme({session: session}); theme.name = "Lemongrass"; @@ -67,7 +67,7 @@ describe('Theme resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"theme": {"id": 828155753, "name": "Comfort", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}})); + queueMockResponse(JSON.stringify({"theme": {"id": 828155753, "name": "Comfort", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}})); await shopify.rest.Theme.find({ session: session, @@ -85,11 +85,11 @@ describe('Theme resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"theme": {"name": "Experimental", "role": "unpublished", "id": 752253240, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:04:50-04:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + queueMockResponse(JSON.stringify({"theme": {"role": "main", "id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:51-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); const theme = new shopify.rest.Theme({session: session}); theme.id = 752253240; - theme.name = "Experimental"; + theme.role = "main"; await theme.save({}); expect({ @@ -98,16 +98,16 @@ describe('Theme resource', () => { path: '/admin/api/2022-07/themes/752253240.json', query: '', headers, - data: { "theme": {"name": "Experimental"} } + data: { "theme": {"role": "main"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"theme": {"role": "main", "id": 752253240, "name": "Sandbox", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:04:59-04:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + queueMockResponse(JSON.stringify({"theme": {"name": "Experimental", "role": "unpublished", "id": 752253240, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:26:01-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); const theme = new shopify.rest.Theme({session: session}); theme.id = 752253240; - theme.role = "main"; + theme.name = "Experimental"; await theme.save({}); expect({ @@ -116,12 +116,12 @@ describe('Theme resource', () => { path: '/admin/api/2022-07/themes/752253240.json', query: '', headers, - data: { "theme": {"role": "main"} } + data: { "theme": {"name": "Experimental"} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"id": 752253240, "name": "Sandbox", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"})); + queueMockResponse(JSON.stringify({"id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"})); await shopify.rest.Theme.delete({ session: session, diff --git a/rest/admin/__tests__/2022-07/transaction.test.ts b/rest/admin/__tests__/2022-07/transaction.test.ts index b5b240307..dd81d6108 100644 --- a/rest/admin/__tests__/2022-07/transaction.test.ts +++ b/rest/admin/__tests__/2022-07/transaction.test.ts @@ -31,7 +31,7 @@ describe('Transaction resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "c901414060.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}, {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}, {"id": 801038806, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T10:22:51-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2005-08-05T10:22:51-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "250.94", "currency": "USD", "payment_id": "c901414060.2", "admin_graphql_api_id": "gid://shopify/OrderTransaction/801038806"}]})); + queueMockResponse(JSON.stringify({"transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}, {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "#1001.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}, {"id": 801038806, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T10:22:51-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2005-08-05T10:22:51-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "250.94", "currency": "USD", "payment_id": "#1001.2", "admin_graphql_api_id": "gid://shopify/OrderTransaction/801038806"}]})); await shopify.rest.Transaction.all({ session: session, @@ -49,7 +49,7 @@ describe('Transaction resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"transactions": [{"id": 1068278464, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:03-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:03-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278464"}]})); + queueMockResponse(JSON.stringify({"transactions": [{"id": 1068278485, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:26-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:26-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278485"}]})); await shopify.rest.Transaction.all({ session: session, @@ -68,7 +68,7 @@ describe('Transaction resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278467, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:19-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:19-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278467"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278488, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:33-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:33-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278488"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; @@ -89,7 +89,7 @@ describe('Transaction resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278463, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:00-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:00-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278463"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278486, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:29-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:29-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278486"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; @@ -108,7 +108,7 @@ describe('Transaction resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278465, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:07-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:07-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278465"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278484, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:24-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:24-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278484"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; @@ -130,7 +130,7 @@ describe('Transaction resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278466, "order_id": 450789469, "kind": "void", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:11-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:11-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "0.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278466"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278487, "order_id": 450789469, "kind": "void", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:31-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:31-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "0.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278487"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; diff --git a/rest/admin/__tests__/2022-07/usage_charge.test.ts b/rest/admin/__tests__/2022-07/usage_charge.test.ts index ea58f8fcc..d633c8209 100644 --- a/rest/admin/__tests__/2022-07/usage_charge.test.ts +++ b/rest/admin/__tests__/2022-07/usage_charge.test.ts @@ -31,7 +31,7 @@ describe('UsageCharge resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618208, "description": "Super Mega Plan 1000 emails", "price": "1.00", "created_at": "2022-10-03T12:53:15-04:00", "billing_on": null, "balance_used": 11.0, "balance_remaining": 89.0, "risk_level": 0}})); + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618209, "description": "Super Mega Plan 1000 emails", "price": "1.00", "created_at": "2023-01-03T12:42:12-05:00", "billing_on": null, "balance_used": 11.0, "balance_remaining": 89.0, "risk_level": 0}})); const usage_charge = new shopify.rest.UsageCharge({session: session}); usage_charge.recurring_application_charge_id = 455696195; @@ -50,7 +50,7 @@ describe('UsageCharge resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"usage_charges": [{"id": 1034618206, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2022-10-03T12:53:13-04:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}]})); + queueMockResponse(JSON.stringify({"usage_charges": [{"id": 1034618206, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2023-01-03T12:42:08-05:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}]})); await shopify.rest.UsageCharge.all({ session: session, @@ -68,18 +68,18 @@ describe('UsageCharge resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618210, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2022-10-03T12:53:16-04:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}})); + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618207, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2023-01-03T12:42:10-05:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}})); await shopify.rest.UsageCharge.find({ session: session, recurring_application_charge_id: 455696195, - id: 1034618210, + id: 1034618207, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-07/recurring_application_charges/455696195/usage_charges/1034618210.json', + path: '/admin/api/2022-07/recurring_application_charges/455696195/usage_charges/1034618207.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-07/user.test.ts b/rest/admin/__tests__/2022-07/user.test.ts index 31bca6ae9..cb8932153 100644 --- a/rest/admin/__tests__/2022-07/user.test.ts +++ b/rest/admin/__tests__/2022-07/user.test.ts @@ -31,7 +31,7 @@ describe('User resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"users": [{"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}, {"id": 930143300, "first_name": "John", "email": "j.limited@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Limited", "account_owner": false, "receive_announcements": 1, "bio": null, "permissions": [], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/930143300", "tfa_enabled?": false}]})); + queueMockResponse(JSON.stringify({"users": [{"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}, {"id": 930143300, "first_name": "John", "email": "j.limited@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Limited", "account_owner": false, "receive_announcements": 1, "bio": null, "permissions": [], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/930143300", "tfa_enabled?": false}]})); await shopify.rest.User.all({ session: session, @@ -48,7 +48,7 @@ describe('User resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); await shopify.rest.User.find({ session: session, @@ -66,7 +66,7 @@ describe('User resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); await shopify.rest.User.current({ session: session, diff --git a/rest/admin/__tests__/2022-07/variant.test.ts b/rest/admin/__tests__/2022-07/variant.test.ts index 0692495bc..39da52fdb 100644 --- a/rest/admin/__tests__/2022-07/variant.test.ts +++ b/rest/admin/__tests__/2022-07/variant.test.ts @@ -31,220 +31,220 @@ describe('Variant resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); await shopify.rest.Variant.all({ session: session, product_id: 632910392, - since_id: "49148385", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products/632910392/variants.json', - query: 'since_id=49148385', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + queueMockResponse(JSON.stringify({"variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); await shopify.rest.Variant.all({ session: session, product_id: 632910392, - presentment_currencies: "USD,CAD", + since_id: "49148385", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products/632910392/variants.json', - query: 'presentment_currencies=USD%2CCAD', + query: 'since_id=49148385', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); await shopify.rest.Variant.all({ session: session, product_id: 632910392, + presentment_currencies: "USD,CAD", }); expect({ method: 'GET', domain, path: '/admin/api/2022-07/products/632910392/variants.json', - query: '', + query: 'presentment_currencies=USD%2CCAD', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"count": 4})); + queueMockResponse(JSON.stringify({"variant": {"id": 1070325020, "product_id": 632910392, "title": "Yellow", "price": "1.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Yellow", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:18-05:00", "updated_at": "2023-01-03T12:25:18-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325020, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "1.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325020"}})); - await shopify.rest.Variant.count({ - session: session, - product_id: 632910392, - }); + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Yellow"; + variant.price = "1.00"; + await variant.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/products/632910392/variants/count.json', + path: '/admin/api/2022-07/products/632910392/variants.json', query: '', headers, - data: undefined + data: { "variant": {"option1": "Yellow", "price": "1.00"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "tax_code": "DA040000", "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 1070325023, "product_id": 632910392, "title": "Blue", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Blue", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:36-05:00", "updated_at": "2023-01-03T12:25:36-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325023, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325023"}})); - await shopify.rest.Variant.find({ - session: session, - id: 808950810, - }); + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Blue"; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await variant.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-07/variants/808950810.json', + path: '/admin/api/2022-07/products/632910392/variants.json', query: '', headers, - data: undefined + data: { "variant": {"option1": "Blue", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:21-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 1070325022, "product_id": 632910392, "title": "Purple", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Purple", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:32-05:00", "updated_at": "2023-01-03T12:25:32-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": 850703190, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325022, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325022"}})); const variant = new shopify.rest.Variant({session: session}); - variant.id = 808950810; - variant.image_id = 562641783; + variant.product_id = 632910392; + variant.image_id = 850703190; + variant.option1 = "Purple"; await variant.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-07/variants/808950810.json', + path: '/admin/api/2022-07/products/632910392/variants.json', query: '', headers, - data: { "variant": {"image_id": 562641783} } + data: { "variant": {"image_id": 850703190, "option1": "Purple"} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:38-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"count": 4})); - const variant = new shopify.rest.Variant({session: session}); - variant.id = 808950810; - variant.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; - await variant.save({}); + await shopify.rest.Variant.count({ + session: session, + product_id: 632910392, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-07/variants/808950810.json', + path: '/admin/api/2022-07/products/632910392/variants/count.json', query: '', headers, - data: { "variant": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Not Pink", "price": "99.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Not Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:49-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "99.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "tax_code": "DA040000", "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); - const variant = new shopify.rest.Variant({session: session}); - variant.id = 808950810; - variant.option1 = "Not Pink"; - variant.price = "99.00"; - await variant.save({}); + await shopify.rest.Variant.find({ + session: session, + id: 808950810, + }); expect({ - method: 'PUT', + method: 'GET', domain, path: '/admin/api/2022-07/variants/808950810.json', query: '', headers, - data: { "variant": {"option1": "Not Pink", "price": "99.00"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 1070325019, "product_id": 632910392, "title": "Purple", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Purple", "option2": null, "option3": null, "created_at": "2022-10-03T12:50:00-04:00", "updated_at": "2022-10-03T12:50:00-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": 850703190, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325019, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325019"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:13-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); const variant = new shopify.rest.Variant({session: session}); - variant.product_id = 632910392; - variant.image_id = 850703190; - variant.option1 = "Purple"; + variant.id = 808950810; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await variant.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products/632910392/variants.json', + path: '/admin/api/2022-07/variants/808950810.json', query: '', headers, - data: { "variant": {"image_id": 850703190, "option1": "Purple"} } + data: { "variant": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 1070325020, "product_id": 632910392, "title": "Yellow", "price": "1.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Yellow", "option2": null, "option3": null, "created_at": "2022-10-03T12:50:03-04:00", "updated_at": "2022-10-03T12:50:03-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325020, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "1.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325020"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:26-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); const variant = new shopify.rest.Variant({session: session}); - variant.product_id = 632910392; - variant.option1 = "Yellow"; - variant.price = "1.00"; + variant.id = 808950810; + variant.image_id = 562641783; await variant.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products/632910392/variants.json', + path: '/admin/api/2022-07/variants/808950810.json', query: '', headers, - data: { "variant": {"option1": "Yellow", "price": "1.00"} } + data: { "variant": {"image_id": 562641783} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 1070325024, "product_id": 632910392, "title": "Blue", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Blue", "option2": null, "option3": null, "created_at": "2022-10-03T12:50:35-04:00", "updated_at": "2022-10-03T12:50:35-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325024, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325024"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Not Pink", "price": "99.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Not Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:43-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "99.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); const variant = new shopify.rest.Variant({session: session}); - variant.product_id = 632910392; - variant.option1 = "Blue"; - variant.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + variant.id = 808950810; + variant.option1 = "Not Pink"; + variant.price = "99.00"; await variant.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-07/products/632910392/variants.json', + path: '/admin/api/2022-07/variants/808950810.json', query: '', headers, - data: { "variant": {"option1": "Blue", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "variant": {"option1": "Not Pink", "price": "99.00"} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/abandoned_checkout.test.ts b/rest/admin/__tests__/2022-10/abandoned_checkout.test.ts index e29777ce7..566de2f58 100644 --- a/rest/admin/__tests__/2022-10/abandoned_checkout.test.ts +++ b/rest/admin/__tests__/2022-10/abandoned_checkout.test.ts @@ -31,60 +31,60 @@ describe('AbandonedCheckout resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, + created_at_max: "2013-10-12T07:05:27-02:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/checkouts.json', - query: '', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/checkouts.json', - query: 'status=closed', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - created_at_max: "2013-10-12T07:05:27-02:00", + status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/checkouts.json', - query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + query: 'status=closed', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, @@ -102,53 +102,53 @@ describe('AbandonedCheckout resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/checkouts.json', - query: 'status=closed', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, + created_at_max: "2013-10-12T07:05:27-02:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/checkouts.json', - query: '', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "955c2067a4e0b28e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "971595d5d798ba36", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T13:07:13-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); await shopify.rest.AbandonedCheckout.checkouts({ session: session, - created_at_max: "2013-10-12T07:05:27-02:00", + status: "closed", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/checkouts.json', - query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + query: 'status=closed', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-10/apple_pay_certificate.test.ts b/rest/admin/__tests__/2022-10/apple_pay_certificate.test.ts index 68ec1ec84..f780b9282 100644 --- a/rest/admin/__tests__/2022-10/apple_pay_certificate.test.ts +++ b/rest/admin/__tests__/2022-10/apple_pay_certificate.test.ts @@ -31,7 +31,7 @@ describe('ApplePayCertificate resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938274, "status": "issuing", "merchant_id": null}})); + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938276, "status": "issuing", "merchant_id": null}})); const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); @@ -48,17 +48,17 @@ describe('ApplePayCertificate resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938276, "status": "csr", "merchant_id": null}})); + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938274, "status": "csr", "merchant_id": null}})); await shopify.rest.ApplePayCertificate.find({ session: session, - id: 1068938276, + id: 1068938274, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/apple_pay_certificates/1068938276.json', + path: '/admin/api/2022-10/apple_pay_certificates/1068938274.json', query: '', headers, data: undefined @@ -66,10 +66,10 @@ describe('ApplePayCertificate resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938277, "status": "completed", "merchant_id": "merchant.something"}})); + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938275, "status": "completed", "merchant_id": "merchant.something"}})); const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); - apple_pay_certificate.id = 1068938277; + apple_pay_certificate.id = 1068938275; apple_pay_certificate.status = "completed"; apple_pay_certificate.merchant_id = "merchant.something"; apple_pay_certificate.encoded_signed_certificate = "MIIEZzCCBA6gAwIBAgIIWGMideLkDJAwCgYIKoZIzj0EAwIwgYAxNDAyBgNV\nBAMMK0FwcGxlIFdvcmxkd2lkZS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FBwIBFipodHRw\nOi8vd3d3LmFwcGxlLmNvbS9jZXJ0aWZpY2F0ZWF1dGhvcml0eS8wNgYDVR0f\nBC8wLTAroCmgJ4YlaHR0cDovL2NybC5hcHBsZS5jb20vYXBwbGV3d2RyY2Ey\nLmNybDAOBgNVHQ8BAf8EBAMCAygwTwYJKoZIhvdjZAYgBEIMQDM0NTBBMjhB\nOTlGRjIyRkI5OTdDRERFODU1REREOTI5NTE4RjVGMDdBQUM4NzdDMzRCQjM3\nODFCQTg2MzkyNjIwCgYIKoZIzj0EAwIDRwAwRAIgZ/oNx0gCc/PM4pYhOWL2\nCecFQrIgzHr/fZd8qcy3Be8CIEQCaAPpmvQrXEX0hFexoYMHtOHY9dgN2D8L\nNKpVyn3t\n"; @@ -78,7 +78,7 @@ describe('ApplePayCertificate resource', () => { expect({ method: 'PUT', domain, - path: '/admin/api/2022-10/apple_pay_certificates/1068938277.json', + path: '/admin/api/2022-10/apple_pay_certificates/1068938275.json', query: '', headers, data: { "apple_pay_certificate": {"status": "completed", "merchant_id": "merchant.something", "encoded_signed_certificate": "MIIEZzCCBA6gAwIBAgIIWGMideLkDJAwCgYIKoZIzj0EAwIwgYAxNDAyBgNV\nBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0g\nRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMw\nEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNDEyMDgyMTMy\nMDBaFw0xNzAxMDYyMTMyMDBaMIGZMSowKAYKCZImiZPyLGQBAQwabWVyY2hh\nbnQuY29tLm5vcm1vcmUuamFzb24xMDAuBgNVBAMMJ01lcmNoYW50IElEOiBt\nZXJjaGFudC5jb20ubm9ybW9yZS5qYXNvbjETMBEGA1UECwwKNVVZMzJOTE5O\nOTEXMBUGA1UECgwOSm9zaHVhIFRlc3NpZXIxCzAJBgNVBAYTAkNBMF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Vyn3t\n"} } @@ -90,13 +90,13 @@ describe('ApplePayCertificate resource', () => { await shopify.rest.ApplePayCertificate.delete({ session: session, - id: 1068938278, + id: 1068938277, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/apple_pay_certificates/1068938278.json', + path: '/admin/api/2022-10/apple_pay_certificates/1068938277.json', query: '', headers, data: undefined @@ -108,13 +108,13 @@ describe('ApplePayCertificate resource', () => { await shopify.rest.ApplePayCertificate.csr({ session: session, - id: 1068938275, + id: 1068938278, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/apple_pay_certificates/1068938275/csr.json', + path: '/admin/api/2022-10/apple_pay_certificates/1068938278/csr.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/application_charge.test.ts b/rest/admin/__tests__/2022-10/application_charge.test.ts index 11a25f274..048f101ba 100644 --- a/rest/admin/__tests__/2022-10/application_charge.test.ts +++ b/rest/admin/__tests__/2022-10/application_charge.test.ts @@ -31,7 +31,7 @@ describe('ApplicationCharge resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262347, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": true, "created_at": "2022-10-03T12:20:20-04:00", "updated_at": "2022-10-03T12:20:20-04:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262347", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262347/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBAsxojw6EmF1dG9fYWN0aXZhdGVU--997306f5eeeafb34d59f4272303af853c6aa28da"}})); + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262349, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": true, "created_at": "2023-01-03T13:03:09-05:00", "updated_at": "2023-01-03T13:03:09-05:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262349", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262349/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA0xojw6EmF1dG9fYWN0aXZhdGVU--ea73480c6bd64f4002e70c5f128c1623aaa7991e"}})); const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; @@ -51,7 +51,7 @@ describe('ApplicationCharge resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262350, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": null, "created_at": "2022-10-03T12:20:27-04:00", "updated_at": "2022-10-03T12:20:27-04:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262350", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262350/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA4xojw6EmF1dG9fYWN0aXZhdGVU--ac057c7548ab2cf6b733606771fc47a03238e4ed"}})); + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262351, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": null, "created_at": "2023-01-03T13:03:15-05:00", "updated_at": "2023-01-03T13:03:15-05:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262351", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262351/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA8xojw6EmF1dG9fYWN0aXZhdGVU--9dad4a7611bec2f70cd0db8cc9157e15360188f0"}})); const application_charge = new shopify.rest.ApplicationCharge({session: session}); application_charge.name = "Super Duper Expensive action"; @@ -70,17 +70,16 @@ describe('ApplicationCharge resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"application_charge": {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}})); + queueMockResponse(JSON.stringify({"application_charges": [{"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}, {"id": 556467234, "name": "Green theme", "api_client_id": 755357713, "price": "120.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "theme", "decorated_return_url": "http://google.com?charge_id=556467234"}, {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}]})); - await shopify.rest.ApplicationCharge.find({ + await shopify.rest.ApplicationCharge.all({ session: session, - id: 675931192, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/application_charges/675931192.json', + path: '/admin/api/2022-10/application_charges.json', query: '', headers, data: undefined @@ -88,7 +87,7 @@ describe('ApplicationCharge resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"application_charges": [{"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}, {"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}]})); + queueMockResponse(JSON.stringify({"application_charges": [{"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}, {"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}]})); await shopify.rest.ApplicationCharge.all({ session: session, @@ -106,16 +105,17 @@ describe('ApplicationCharge resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"application_charges": [{"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}, {"id": 556467234, "name": "Green theme", "api_client_id": 755357713, "price": "120.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": "theme", "decorated_return_url": "http://google.com?charge_id=556467234"}, {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}]})); + queueMockResponse(JSON.stringify({"application_charge": {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}})); - await shopify.rest.ApplicationCharge.all({ + await shopify.rest.ApplicationCharge.find({ session: session, + id: 675931192, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/application_charges.json', + path: '/admin/api/2022-10/application_charges/675931192.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/application_credit.test.ts b/rest/admin/__tests__/2022-10/application_credit.test.ts index 51ccda589..95d4b7832 100644 --- a/rest/admin/__tests__/2022-10/application_credit.test.ts +++ b/rest/admin/__tests__/2022-10/application_credit.test.ts @@ -31,12 +31,11 @@ describe('ApplicationCredit resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636125, "amount": "5.00", "description": "application credit for refund", "test": true}})); + queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636125, "amount": "5.00", "description": "application credit for refund", "test": null}})); const application_credit = new shopify.rest.ApplicationCredit({session: session}); application_credit.description = "application credit for refund"; application_credit.amount = 5.0; - application_credit.test = true; await application_credit.save({}); expect({ @@ -45,16 +44,17 @@ describe('ApplicationCredit resource', () => { path: '/admin/api/2022-10/application_credits.json', query: '', headers, - data: { "application_credit": {"description": "application credit for refund", "amount": 5.0, "test": true} } + data: { "application_credit": {"description": "application credit for refund", "amount": 5.0} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636127, "amount": "5.00", "description": "application credit for refund", "test": null}})); + queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636129, "amount": "5.00", "description": "application credit for refund", "test": true}})); const application_credit = new shopify.rest.ApplicationCredit({session: session}); application_credit.description = "application credit for refund"; application_credit.amount = 5.0; + application_credit.test = true; await application_credit.save({}); expect({ @@ -63,7 +63,7 @@ describe('ApplicationCredit resource', () => { path: '/admin/api/2022-10/application_credits.json', query: '', headers, - data: { "application_credit": {"description": "application credit for refund", "amount": 5.0} } + data: { "application_credit": {"description": "application credit for refund", "amount": 5.0, "test": true} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/article.test.ts b/rest/admin/__tests__/2022-10/article.test.ts index 52146a142..bae77a5fe 100644 --- a/rest/admin/__tests__/2022-10/article.test.ts +++ b/rest/admin/__tests__/2022-10/article.test.ts @@ -31,194 +31,206 @@ describe('Article resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"articles": [{"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}]})); + queueMockResponse(JSON.stringify({"articles": [{"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}]})); await shopify.rest.Article.all({ session: session, blog_id: 241253187, - since_id: "134645308", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/blogs/241253187/articles.json', - query: 'since_id=134645308', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"articles": [{"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2022-10-03T12:44:45-04:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}]})); + queueMockResponse(JSON.stringify({"articles": [{"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}]})); await shopify.rest.Article.all({ session: session, blog_id: 241253187, + since_id: "134645308", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/blogs/241253187/articles.json', - query: '', + query: 'since_id=134645308', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"count": 4})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293785, "title": "My new Article title", "created_at": "2023-01-03T12:47:34-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:34-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293785"}})); - await shopify.rest.Article.count({ - session: session, - blog_id: 241253187, - }); + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + await article.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/blogs/241253187/articles/count.json', + path: '/admin/api/2022-10/blogs/241253187/articles.json', query: '', headers, - data: undefined + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293781, "title": "My new Article title", "created_at": "2023-01-03T12:47:18-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:18-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293781", "image": {"created_at": "2023-01-03T12:47:18-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768038"}}})); - await shopify.rest.Article.find({ - session: session, - blog_id: 241253187, - id: 134645308, - }); + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + }; + await article.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-10/blogs/241253187/articles.json', query: '', headers, - data: undefined + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "user_id": null, "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "updated_at": "2022-10-03T12:46:51-04:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293786, "title": "My new Article title", "created_at": "2023-01-03T12:47:51-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:52-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293786"}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.id = 134645308; - article.title = "My new Title"; - article.author = "Your name"; - article.tags = "Tags, Will Be, Updated"; - article.body_html = "

Look, I can even update through a web service.

"; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await article.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-10/blogs/241253187/articles.json', query: '', headers, - data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "updated_at": "2022-10-03T12:47:19-04:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:47:18-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20221003-23488-6gc29.gif?v=1664815639"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293788, "title": "My new Article title", "created_at": "2023-01-03T12:48:03-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:48:04-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293788", "image": {"created_at": "2023-01-03T12:48:03-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20230103-54493-87k83g.gif?v=1672768084"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.id = 134645308; - article.title = "My new Title"; - article.author = "Your name"; - article.tags = "Tags, Will Be, Updated"; - article.body_html = "

Look, I can even update through a web service.

"; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; article.image = { + "src": "http://example.com/rails_logo.gif", "alt": "Rails logo" }; await article.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-10/blogs/241253187/articles.json', query: '', headers, - data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"alt": "Rails logo"}} } + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": "2022-10-03T12:47:23-04:00", "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2022-10-03T12:47:23-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 1051293784, "title": "My new Article title", "created_at": "2023-01-03T12:47:30-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": null, "updated_at": "2023-01-03T12:47:30-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293784"}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.id = 134645308; - article.published = true; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published = false; await article.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-10/blogs/241253187/articles.json', query: '', headers, - data: { "article": {"published": true} } + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published": false} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "updated_at": "2022-10-03T12:48:10-04:00", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:48:10-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1664815690"}}})); + queueMockResponse(JSON.stringify({"count": 4})); - const article = new shopify.rest.Article({session: session}); - article.blog_id = 241253187; - article.id = 134645308; - article.title = "My new Title"; - article.author = "Your name"; - article.tags = "Tags, Will Be, Updated"; - article.body_html = "

Look, I can even update through a web service.

"; - article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - article.image = { - "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1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lSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n" - }; - await article.save({}); + await shopify.rest.Article.count({ + session: session, + blog_id: 241253187, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', + path: '/admin/api/2022-10/blogs/241253187/articles/count.json', query: '', headers, - data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLR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D9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": null, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2022-10-03T12:48:53-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); - const article = new shopify.rest.Article({session: session}); - article.blog_id = 241253187; - article.id = 134645308; - article.published = false; - await article.save({}); + await shopify.rest.Article.find({ + session: session, + blog_id: 241253187, + id: 134645308, + }); expect({ - method: 'PUT', + method: 'GET', domain, path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2022-10-03T12:48:56-04:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2022-10-03T12:44:45-04:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1664815485"}}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2023-01-03T12:48:00-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; @@ -244,12 +256,12 @@ describe('Article resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "updated_at": "2022-10-03T12:49:00-04:00", "id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308"}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": null, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2023-01-03T12:48:14-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; article.id = 134645308; - article.image = ""; + article.published = false; await article.save({}); expect({ @@ -258,151 +270,139 @@ describe('Article resource', () => { path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"image": ""} } + data: { "article": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": "2023-01-03T12:47:11-05:00", "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2023-01-03T12:47:11-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); - await shopify.rest.Article.delete({ - session: session, - blog_id: 241253187, - id: 134645308, - }); + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.published = true; + await article.save({}); expect({ - method: 'DELETE', + method: 'PUT', domain, path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', query: '', headers, - data: undefined + data: { "article": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293784, "title": "My new Article title", "created_at": "2022-10-03T12:47:52-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:47:52-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293784", "image": {"created_at": "2022-10-03T12:47:52-04:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664815672"}}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "updated_at": "2023-01-03T12:47:43-05:00", "id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308"}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; - article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - article.image = { - "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" - }; + article.id = 134645308; + article.image = ""; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/blogs/241253187/articles.json', + path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}} } + data: { "article": {"image": ""} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293786, "title": "My new Article title", "created_at": "2022-10-03T12:48:37-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:48:37-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293786"}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "updated_at": "2023-01-03T12:48:33-05:00", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:48:33-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672768113"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - article.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + article.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXH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bnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n" + }; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/blogs/241253187/articles.json', + path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5M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DlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"}} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293787, "title": "My new Article title", "created_at": "2022-10-03T12:48:40-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": null, "updated_at": "2022-10-03T12:48:40-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293787"}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "user_id": null, "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "updated_at": "2023-01-03T12:47:47-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; - article.published = false; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/blogs/241253187/articles.json', + path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published": false} } + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293788, "title": "My new Article title", "created_at": "2022-10-03T12:48:48-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:48:49-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293788", "image": {"created_at": "2022-10-03T12:48:49-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20221003-23488-ryyw9l.gif?v=1664815729"}}})); + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "updated_at": "2023-01-03T12:48:40-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:48:40-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20230103-54493-qvpb1u.gif?v=1672768120"}}})); const article = new shopify.rest.Article({session: session}); article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; article.image = { - "src": "http://example.com/rails_logo.gif", "alt": "Rails logo" }; await article.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/blogs/241253187/articles.json', + path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails logo"}} } + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"article": {"id": 1051293792, "title": "My new Article title", "created_at": "2022-10-03T12:49:40-04:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2022-10-03T12:49:40-04:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293792"}})); + queueMockResponse(JSON.stringify({})); - const article = new shopify.rest.Article({session: session}); - article.blog_id = 241253187; - article.title = "My new Article title"; - article.author = "John Smith"; - article.tags = "This Post, Has Been Tagged"; - article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; - article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; - await article.save({}); + await shopify.rest.Article.delete({ + session: session, + blog_id: 241253187, + id: 134645308, + }); expect({ - method: 'POST', + method: 'DELETE', domain, - path: '/admin/api/2022-10/blogs/241253187/articles.json', + path: '/admin/api/2022-10/blogs/241253187/articles/134645308.json', query: '', headers, - data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + data: undefined }).toMatchMadeHttpRequest(); }); @@ -424,74 +424,74 @@ describe('Article resource', () => { }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); await shopify.rest.Article.tags({ session: session, - limit: "1", - popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/articles/tags.json', - query: 'limit=1&popular=1', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); await shopify.rest.Article.tags({ session: session, + limit: "1", + popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/articles/tags.json', - query: '', + query: 'limit=1&popular=1', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); await shopify.rest.Article.tags({ session: session, blog_id: 241253187, - limit: "1", - popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/blogs/241253187/articles/tags.json', - query: 'limit=1&popular=1', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); await shopify.rest.Article.tags({ session: session, blog_id: 241253187, + limit: "1", + popular: "1", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/blogs/241253187/articles/tags.json', - query: '', + query: 'limit=1&popular=1', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-10/asset.test.ts b/rest/admin/__tests__/2022-10/asset.test.ts index cea141e13..a37e0e77d 100644 --- a/rest/admin/__tests__/2022-10/asset.test.ts +++ b/rest/admin/__tests__/2022-10/asset.test.ts @@ -49,12 +49,12 @@ describe('Asset resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "layout/alternate.liquid", "public_url": null, "created_at": "2022-10-03T13:22:25-04:00", "updated_at": "2022-10-03T13:22:25-04:00", "content_type": "application/x-liquid", "size": 3049, "checksum": "1879a06996941b2ff1ff485a1fe60a97", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2023-01-03T12:39:59-05:00", "content_type": "application/x-liquid", "size": 110, "checksum": "cd71db2e14df976c8aa44b44c8dae77b", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; - asset.key = "layout/alternate.liquid"; - asset.source_key = "layout/theme.liquid"; + asset.key = "templates/index.liquid"; + asset.value = "

We are busy updating the store for you and will be back within the hour.

"; await asset.save({}); expect({ @@ -63,12 +63,12 @@ describe('Asset resource', () => { path: '/admin/api/2022-10/themes/828155753/assets.json', query: '', headers, - data: { "asset": {"key": "layout/alternate.liquid", "source_key": "layout/theme.liquid"} } + data: { "asset": {"key": "templates/index.liquid", "value": "

We are busy updating the store for you and will be back within the hour.

"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "assets/empty.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/empty.gif?v=1664817747", "created_at": "2022-10-03T13:22:27-04:00", "updated_at": "2022-10-03T13:22:27-04:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "assets/empty.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/empty.gif?v=1672767606", "created_at": "2023-01-03T12:40:06-05:00", "updated_at": "2023-01-03T12:40:06-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; @@ -87,12 +87,12 @@ describe('Asset resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2022-10-03T13:22:28-04:00", "content_type": "application/x-liquid", "size": 110, "checksum": "cd71db2e14df976c8aa44b44c8dae77b", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1672767597", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2023-01-03T12:39:57-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; - asset.key = "templates/index.liquid"; - asset.value = "

We are busy updating the store for you and will be back within the hour.

"; + asset.key = "assets/bg-body.gif"; + asset.src = "http://example.com/new_bg.gif"; await asset.save({}); expect({ @@ -101,17 +101,17 @@ describe('Asset resource', () => { path: '/admin/api/2022-10/themes/828155753/assets.json', query: '', headers, - data: { "asset": {"key": "templates/index.liquid", "value": "

We are busy updating the store for you and will be back within the hour.

"} } + data: { "asset": {"key": "assets/bg-body.gif", "src": "http://example.com/new_bg.gif"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"asset": {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1664817751", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2022-10-03T13:22:31-04:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + queueMockResponse(JSON.stringify({"asset": {"key": "layout/alternate.liquid", "public_url": null, "created_at": "2023-01-03T12:40:04-05:00", "updated_at": "2023-01-03T12:40:04-05:00", "content_type": "application/x-liquid", "size": 3049, "checksum": "1879a06996941b2ff1ff485a1fe60a97", "theme_id": 828155753}})); const asset = new shopify.rest.Asset({session: session}); asset.theme_id = 828155753; - asset.key = "assets/bg-body.gif"; - asset.src = "http://example.com/new_bg.gif"; + asset.key = "layout/alternate.liquid"; + asset.source_key = "layout/theme.liquid"; await asset.save({}); expect({ @@ -120,7 +120,7 @@ describe('Asset resource', () => { path: '/admin/api/2022-10/themes/828155753/assets.json', query: '', headers, - data: { "asset": {"key": "assets/bg-body.gif", "src": "http://example.com/new_bg.gif"} } + data: { "asset": {"key": "layout/alternate.liquid", "source_key": "layout/theme.liquid"} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/assigned_fulfillment_order.test.ts b/rest/admin/__tests__/2022-10/assigned_fulfillment_order.test.ts index 25b733b5d..fe18bf2e1 100644 --- a/rest/admin/__tests__/2022-10/assigned_fulfillment_order.test.ts +++ b/rest/admin/__tests__/2022-10/assigned_fulfillment_order.test.ts @@ -31,7 +31,7 @@ describe('AssignedFulfillmentOrder resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000777, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000777, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737481, "shop_id": 548380009, "fulfillment_order_id": 1046000777, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}}]})); + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000830, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000821, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737568, "shop_id": 548380009, "fulfillment_order_id": 1046000830, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}}]})); await shopify.rest.AssignedFulfillmentOrder.all({ session: session, diff --git a/rest/admin/__tests__/2022-10/blog.test.ts b/rest/admin/__tests__/2022-10/blog.test.ts index a87c13881..ae805ba11 100644 --- a/rest/admin/__tests__/2022-10/blog.test.ts +++ b/rest/admin/__tests__/2022-10/blog.test.ts @@ -31,7 +31,7 @@ describe('Blog resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}]})); + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}]})); await shopify.rest.Blog.all({ session: session, @@ -48,7 +48,7 @@ describe('Blog resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 1008414250, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2022-10-11T13:03:48-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:48-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414250"}]})); + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 1008414253, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:27-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:27-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414253"}]})); await shopify.rest.Blog.all({ session: session, @@ -66,18 +66,10 @@ describe('Blog resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 1008414248, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2022-10-11T13:03:41-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:41-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414248"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 1008414251, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:18-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:18-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414251"}})); const blog = new shopify.rest.Blog({session: session}); blog.title = "Apple main blog"; - blog.metafields = [ - { - "key": "sponsor", - "value": "Shopify", - "type": "single_line_text_field", - "namespace": "global" - } - ]; await blog.save({}); expect({ @@ -86,15 +78,23 @@ describe('Blog resource', () => { path: '/admin/api/2022-10/blogs.json', query: '', headers, - data: { "blog": {"title": "Apple main blog", "metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "blog": {"title": "Apple main blog"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 1008414253, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2022-10-11T13:04:01-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:04:01-04:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414253"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 1008414254, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:35-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:34-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414254"}})); const blog = new shopify.rest.Blog({session: session}); blog.title = "Apple main blog"; + blog.metafields = [ + { + "key": "sponsor", + "value": "Shopify", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await blog.save({}); expect({ @@ -103,7 +103,7 @@ describe('Blog resource', () => { path: '/admin/api/2022-10/blogs.json', query: '', headers, - data: { "blog": {"title": "Apple main blog"} } + data: { "blog": {"title": "Apple main blog", "metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); @@ -125,44 +125,44 @@ describe('Blog resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "title": "Mah Blog"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); await shopify.rest.Blog.find({ session: session, id: 241253187, - fields: "id,title", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/blogs/241253187.json', - query: 'fields=id%2Ctitle', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "title": "Mah Blog"}})); await shopify.rest.Blog.find({ session: session, id: 241253187, + fields: "id,title", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/blogs/241253187.json', - query: '', + query: 'fields=id%2Ctitle', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"blog": {"title": "Mah Blog", "handle": "apple-blog", "id": 241253187, "updated_at": "2022-10-11T13:03:39-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"title": "Mah Blog", "handle": "apple-blog", "id": 241253187, "updated_at": "2023-01-03T12:45:58-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); const blog = new shopify.rest.Blog({session: session}); blog.id = 241253187; @@ -187,7 +187,7 @@ describe('Blog resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "apple-blog", "id": 241253187, "updated_at": "2022-10-11T13:03:45-04:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "apple-blog", "id": 241253187, "updated_at": "2023-01-03T12:46:23-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); const blog = new shopify.rest.Blog({session: session}); blog.id = 241253187; @@ -205,7 +205,7 @@ describe('Blog resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate", "id": 241253187, "updated_at": "2022-10-11T13:03:46-04:00", "feedburner": null, "feedburner_location": null, "created_at": "2022-10-11T13:03:14-04:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate", "id": 241253187, "updated_at": "2023-01-03T12:46:11-05:00", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); const blog = new shopify.rest.Blog({session: session}); blog.id = 241253187; diff --git a/rest/admin/__tests__/2022-10/cancellation_request.test.ts b/rest/admin/__tests__/2022-10/cancellation_request.test.ts index c22395840..7c9eb0ff3 100644 --- a/rest/admin/__tests__/2022-10/cancellation_request.test.ts +++ b/rest/admin/__tests__/2022-10/cancellation_request.test.ts @@ -31,17 +31,17 @@ describe('CancellationRequest resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000778, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000778, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737482, "shop_id": 548380009, "fulfillment_order_id": 1046000778, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000808, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737539, "shop_id": 548380009, "fulfillment_order_id": 1046000808, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const cancellation_request = new shopify.rest.CancellationRequest({session: session}); - cancellation_request.fulfillment_order_id = 1046000778; + cancellation_request.fulfillment_order_id = 1046000808; cancellation_request.message = "The customer changed his mind."; await cancellation_request.save({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000778/cancellation_request.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000808/cancellation_request.json', query: '', headers, data: { "cancellation_request": {"message": "The customer changed his mind."} } @@ -49,10 +49,10 @@ describe('CancellationRequest resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000779, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_accepted", "status": "cancelled", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000779, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737483, "shop_id": 548380009, "fulfillment_order_id": 1046000779, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000806, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_accepted", "status": "cancelled", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000798, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737537, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const cancellation_request = new shopify.rest.CancellationRequest({session: session}); - cancellation_request.fulfillment_order_id = 1046000779; + cancellation_request.fulfillment_order_id = 1046000806; await cancellation_request.accept({ body: {"cancellation_request": {"message": "We had not started any processing yet."}}, }); @@ -60,7 +60,7 @@ describe('CancellationRequest resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000779/cancellation_request/accept.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000806/cancellation_request/accept.json', query: '', headers, data: { "cancellation_request": {"message": "We had not started any processing yet."} } @@ -68,10 +68,10 @@ describe('CancellationRequest resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000780, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_rejected", "status": "in_progress", "supported_actions": [], "destination": {"id": 1046000780, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737484, "shop_id": 548380009, "fulfillment_order_id": 1046000780, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000807, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_rejected", "status": "in_progress", "supported_actions": [], "destination": {"id": 1046000799, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737538, "shop_id": 548380009, "fulfillment_order_id": 1046000807, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const cancellation_request = new shopify.rest.CancellationRequest({session: session}); - cancellation_request.fulfillment_order_id = 1046000780; + cancellation_request.fulfillment_order_id = 1046000807; await cancellation_request.reject({ body: {"cancellation_request": {"message": "We have already send the shipment out."}}, }); @@ -79,7 +79,7 @@ describe('CancellationRequest resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000780/cancellation_request/reject.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000807/cancellation_request/reject.json', query: '', headers, data: { "cancellation_request": {"message": "We have already send the shipment out."} } diff --git a/rest/admin/__tests__/2022-10/carrier_service.test.ts b/rest/admin/__tests__/2022-10/carrier_service.test.ts index d962ca6d3..586545a27 100644 --- a/rest/admin/__tests__/2022-10/carrier_service.test.ts +++ b/rest/admin/__tests__/2022-10/carrier_service.test.ts @@ -31,7 +31,7 @@ describe('CarrierService resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"carrier_service": {"id": 1067451814, "name": "Shipping Rate Provider", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451814", "format": "json", "callback_url": "http://shipping.example.com/"}})); + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894957, "name": "Shipping Rate Provider", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894957", "format": "json", "callback_url": "http://shipping.example.com/"}})); const carrier_service = new shopify.rest.CarrierService({session: session}); carrier_service.name = "Shipping Rate Provider"; @@ -50,7 +50,7 @@ describe('CarrierService resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"carrier_services": [{"id": 1067451817, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451817", "format": "json", "callback_url": "http://example.com/"}, {"id": 260046840, "name": "ups_shipping", "active": true, "service_discovery": true, "carrier_service_type": "legacy", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/260046840"}]})); + queueMockResponse(JSON.stringify({"carrier_services": [{"id": 1036894958, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894958", "format": "json", "callback_url": "http://example.com/"}, {"id": 260046840, "name": "ups_shipping", "active": true, "service_discovery": true, "carrier_service_type": "legacy", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/260046840"}]})); await shopify.rest.CarrierService.all({ session: session, @@ -67,10 +67,10 @@ describe('CarrierService resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"carrier_service": {"active": false, "id": 1067451815, "name": "Some new name", "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451815", "format": "json", "callback_url": "http://example.com/"}})); + queueMockResponse(JSON.stringify({"carrier_service": {"active": false, "id": 1036894955, "name": "Some new name", "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894955", "format": "json", "callback_url": "http://example.com/"}})); const carrier_service = new shopify.rest.CarrierService({session: session}); - carrier_service.id = 1067451815; + carrier_service.id = 1036894955; carrier_service.name = "Some new name"; carrier_service.active = false; await carrier_service.save({}); @@ -78,7 +78,7 @@ describe('CarrierService resource', () => { expect({ method: 'PUT', domain, - path: '/admin/api/2022-10/carrier_services/1067451815.json', + path: '/admin/api/2022-10/carrier_services/1036894955.json', query: '', headers, data: { "carrier_service": {"name": "Some new name", "active": false} } @@ -86,17 +86,17 @@ describe('CarrierService resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"carrier_service": {"id": 1067451816, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1067451816", "format": "json", "callback_url": "http://example.com/"}})); + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894954, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894954", "format": "json", "callback_url": "http://example.com/"}})); await shopify.rest.CarrierService.find({ session: session, - id: 1067451816, + id: 1036894954, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/carrier_services/1067451816.json', + path: '/admin/api/2022-10/carrier_services/1036894954.json', query: '', headers, data: undefined @@ -108,13 +108,13 @@ describe('CarrierService resource', () => { await shopify.rest.CarrierService.delete({ session: session, - id: 1067451812, + id: 1036894959, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/carrier_services/1067451812.json', + path: '/admin/api/2022-10/carrier_services/1036894959.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/checkout.test.ts b/rest/admin/__tests__/2022-10/checkout.test.ts index 8050c438d..b015fbd7b 100644 --- a/rest/admin/__tests__/2022-10/checkout.test.ts +++ b/rest/admin/__tests__/2022-10/checkout.test.ts @@ -31,10 +31,15 @@ describe('Checkout resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2022-10-03T12:24:56-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339458, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "me@example.com", "legal_notice_url": null, "location_id": null, "name": "#1066348319", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "8fa96ad154739bb205a00fab92a6cbb4", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2022-10-03T12:24:56-04:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/8fa96ad154739bb205a00fab92a6cbb4", "total_duties": null, "total_additional_fees": null, "line_items": [], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2023-01-03T12:41:32-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": null, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": null, "legal_notice_url": null, "location_id": null, "name": "#1066348317", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "995.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "995.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "c3b86d7cdfaf5a4d1bf89efbbe88789e", "total_price": "995.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "995.00", "updated_at": "2023-01-03T12:41:32-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/c3b86d7cdfaf5a4d1bf89efbbe88789e", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "e8a51fbe23cff8fcad2766f024a761d6", "key": "e8a51fbe23cff8fcad2766f024a761d6", "product_id": 632910392, "variant_id": 39072856, "sku": "IPOD2008GREEN", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Green", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "995.00", "properties": {}, "quantity": 5, "grams": 567, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); - checkout.email = "me@example.com"; + checkout.line_items = [ + { + "variant_id": 39072856, + "quantity": 5 + } + ]; await checkout.save({}); expect({ @@ -43,20 +48,15 @@ describe('Checkout resource', () => { path: '/admin/api/2022-10/checkouts.json', query: '', headers, - data: { "checkout": {"email": "me@example.com"} } + data: { "checkout": {"line_items": [{"variant_id": 39072856, "quantity": 5}]} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2022-10-03T12:25:20-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": null, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": null, "legal_notice_url": null, "location_id": null, "name": "#1066348320", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "995.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "995.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "d0c540d493f50196bbdf010794a53b9d", "total_price": "995.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "995.00", "updated_at": "2022-10-03T12:25:20-04:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/d0c540d493f50196bbdf010794a53b9d", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "4b03a6477a2646f2bef85f95822a6615", "key": "4b03a6477a2646f2bef85f95822a6615", "product_id": 632910392, "variant_id": 39072856, "sku": "IPOD2008GREEN", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Green", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "995.00", "properties": {}, "quantity": 5, "grams": 567, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2023-01-03T12:41:50-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339479, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "me@example.com", "legal_notice_url": null, "location_id": null, "name": "#1066348318", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "8a8043ef00104a4738ba3a235cd2441b", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2023-01-03T12:41:50-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/8a8043ef00104a4738ba3a235cd2441b", "total_duties": null, "total_additional_fees": null, "line_items": [], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); - checkout.line_items = [ - { - "variant_id": 39072856, - "quantity": 5 - } - ]; + checkout.email = "me@example.com"; await checkout.save({}); expect({ @@ -65,12 +65,12 @@ describe('Checkout resource', () => { path: '/admin/api/2022-10/checkouts.json', query: '', headers, - data: { "checkout": {"line_items": [{"variant_id": 39072856, "quantity": 5}]} } + data: { "checkout": {"email": "me@example.com"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#86568385", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "b490a9220cd14d7344024f4874f640a6", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2022-10-03T12:25:25-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/b490a9220cd14d7344024f4874f640a6", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": 49148385, "key": 49148385, "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": false, "gift_card": false, "price": "0.00", "compare_at_price": null, "line_price": "0.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#86568385", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "b490a9220cd14d7344024f4874f640a6", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2023-01-03T12:41:10-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/b490a9220cd14d7344024f4874f640a6", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": 49148385, "key": 49148385, "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": false, "gift_card": false, "price": "0.00", "compare_at_price": null, "line_price": "0.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); checkout.token = "b490a9220cd14d7344024f4874f640a6"; @@ -87,7 +87,7 @@ describe('Checkout resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": "2005-07-31T11:57:11-04:00", "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#901414060", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": 450789469, "order_status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you", "order": {"id": 450789469, "name": "#1001", "status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you"}, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": "2005-07-31T11:57:11-04:00", "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#901414060", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": 450789469, "order_status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you", "order": {"id": 450789469, "name": "#1001", "status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you"}, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); await shopify.rest.Checkout.find({ session: session, @@ -105,17 +105,17 @@ describe('Checkout resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); await shopify.rest.Checkout.find({ session: session, - token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + token: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', + path: '/admin/api/2022-10/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x.json', query: '', headers, data: undefined @@ -123,17 +123,17 @@ describe('Checkout resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); await shopify.rest.Checkout.find({ session: session, - token: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x.json', + path: '/admin/api/2022-10/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', query: '', headers, data: undefined @@ -141,7 +141,7 @@ describe('Checkout resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2022-10-03T12:25:06-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:41:57-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; @@ -161,7 +161,7 @@ describe('Checkout resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339459, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "john.smith@example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2022-10-03T12:25:22-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "921bef3967ebdc26", "key": "921bef3967ebdc26", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "531e7a36585bcf41", "key": "531e7a36585bcf41", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "John", "last_name": "Smith", "phone": "(123)456-7890", "company": null, "address1": "126 York St.", "address2": "", "city": "Los Angeles", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "90002"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339478, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "john.smith@example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:41:43-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "John", "last_name": "Smith", "phone": "(123)456-7890", "company": null, "address1": "126 York St.", "address2": "", "city": "Los Angeles", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "90002"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); const checkout = new shopify.rest.Checkout({session: session}); checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; @@ -189,17 +189,17 @@ describe('Checkout resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"shipping_rates": []})); + queueMockResponse(JSON.stringify({"shipping_rates": [{"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "checkout": {"total_tax": "0.00", "total_price": "398.00", "subtotal_price": "398.00"}, "phone_required": false, "delivery_range": null, "estimated_time_in_transit": null, "handle": "shopify-Free%20Shipping-0.00"}]})); await shopify.rest.Checkout.shipping_rates({ session: session, - token: "zs9ru89kuqcdagk8bz4r9hnxt22wwd42", + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/checkouts/zs9ru89kuqcdagk8bz4r9hnxt22wwd42/shipping_rates.json', + path: '/admin/api/2022-10/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', query: '', headers, data: undefined @@ -225,17 +225,17 @@ describe('Checkout resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"shipping_rates": [{"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "checkout": {"total_tax": "0.00", "total_price": "398.00", "subtotal_price": "398.00"}, "phone_required": false, "delivery_range": null, "estimated_time_in_transit": null, "handle": "shopify-Free%20Shipping-0.00"}]})); + queueMockResponse(JSON.stringify({"shipping_rates": []})); await shopify.rest.Checkout.shipping_rates({ session: session, - token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + token: "zs9ru89kuqcdagk8bz4r9hnxt22wwd42", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', + path: '/admin/api/2022-10/checkouts/zs9ru89kuqcdagk8bz4r9hnxt22wwd42/shipping_rates.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/collect.test.ts b/rest/admin/__tests__/2022-10/collect.test.ts index cdc53e12b..9325199d7 100644 --- a/rest/admin/__tests__/2022-10/collect.test.ts +++ b/rest/admin/__tests__/2022-10/collect.test.ts @@ -31,7 +31,7 @@ describe('Collect resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"collect": {"id": 1071559580, "collection_id": 841564295, "product_id": 921728736, "created_at": "2022-10-03T13:19:30-04:00", "updated_at": "2022-10-03T13:19:30-04:00", "position": 2, "sort_value": "0000000002"}})); + queueMockResponse(JSON.stringify({"collect": {"id": 1071559576, "collection_id": 841564295, "product_id": 921728736, "created_at": "2023-01-03T12:45:21-05:00", "updated_at": "2023-01-03T12:45:21-05:00", "position": 2, "sort_value": "0000000002"}})); const collect = new shopify.rest.Collect({session: session}); collect.product_id = 921728736; @@ -49,17 +49,16 @@ describe('Collect resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 800915878, "collection_id": 482865238, "product_id": 921728736, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); - await shopify.rest.Collect.delete({ + await shopify.rest.Collect.all({ session: session, - id: 455204334, }); expect({ - method: 'DELETE', + method: 'GET', domain, - path: '/admin/api/2022-10/collects/455204334.json', + path: '/admin/api/2022-10/collects.json', query: '', headers, data: undefined @@ -67,18 +66,18 @@ describe('Collect resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"collect": {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}})); + queueMockResponse(JSON.stringify({"collects": [{"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 1071559574, "collection_id": 841564295, "product_id": 921728736, "created_at": "2023-01-03T12:45:12-05:00", "updated_at": "2023-01-03T12:45:12-05:00", "position": 2, "sort_value": "0000000002"}]})); - await shopify.rest.Collect.find({ + await shopify.rest.Collect.all({ session: session, - id: 455204334, + collection_id: "841564295", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/collects/455204334.json', - query: '', + path: '/admin/api/2022-10/collects.json', + query: 'collection_id=841564295', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -103,16 +102,17 @@ describe('Collect resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 800915878, "collection_id": 482865238, "product_id": 921728736, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); + queueMockResponse(JSON.stringify({})); - await shopify.rest.Collect.all({ + await shopify.rest.Collect.delete({ session: session, + id: 455204334, }); expect({ - method: 'GET', + method: 'DELETE', domain, - path: '/admin/api/2022-10/collects.json', + path: '/admin/api/2022-10/collects/455204334.json', query: '', headers, data: undefined @@ -120,54 +120,53 @@ describe('Collect resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"collects": [{"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 1071559581, "collection_id": 841564295, "product_id": 921728736, "created_at": "2022-10-03T13:19:33-04:00", "updated_at": "2022-10-03T13:19:33-04:00", "position": 2, "sort_value": "0000000002"}]})); + queueMockResponse(JSON.stringify({"collect": {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}})); - await shopify.rest.Collect.all({ + await shopify.rest.Collect.find({ session: session, - collection_id: "841564295", + id: 455204334, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/collects.json', - query: 'collection_id=841564295', + path: '/admin/api/2022-10/collects/455204334.json', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"count": 2})); await shopify.rest.Collect.count({ session: session, - collection_id: "841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/collects/count.json', - query: 'collection_id=841564295', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"count": 2})); + queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Collect.count({ session: session, - product_id: "632910392", + collection_id: "841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/collects/count.json', - query: 'product_id=632910392', + query: 'collection_id=841564295', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -178,13 +177,14 @@ describe('Collect resource', () => { await shopify.rest.Collect.count({ session: session, + product_id: "632910392", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/collects/count.json', - query: '', + query: 'product_id=632910392', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-10/collection.test.ts b/rest/admin/__tests__/2022-10/collection.test.ts index 85b480d0e..d0fff72e7 100644 --- a/rest/admin/__tests__/2022-10/collection.test.ts +++ b/rest/admin/__tests__/2022-10/collection.test.ts @@ -31,7 +31,7 @@ describe('Collection resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "collection_type": "custom", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "collection_type": "custom", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); await shopify.rest.Collection.find({ session: session, @@ -49,7 +49,7 @@ describe('Collection resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-10-03T12:15:55-04:00", "handle": "ipod-nano", "updated_at": "2022-10-03T12:15:55-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:21:36-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:21:36-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); await shopify.rest.Collection.products({ session: session, diff --git a/rest/admin/__tests__/2022-10/collection_listing.test.ts b/rest/admin/__tests__/2022-10/collection_listing.test.ts index 88cbe79cc..6b5bf94f5 100644 --- a/rest/admin/__tests__/2022-10/collection_listing.test.ts +++ b/rest/admin/__tests__/2022-10/collection_listing.test.ts @@ -31,7 +31,7 @@ describe('CollectionListing resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"collection_listings": [{"collection_id": 482865238, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 841564295, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "IPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 395646240, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever. Again

", "default_product_image": {"id": 850703190, "created_at": "2022-10-03T13:07:13-04:00", "position": 1, "updated_at": "2022-10-03T13:07:13-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664816833", "variant_ids": [], "width": 123, "height": 456}, "handle": "ipods_two", "image": null, "title": "IPods Two", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 691652237, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

No ipods here

", "default_product_image": null, "handle": "non-ipods", "image": null, "title": "Non Ipods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}]})); + queueMockResponse(JSON.stringify({"collection_listings": [{"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 841564295, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "IPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 395646240, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever. Again

", "default_product_image": {"id": 850703190, "created_at": "2023-01-03T12:56:35-05:00", "position": 1, "updated_at": "2023-01-03T12:56:35-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "width": 123, "height": 456}, "handle": "ipods_two", "image": null, "title": "IPods Two", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 691652237, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

No ipods here

", "default_product_image": null, "handle": "non-ipods", "image": null, "title": "Non Ipods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}]})); await shopify.rest.CollectionListing.all({ session: session, @@ -66,7 +66,7 @@ describe('CollectionListing resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); await shopify.rest.CollectionListing.find({ session: session, @@ -84,7 +84,7 @@ describe('CollectionListing resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2022-10-03T13:07:13-04:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2022-10-03T13:07:13-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); const collection_listing = new shopify.rest.CollectionListing({session: session}); collection_listing.collection_id = 482865238; diff --git a/rest/admin/__tests__/2022-10/comment.test.ts b/rest/admin/__tests__/2022-10/comment.test.ts index deb8eb592..e85b98d82 100644 --- a/rest/admin/__tests__/2022-10/comment.test.ts +++ b/rest/admin/__tests__/2022-10/comment.test.ts @@ -31,43 +31,44 @@ describe('Comment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, - article_id: "134645308", - blog_id: "241253187", + since_id: "118373535", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/comments.json', - query: 'article_id=134645308&blog_id=241253187', + query: 'since_id=118373535', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, + article_id: "134645308", + blog_id: "241253187", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/comments.json', - query: '', + query: 'article_id=134645308&blog_id=241253187', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, @@ -85,18 +86,17 @@ describe('Comment resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); await shopify.rest.Comment.all({ session: session, - since_id: "118373535", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/comments.json', - query: 'since_id=118373535', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -157,7 +157,7 @@ describe('Comment resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"comment": {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}})); + queueMockResponse(JSON.stringify({"comment": {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}})); await shopify.rest.Comment.find({ session: session, @@ -175,14 +175,14 @@ describe('Comment resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"comment": {"author": "Your new name", "body": "You can even update through a web service.", "email": "your@updated-email.com", "published_at": "2022-10-03T13:05:08-04:00", "id": 118373535, "body_html": "

You can even update through a web service.

", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:08-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"}})); + queueMockResponse(JSON.stringify({"comment": {"author": "Your new name", "body": "You can even update through a web service.", "email": "your@updated-email.com", "published_at": "2023-01-03T12:06:05-05:00", "id": 118373535, "body_html": "

You can even update through a web service.

", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:06-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"}})); const comment = new shopify.rest.Comment({session: session}); comment.id = 118373535; comment.body = "You can even update through a web service."; comment.author = "Your new name"; comment.email = "your@updated-email.com"; - comment.published_at = "2022-10-03T17:05:08.150Z"; + comment.published_at = "2023-01-03T17:06:05.929Z"; await comment.save({}); expect({ @@ -191,12 +191,12 @@ describe('Comment resource', () => { path: '/admin/api/2022-10/comments/118373535.json', query: '', headers, - data: { "comment": {"body": "You can even update through a web service.", "author": "Your new name", "email": "your@updated-email.com", "published_at": "2022-10-03T17:05:08.150Z"} } + data: { "comment": {"body": "You can even update through a web service.", "author": "Your new name", "email": "your@updated-email.com", "published_at": "2023-01-03T17:06:05.929Z"} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"comment": {"id": 757536352, "body": "I like comments\nAnd I like posting them *RESTfully*.", "body_html": "

I like comments
\nAnd I like posting them RESTfully.

", "author": "Your name", "email": "your@email.com", "status": "pending", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T13:05:29-04:00", "updated_at": "2022-10-03T13:05:29-04:00", "ip": "107.20.160.121", "user_agent": null, "published_at": null}})); + queueMockResponse(JSON.stringify({"comment": {"id": 757536352, "body": "I like comments\nAnd I like posting them *RESTfully*.", "body_html": "

I like comments
\nAnd I like posting them RESTfully.

", "author": "Your name", "email": "your@email.com", "status": "pending", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:06:09-05:00", "updated_at": "2023-01-03T12:06:09-05:00", "ip": "107.20.160.121", "user_agent": null, "published_at": null}})); const comment = new shopify.rest.Comment({session: session}); comment.body = "I like comments\nAnd I like posting them *RESTfully*."; @@ -218,7 +218,7 @@ describe('Comment resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"published_at": null, "status": "spam", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:02-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": null, "status": "spam", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:59-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -235,7 +235,7 @@ describe('Comment resource', () => { }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"published_at": "2022-10-03T13:05:06-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:06-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:06:19-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:19-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -252,7 +252,7 @@ describe('Comment resource', () => { }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"published_at": "2022-10-03T13:05:53-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:53-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:06:30-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:30-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -269,7 +269,7 @@ describe('Comment resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"published_at": null, "status": "removed", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:04-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": null, "status": "removed", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:12-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; @@ -286,7 +286,7 @@ describe('Comment resource', () => { }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"published_at": "2022-10-03T13:05:15-04:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:05:15-04:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:05:56-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:56-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); const comment = new shopify.rest.Comment({session: session}); comment.id = 653537639; diff --git a/rest/admin/__tests__/2022-10/country.test.ts b/rest/admin/__tests__/2022-10/country.test.ts index b8e433896..705e60656 100644 --- a/rest/admin/__tests__/2022-10/country.test.ts +++ b/rest/admin/__tests__/2022-10/country.test.ts @@ -31,41 +31,76 @@ describe('Country resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"countries": [{"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}, {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}]})); + queueMockResponse(JSON.stringify({"countries": [{"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}, {"id": 359115488, "name": "Colombia", "code": "CO", "tax_name": "VAT", "tax": 0.15, "provinces": []}, {"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}]})); await shopify.rest.Country.all({ session: session, - since_id: "359115488", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/countries.json', - query: 'since_id=359115488', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"countries": [{"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}, {"id": 359115488, "name": "Colombia", "code": "CO", "tax_name": "VAT", "tax": 0.15, "provinces": []}, {"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}]})); + queueMockResponse(JSON.stringify({"countries": [{"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}, {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}]})); await shopify.rest.Country.all({ session: session, + since_id: "359115488", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/countries.json', - query: '', + query: 'since_id=359115488', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 1070231511, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/countries.json', + query: '', + headers, + data: { "country": {"code": "FR"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 1070231510, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + country.tax = 0.2; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/countries.json', + query: '', + headers, + data: { "country": {"code": "FR", "tax": 0.2} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.Country.count({ @@ -82,7 +117,7 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_4', async () => { + it('test_6', async () => { queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); await shopify.rest.Country.find({ @@ -100,7 +135,7 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { + it('test_7', async () => { queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"country_id": 879921427, "tax_name": "Tax", "id": 205434194, "name": "Alberta", "code": "AB", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 170405627, "name": "British Columbia", "code": "BC", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 342345110, "name": "Manitoba", "code": "MB", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 92264567, "name": "New Brunswick", "code": "NB", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 243284171, "name": "Newfoundland", "code": "NL", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 439598329, "name": "Northwest Territories", "code": "NT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 448070559, "name": "Nova Scotia", "code": "NS", "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 670206421, "name": "Nunavut", "code": "NU", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 702530425, "name": "Ontario", "code": "ON", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 570891722, "name": "Prince Edward Island", "code": "PE", "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 473391800, "name": "Saskatchewan", "code": "SK", "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 1005264686, "name": "Yukon", "code": "YT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); const country = new shopify.rest.Country({session: session}); @@ -118,7 +153,7 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { + it('test_8', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Country.delete({ @@ -136,39 +171,4 @@ describe('Country resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { - queueMockResponse(JSON.stringify({"country": {"id": 1070231510, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); - - const country = new shopify.rest.Country({session: session}); - country.code = "FR"; - await country.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-10/countries.json', - query: '', - headers, - data: { "country": {"code": "FR"} } - }).toMatchMadeHttpRequest(); - }); - - it('test_8', async () => { - queueMockResponse(JSON.stringify({"country": {"id": 1070231511, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); - - const country = new shopify.rest.Country({session: session}); - country.code = "FR"; - country.tax = 0.2; - await country.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-10/countries.json', - query: '', - headers, - data: { "country": {"code": "FR", "tax": 0.2} } - }).toMatchMadeHttpRequest(); - }); - }); diff --git a/rest/admin/__tests__/2022-10/custom_collection.test.ts b/rest/admin/__tests__/2022-10/custom_collection.test.ts index 484292b42..3a99f014a 100644 --- a/rest/admin/__tests__/2022-10/custom_collection.test.ts +++ b/rest/admin/__tests__/2022-10/custom_collection.test.ts @@ -31,238 +31,253 @@ describe('CustomCollection resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); await shopify.rest.CustomCollection.all({ session: session, + ids: "395646240,691652237,841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/custom_collections.json', - query: '', + query: 'ids=395646240%2C691652237%2C841564295', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); await shopify.rest.CustomCollection.all({ session: session, - ids: "395646240,691652237,841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/custom_collections.json', - query: 'ids=395646240%2C691652237%2C841564295', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 1063001346, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:05:21-05:00", "body_html": null, "published_at": "2023-01-03T13:05:21-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001346"}]})); await shopify.rest.CustomCollection.all({ session: session, - product_id: "632910392", + since_id: "841564295", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/custom_collections.json', - query: 'product_id=632910392', + query: 'since_id=841564295', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"custom_collections": [{"id": 1063001328, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:24:03-04:00", "body_html": null, "published_at": "2022-10-03T12:24:03-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001328"}]})); + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}]})); await shopify.rest.CustomCollection.all({ session: session, - since_id: "841564295", + product_id: "632910392", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/custom_collections.json', - query: 'since_id=841564295', + query: 'product_id=632910392', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001313, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:10-04:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001313"}})); + queueMockResponse(JSON.stringify({"count": 3})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; - custom_collection.published = false; - await custom_collection.save({}); + await shopify.rest.CustomCollection.count({ + session: session, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/custom_collections.json', + path: '/admin/api/2022-10/custom_collections/count.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks", "published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001315, "handle": "ipods-1", "title": "IPods", "updated_at": "2022-10-03T12:23:13-04:00", "body_html": null, "published_at": "2022-10-03T12:23:13-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001315"}})); + queueMockResponse(JSON.stringify({"count": 2})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "IPods"; - custom_collection.collects = [ - { - "product_id": 921728736 - } - ]; - await custom_collection.save({}); + await shopify.rest.CustomCollection.count({ + session: session, + product_id: "632910392", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/custom_collections.json', - query: '', + path: '/admin/api/2022-10/custom_collections/count.json', + query: 'product_id=632910392', headers, - data: { "custom_collection": {"title": "IPods", "collects": [{"product_id": 921728736}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001319, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:29-04:00", "body_html": null, "published_at": "2022-10-03T12:23:29-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001319"}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; - custom_collection.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; - await custom_collection.save({}); + await shopify.rest.CustomCollection.find({ + session: session, + id: 841564295, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/custom_collections.json', + path: '/admin/api/2022-10/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001322, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:35-04:00", "body_html": null, "published_at": "2022-10-03T12:23:34-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001322", "image": {"created_at": "2022-10-03T12:23:34-04:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-gz22my.gif?v=1664814215"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2023-01-03T13:03:58-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; - custom_collection.image = { - "src": "http://example.com/rails_logo.gif", - "alt": "Rails Logo" - }; + custom_collection.id = 841564295; + custom_collection.collects = [ + { + "product_id": 921728736, + "position": 1 + }, + { + "id": 455204334, + "position": 2 + } + ]; await custom_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/custom_collections.json', + path: '/admin/api/2022-10/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + data: { "custom_collection": {"collects": [{"product_id": 921728736, "position": 1}, {"id": 455204334, "position": 2}]} } }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001324, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T12:23:44-04:00", "body_html": null, "published_at": "2022-10-03T12:23:44-04:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001324"}})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2023-01-03T13:04:15-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.title = "Macbooks"; + custom_collection.id = 841564295; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await custom_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/custom_collections.json', + path: '/admin/api/2022-10/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"title": "Macbooks"} } + data: { "custom_collection": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"count": 2})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": null, "updated_at": "2023-01-03T13:05:26-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); - await shopify.rest.CustomCollection.count({ - session: session, - product_id: "632910392", - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = false; + await custom_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-10/custom_collections/count.json', - query: 'product_id=632910392', + path: '/admin/api/2022-10/custom_collections/841564295.json', + query: '', headers, - data: undefined + data: { "custom_collection": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"count": 3})); + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": "2023-01-03T13:05:05-05:00", "updated_at": "2023-01-03T13:05:05-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); - await shopify.rest.CustomCollection.count({ - session: session, - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = true; + await custom_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-10/custom_collections/count.json', + path: '/admin/api/2022-10/custom_collections/841564295.json', query: '', headers, - data: undefined + data: { "custom_collection": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

The best selling ipod ever

", "handle": "ipods", "updated_at": "2023-01-03T13:04:49-05:00", "id": 841564295, "sort_order": "manual", "title": "IPods", "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"}})); - await shopify.rest.CustomCollection.find({ - session: session, - id: 841564295, - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.image = ""; + custom_collection.updated_at = "2023-01-03T13:04:48-05:00"; + custom_collection.title = "IPods"; + custom_collection.handle = "ipods"; + custom_collection.body_html = "

The best selling ipod ever

"; + custom_collection.published_at = "2008-02-01T19:00:00-05:00"; + custom_collection.sort_order = "manual"; + custom_collection.template_suffix = null; + custom_collection.published_scope = "web"; + custom_collection.admin_graphql_api_id = "gid://shopify/Collection/841564295"; + await custom_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-10/custom_collections/841564295.json', query: '', headers, - data: undefined + data: { "custom_collection": {"image": "", "updated_at": "2023-01-03T13:04:48-05:00", "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

5000 songs in your pocket

", "title": "IPods", "handle": "ipods", "id": 841564295, "updated_at": "2022-10-03T12:22:50-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2023-01-03T13:05:34-05:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T13:05:34-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672769134"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); custom_collection.id = 841564295; - custom_collection.body_html = "

5000 songs in your pocket

"; + custom_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1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+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; await custom_collection.save({}); expect({ @@ -271,17 +286,16 @@ describe('CustomCollection resource', () => { path: '/admin/api/2022-10/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"body_html": "

5000 songs in your pocket

"} } + data: { "custom_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9G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5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2022-10-03T12:23:02-04:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:23:02-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1664814182"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2023-01-03T13:04:34-05:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"alt": "Rails logo", "created_at": "2023-01-03T13:04:32-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-s0af8s.gif?v=1672769074"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); custom_collection.id = 841564295; custom_collection.image = { - "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4X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sy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo" }; await custom_collection.save({}); @@ -292,25 +306,16 @@ describe('CustomCollection resource', () => { path: '/admin/api/2022-10/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV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nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } + data: { "custom_collection": {"image": {"alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2022-10-03T12:23:04-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

5000 songs in your pocket

", "title": "IPods", "handle": "ipods", "id": 841564295, "updated_at": "2023-01-03T13:04:37-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); custom_collection.id = 841564295; - custom_collection.collects = [ - { - "product_id": 921728736, - "position": 1 - }, - { - "id": 455204334, - "position": 2 - } - ]; + custom_collection.body_html = "

5000 songs in your pocket

"; await custom_collection.save({}); expect({ @@ -319,133 +324,128 @@ describe('CustomCollection resource', () => { path: '/admin/api/2022-10/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"collects": [{"product_id": 921728736, "position": 1}, {"id": 455204334, "position": 2}]} } + data: { "custom_collection": {"body_html": "

5000 songs in your pocket

"} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": null, "updated_at": "2022-10-03T12:23:23-04:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({})); - const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.published = false; - await custom_collection.save({}); + await shopify.rest.CustomCollection.delete({ + session: session, + id: 841564295, + }); expect({ - method: 'PUT', + method: 'DELETE', domain, path: '/admin/api/2022-10/custom_collections/841564295.json', query: '', headers, - data: { "custom_collection": {"published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": "2022-10-03T12:23:50-04:00", "updated_at": "2022-10-03T12:23:50-04:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001333, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T13:04:13-05:00", "body_html": null, "published_at": "2023-01-03T13:04:13-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001333"}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.published = true; + custom_collection.title = "IPods"; + custom_collection.collects = [ + { + "product_id": 921728736 + } + ]; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/custom_collections/841564295.json', + path: '/admin/api/2022-10/custom_collections.json', query: '', headers, - data: { "custom_collection": {"published": true} } + data: { "custom_collection": {"title": "IPods", "collects": [{"product_id": 921728736}]} } }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

The best selling ipod ever

", "handle": "ipods", "updated_at": "2022-10-03T12:23:53-04:00", "id": 841564295, "sort_order": "manual", "title": "IPods", "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001341, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:53-05:00", "body_html": null, "published_at": "2023-01-03T13:04:53-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001341"}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.image = ""; - custom_collection.updated_at = "2022-10-03T12:23:53-04:00"; - custom_collection.title = "IPods"; - custom_collection.handle = "ipods"; - custom_collection.body_html = "

The best selling ipod ever

"; - custom_collection.published_at = "2008-02-01T19:00:00-05:00"; - custom_collection.sort_order = "manual"; - custom_collection.template_suffix = null; - custom_collection.published_scope = "web"; - custom_collection.admin_graphql_api_id = "gid://shopify/Collection/841564295"; + custom_collection.title = "Macbooks"; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/custom_collections/841564295.json', + path: '/admin/api/2022-10/custom_collections.json', query: '', headers, - data: { "custom_collection": {"image": "", "updated_at": "2022-10-03T12:23:53-04:00", "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"} } + data: { "custom_collection": {"title": "Macbooks"} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2022-10-03T12:23:56-04:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"alt": "Rails logo", "created_at": "2022-10-03T12:23:55-04:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-72b9ne.gif?v=1664814236"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001342, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:58-05:00", "body_html": null, "published_at": "2023-01-03T13:04:58-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001342"}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.image = { - "alt": "Rails logo" - }; + custom_collection.title = "Macbooks"; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/custom_collections/841564295.json', + path: '/admin/api/2022-10/custom_collections.json', query: '', headers, - data: { "custom_collection": {"image": {"alt": "Rails logo"}} } + data: { "custom_collection": {"title": "Macbooks", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2022-10-03T12:24:10-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2022-10-03T12:15:55-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664813755"}}})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001339, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:40-05:00", "body_html": null, "published_at": "2023-01-03T13:04:39-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001339", "image": {"created_at": "2023-01-03T13:04:39-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-c6wrde.gif?v=1672769080"}}})); const custom_collection = new shopify.rest.CustomCollection({session: session}); - custom_collection.id = 841564295; - custom_collection.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + custom_collection.title = "Macbooks"; + custom_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; await custom_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/custom_collections/841564295.json', + path: '/admin/api/2022-10/custom_collections.json', query: '', headers, - data: { "custom_collection": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "custom_collection": {"title": "Macbooks", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001337, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:24-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001337"}})); - await shopify.rest.CustomCollection.delete({ - session: session, - id: 841564295, - }); + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + custom_collection.published = false; + await custom_collection.save({}); expect({ - method: 'DELETE', + method: 'POST', domain, - path: '/admin/api/2022-10/custom_collections/841564295.json', + path: '/admin/api/2022-10/custom_collections.json', query: '', headers, - data: undefined + data: { "custom_collection": {"title": "Macbooks", "published": false} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/customer.test.ts b/rest/admin/__tests__/2022-10/customer.test.ts index cfbba64ea..8d150ab97 100644 --- a/rest/admin/__tests__/2022-10/customer.test.ts +++ b/rest/admin/__tests__/2022-10/customer.test.ts @@ -31,25 +31,25 @@ describe('Customer resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339464, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:26:08-05:00", "updated_at": "2022-11-09T10:26:08-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:26:08-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339464", "default_address": {"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:25:55-05:00", "updated_at": "2022-11-09T10:25:55-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339469, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:43-05:00", "updated_at": "2023-01-03T12:19:43-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317299, "customer_id": 1073339469, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:19:43-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339469", "default_address": {"id": 1053317299, "customer_id": 1073339469, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:30-05:00", "updated_at": "2023-01-03T12:19:30-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.all({ session: session, - ids: "207119551,1073339464", + ids: "207119551,1073339469", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/customers.json', - query: 'ids=207119551%2C1073339464', + query: 'ids=207119551%2C1073339469', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339466, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:28:04-05:00", "updated_at": "2022-11-09T10:28:04-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317296, "customer_id": 1073339466, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:28:04-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339466", "default_address": {"id": 1053317296, "customer_id": 1073339466, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339458, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:08:39-05:00", "updated_at": "2023-01-03T12:08:39-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:39-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339458", "default_address": {"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}]})); await shopify.rest.Customer.all({ session: session, @@ -67,25 +67,25 @@ describe('Customer resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:23:30-05:00", "updated_at": "2022-11-09T10:23:30-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:12:39-05:00", "updated_at": "2023-01-03T12:12:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.all({ session: session, - updated_at_min: "2022-11-08 15:23:42", + updated_at_min: "2023-01-02 17:12:54", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/customers.json', - query: 'updated_at_min=2022-11-08+15%3A23%3A42', + query: 'updated_at_min=2023-01-02+17%3A12%3A54', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:28:39-05:00", "updated_at": "2022-11-09T10:28:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:09-05:00", "updated_at": "2023-01-03T12:15:09-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.all({ session: session, @@ -120,7 +120,7 @@ describe('Customer resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:21:20-05:00", "updated_at": "2022-11-09T10:21:20-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:13:43-05:00", "updated_at": "2023-01-03T12:13:43-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.search({ session: session, @@ -157,7 +157,7 @@ describe('Customer resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339472, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "tags": "New Customer"}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339466, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "tags": "New Customer"}]})); await shopify.rest.Customer.search({ session: session, @@ -176,7 +176,7 @@ describe('Customer resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:22:34-05:00", "updated_at": "2022-11-09T10:22:34-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:07:03-05:00", "updated_at": "2023-01-03T12:07:03-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.search({ session: session, @@ -194,7 +194,7 @@ describe('Customer resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:33:01-05:00", "updated_at": "2022-11-09T10:33:01-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:16:11-05:00", "updated_at": "2023-01-03T12:16:11-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.Customer.search({ session: session, @@ -212,7 +212,7 @@ describe('Customer resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 1073339461, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "verified_email": true}, {"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "verified_email": true}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339460, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "verified_email": true}, {"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "verified_email": true}]})); await shopify.rest.Customer.search({ session: session, @@ -231,7 +231,7 @@ describe('Customer resource', () => { }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:27:08-05:00", "updated_at": "2022-11-09T10:27:08-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:27:08-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:39-05:00", "updated_at": "2023-01-03T12:15:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:15:39-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); await shopify.rest.Customer.find({ session: session, @@ -249,7 +249,7 @@ describe('Customer resource', () => { }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2022-11-09T10:22:49-05:00", "updated_at": "2022-11-09T10:23:03-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:22:49-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2023-01-03T12:18:42-05:00", "updated_at": "2023-01-03T12:18:59-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:18:42-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -274,12 +274,12 @@ describe('Customer resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2022-11-09T10:26:55-05:00", "updated_at": "2022-11-09T10:27:07-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-11-06T10:27:06-05:00", "marketing_opt_in_level": "confirmed_opt_in", "tax_exemptions": [], "email_marketing_consent": {"state": "subscribed", "opt_in_level": "confirmed_opt_in", "consent_updated_at": "2022-11-06T10:27:06-05:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:26:55-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2023-01-03T12:07:21-05:00", "updated_at": "2023-01-03T12:07:37-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-12-31T12:07:36-05:00", "marketing_opt_in_level": "confirmed_opt_in", "tax_exemptions": [], "email_marketing_consent": {"state": "subscribed", "opt_in_level": "confirmed_opt_in", "consent_updated_at": "2022-12-31T12:07:36-05:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:07:21-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; customer.accepts_marketing = true; - customer.accepts_marketing_updated_at = "2022-11-06T10:27:06-05:00"; + customer.accepts_marketing_updated_at = "2022-12-31T12:07:36-05:00"; customer.marketing_opt_in_level = "confirmed_opt_in"; await customer.save({}); @@ -289,12 +289,12 @@ describe('Customer resource', () => { path: '/admin/api/2022-10/customers/207119551.json', query: '', headers, - data: { "customer": {"accepts_marketing": true, "accepts_marketing_updated_at": "2022-11-06T10:27:06-05:00", "marketing_opt_in_level": "confirmed_opt_in"} } + data: { "customer": {"accepts_marketing": true, "accepts_marketing_updated_at": "2022-12-31T12:07:36-05:00", "marketing_opt_in_level": "confirmed_opt_in"} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2022-11-09T10:27:36-05:00", "updated_at": "2022-11-09T10:27:51-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "New Customer, Repeat Customer", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:27:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2023-01-03T12:07:37-05:00", "updated_at": "2023-01-03T12:07:53-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "New Customer, Repeat Customer", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:07:37-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -312,7 +312,7 @@ describe('Customer resource', () => { }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "changed@email.address.com", "note": "Customer is a great guy", "first_name": "Bob", "last_name": "Norman", "accepts_marketing": false, "created_at": "2022-11-09T10:20:18-05:00", "updated_at": "2022-11-09T10:20:33-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:20:33-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:20:18-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "changed@email.address.com", "updated_at": "2023-01-03T12:08:55-05:00", "note": "Customer is a great guy", "first_name": "Bob", "last_name": "Norman", "accepts_marketing": false, "created_at": "2023-01-03T12:08:41-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:55-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:08:41-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -349,7 +349,7 @@ describe('Customer resource', () => { }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 1073339463, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:25:39-05:00", "updated_at": "2022-11-09T10:25:40-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "enabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317293, "customer_id": 1073339463, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:25:40-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339463", "default_address": {"id": 1053317293, "customer_id": 1073339463, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339456, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:08:09-05:00", "updated_at": "2023-01-03T12:08:10-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "enabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317286, "customer_id": 1073339456, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:10-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317286, "customer_id": 1073339456, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -385,7 +385,7 @@ describe('Customer resource', () => { }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 1073339460, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:22:04-05:00", "updated_at": "2022-11-09T10:22:04-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317290, "customer_id": 1073339460, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:22:04-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339460", "default_address": {"id": 1053317290, "customer_id": 1073339460, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339468, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:30-05:00", "updated_at": "2023-01-03T12:19:30-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317298, "customer_id": 1073339468, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:19:30-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339468", "default_address": {"id": 1053317298, "customer_id": 1073339468, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -419,7 +419,7 @@ describe('Customer resource', () => { }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"customer": {"updated_at": "2022-11-09T10:21:50-05:00", "id": 1073339459, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:21:50-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317289, "customer_id": 1073339459, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:21:50-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339459", "default_address": {"id": 1053317289, "customer_id": 1073339459, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339465, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:16:40-05:00", "updated_at": "2023-01-03T12:16:40-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317295, "customer_id": 1073339465, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:16:40-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339465", "default_address": {"id": 1053317295, "customer_id": 1073339465, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -460,7 +460,7 @@ describe('Customer resource', () => { }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"customer": {"id": 1073339470, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:31:30-05:00", "updated_at": "2022-11-09T10:31:30-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317300, "customer_id": 1073339470, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2022-11-09T10:31:30-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339470", "default_address": {"id": 1053317300, "customer_id": 1073339470, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + queueMockResponse(JSON.stringify({"customer": {"id": 1073339464, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:39-05:00", "updated_at": "2023-01-03T12:15:39-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:15:39-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339464", "default_address": {"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); const customer = new shopify.rest.Customer({session: session}); customer.first_name = "Steve"; @@ -493,7 +493,7 @@ describe('Customer resource', () => { }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"account_activation_url": "https://jsmith.myshopify.com/account/activate/207119551/63c979bd73389d3b3496db03cea13266-1668007656"})); + queueMockResponse(JSON.stringify({"account_activation_url": "https://jsmith.myshopify.com/account/activate/207119551/75ed95bcf5876b0bac5bb06e1244ccea-1672766051"})); const customer = new shopify.rest.Customer({session: session}); customer.id = 207119551; @@ -569,14 +569,14 @@ describe('Customer resource', () => { await shopify.rest.Customer.count({ session: session, - updated_at_min: "2022-11-08 15:33:44", + updated_at_min: "2023-01-02 17:10:34", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/customers/count.json', - query: 'updated_at_min=2022-11-08+15%3A33%3A44', + query: 'updated_at_min=2023-01-02+17%3A10%3A34', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -587,21 +587,21 @@ describe('Customer resource', () => { await shopify.rest.Customer.count({ session: session, - created_at_min: "2022-11-08 15:33:29", + created_at_min: "2023-01-02 17:21:35", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/customers/count.json', - query: 'created_at_min=2022-11-08+15%3A33%3A29', + query: 'created_at_min=2023-01-02+17%3A21%3A35', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_28', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:28:21-05:00", "updated_at": "2022-11-09T10:28:21-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:28:21-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-09T10:28:21-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-09T10:28:21-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-09T10:28:21-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-09T10:28:21-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "c901414060.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:17:39-05:00", "updated_at": "2023-01-03T12:17:39-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:17:39-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:17:39-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:17:39-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:17:39-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:17:39-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Customer.orders({ session: session, @@ -619,7 +619,7 @@ describe('Customer resource', () => { }); it('test_29', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-09T10:32:16-05:00", "updated_at": "2022-11-09T10:32:16-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-09T10:32:16-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-09T10:32:16-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-09T10:32:16-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-09T10:32:16-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-09T10:32:16-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "c901414060.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:13:09-05:00", "updated_at": "2023-01-03T12:13:09-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:13:09-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:13:09-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:13:09-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:13:09-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:13:09-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Customer.orders({ session: session, diff --git a/rest/admin/__tests__/2022-10/customer_address.test.ts b/rest/admin/__tests__/2022-10/customer_address.test.ts index 8db61dbae..b29a83efe 100644 --- a/rest/admin/__tests__/2022-10/customer_address.test.ts +++ b/rest/admin/__tests__/2022-10/customer_address.test.ts @@ -131,13 +131,13 @@ describe('CustomerAddress resource', () => { await shopify.rest.CustomerAddress.delete({ session: session, customer_id: 207119551, - id: 1053317288, + id: 1053317306, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/customers/207119551/addresses/1053317288.json', + path: '/admin/api/2022-10/customers/207119551/addresses/1053317306.json', query: '', headers, data: undefined @@ -145,7 +145,7 @@ describe('CustomerAddress resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317286, "customer_id": 207119551, "first_name": "Samuel", "last_name": "de Champlain", "company": "Fancy Co.", "address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "phone": "819-555-5555", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada", "default": false}})); + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317303, "customer_id": 207119551, "first_name": "Samuel", "last_name": "de Champlain", "company": "Fancy Co.", "address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "phone": "819-555-5555", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada", "default": false}})); const customer_address = new shopify.rest.CustomerAddress({session: session}); customer_address.customer_id = 207119551; @@ -181,7 +181,7 @@ describe('CustomerAddress resource', () => { const customer_address = new shopify.rest.CustomerAddress({session: session}); customer_address.customer_id = 207119551; await customer_address.set({ - address_ids: ["1053317287"], + address_ids: ["1053317305"], operation: "destroy", }); @@ -189,24 +189,24 @@ describe('CustomerAddress resource', () => { method: 'PUT', domain, path: '/admin/api/2022-10/customers/207119551/addresses/set.json', - query: 'address_ids%5B%5D=1053317287&operation=destroy', + query: 'address_ids%5B%5D=1053317305&operation=destroy', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317289, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317304, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); const customer_address = new shopify.rest.CustomerAddress({session: session}); customer_address.customer_id = 207119551; - customer_address.id = 1053317289; + customer_address.id = 1053317304; await customer_address.default({}); expect({ method: 'PUT', domain, - path: '/admin/api/2022-10/customers/207119551/addresses/1053317289/default.json', + path: '/admin/api/2022-10/customers/207119551/addresses/1053317304/default.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/customer_saved_search.test.ts b/rest/admin/__tests__/2022-10/customer_saved_search.test.ts index a65566169..3f0e6a69e 100644 --- a/rest/admin/__tests__/2022-10/customer_saved_search.test.ts +++ b/rest/admin/__tests__/2022-10/customer_saved_search.test.ts @@ -31,7 +31,7 @@ describe('CustomerSavedSearch resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "accepts_marketing:1"}, {"id": 20610973, "name": "Canadian Snowboarders", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "country:Canada"}, {"id": 669439218, "name": "Premier Customers", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}]})); + queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}, {"id": 20610973, "name": "Canadian Snowboarders", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "country:Canada"}, {"id": 669439218, "name": "Premier Customers", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}]})); await shopify.rest.CustomerSavedSearch.all({ session: session, @@ -48,7 +48,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 669439218, "name": "Premier Customers", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}, {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "accepts_marketing:1"}]})); + queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 669439218, "name": "Premier Customers", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}, {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}]})); await shopify.rest.CustomerSavedSearch.all({ session: session, @@ -66,7 +66,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136102, "name": "Spent more than $50", "created_at": "2022-10-31T10:33:27-04:00", "updated_at": "2022-10-31T10:33:27-04:00", "query": "total_spent:>50"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136102, "name": "Spent more than $50", "created_at": "2023-01-03T13:07:07-05:00", "updated_at": "2023-01-03T13:07:07-05:00", "query": "total_spent:>50"}})); const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); customer_saved_search.name = "Spent more than $50"; @@ -84,7 +84,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136103, "name": "Spent more than $50 and after 2013", "created_at": "2022-10-31T10:33:49-04:00", "updated_at": "2022-10-31T10:33:49-04:00", "query": "total_spent:>50 order_date:>=2013-01-01"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136103, "name": "Spent more than $50 and after 2013", "created_at": "2023-01-03T13:07:17-05:00", "updated_at": "2023-01-03T13:07:17-05:00", "query": "total_spent:>50 order_date:>=2013-01-01"}})); const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); customer_saved_search.name = "Spent more than $50 and after 2013"; @@ -137,7 +137,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-24T10:32:41-04:00", "query": "accepts_marketing:1"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}})); await shopify.rest.CustomerSavedSearch.find({ session: session, @@ -155,7 +155,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"customer_saved_search": {"name": "This Name Has Been Changed", "id": 789629109, "created_at": "2022-10-24T10:32:41-04:00", "updated_at": "2022-10-31T10:33:35-04:00", "query": "accepts_marketing:1"}})); + queueMockResponse(JSON.stringify({"customer_saved_search": {"name": "This Name Has Been Changed", "id": 789629109, "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2023-01-03T13:06:53-05:00", "query": "accepts_marketing:1"}})); const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); customer_saved_search.id = 789629109; @@ -191,7 +191,7 @@ describe('CustomerSavedSearch resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2022-10-31T10:32:41-04:00", "updated_at": "2022-10-31T10:33:36-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-10-31T10:33:36-04:00", "marketing_opt_in_level": "single_opt_in", "tax_exemptions": [], "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-31T10:32:41-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:07:04-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2023-01-03T13:07:04-05:00", "marketing_opt_in_level": "single_opt_in", "tax_exemptions": [], "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); await shopify.rest.CustomerSavedSearch.customers({ session: session, diff --git a/rest/admin/__tests__/2022-10/discount_code.test.ts b/rest/admin/__tests__/2022-10/discount_code.test.ts index 420d2e62b..b8e7d7aed 100644 --- a/rest/admin/__tests__/2022-10/discount_code.test.ts +++ b/rest/admin/__tests__/2022-10/discount_code.test.ts @@ -31,7 +31,7 @@ describe('DiscountCode resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"discount_code": {"id": 1054381139, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2022-10-03T12:22:02-04:00", "updated_at": "2022-10-03T12:22:02-04:00"}})); + queueMockResponse(JSON.stringify({"discount_code": {"id": 1054381139, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:38:34-05:00", "updated_at": "2023-01-03T12:38:34-05:00"}})); const discount_code = new shopify.rest.DiscountCode({session: session}); discount_code.price_rule_id = 507328175; @@ -49,7 +49,7 @@ describe('DiscountCode resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"discount_codes": [{"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}]})); + queueMockResponse(JSON.stringify({"discount_codes": [{"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}]})); await shopify.rest.DiscountCode.all({ session: session, @@ -67,7 +67,7 @@ describe('DiscountCode resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "WINTERSALE20OFF", "usage_count": 0, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:22:08-04:00"}})); + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "WINTERSALE20OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:31-05:00"}})); const discount_code = new shopify.rest.DiscountCode({session: session}); discount_code.price_rule_id = 507328175; @@ -86,7 +86,7 @@ describe('DiscountCode resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}})); + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}})); await shopify.rest.DiscountCode.find({ session: session, @@ -141,7 +141,7 @@ describe('DiscountCode resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 989355119, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2022-10-03T12:22:11-04:00", "updated_at": "2022-10-03T12:22:11-04:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 989355119, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2023-01-03T12:38:25-05:00", "updated_at": "2023-01-03T12:38:25-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); const discount_code = new shopify.rest.DiscountCode({session: session}); discount_code.price_rule_id = 507328175; @@ -160,7 +160,7 @@ describe('DiscountCode resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 173232803, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 173232803, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); await shopify.rest.DiscountCode.get_all({ session: session, diff --git a/rest/admin/__tests__/2022-10/draft_order.test.ts b/rest/admin/__tests__/2022-10/draft_order.test.ts index 3c6d04da0..6939ae198 100644 --- a/rest/admin/__tests__/2022-10/draft_order.test.ts +++ b/rest/admin/__tests__/2022-10/draft_order.test.ts @@ -31,29 +31,7 @@ describe('DraftOrder resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920475, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:19:47-04:00", "updated_at": "2022-10-03T12:19:47-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630380, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630380"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/d0730281ac9692b04a064b4bac5f23bc", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920475", "customer": null}})); - - const draft_order = new shopify.rest.DraftOrder({session: session}); - draft_order.line_items = [ - { - "variant_id": 447654529, - "quantity": 1 - } - ]; - await draft_order.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-10/draft_orders.json', - query: '', - headers, - data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } - }).toMatchMadeHttpRequest(); - }); - - it('test_2', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920476, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:19:50-04:00", "updated_at": "2022-10-03T12:19:50-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630381, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630381"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/227d2bfd5f2da805a987c89fd317c33f", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "40.00", "subtotal_price": "40.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920476", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920479, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:43-05:00", "updated_at": "2023-01-03T12:58:43-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630384, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630384"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/b21e68f2f1e19263509b19a8286d2d09", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "30.00", "subtotal_price": "30.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920479", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -63,6 +41,13 @@ describe('DraftOrder resource', () => { "quantity": 2 } ]; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "fixed_amount", + "value": "10.0", + "amount": "10.00", + "title": "Custom" + }; draft_order.customer = { "id": 207119551 }; @@ -75,12 +60,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-10/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "customer": {"id": 207119551}, "use_customer_default_address": true} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.00", "title": "Custom"}, "customer": {"id": 207119551}, "use_customer_default_address": true} } }).toMatchMadeHttpRequest(); }); - it('test_3', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920477, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:00-04:00", "updated_at": "2022-10-03T12:20:00-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630382, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630382"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/81affa4929f868a98b2231f89ab48a24", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "tags": "", "note_attributes": [], "total_price": "11.30", "subtotal_price": "10.00", "total_tax": "1.30", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "11.30", "currency_code": "USD"}, "presentment_money": {"amount": "11.30", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "1.30", "currency_code": "USD"}, "presentment_money": {"amount": "1.30", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920477", "customer": null}})); + it('test_2', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920478, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:39-05:00", "updated_at": "2023-01-03T12:58:39-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630383, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "2.00", "value_type": "percentage"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630383"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/d3f9ba3d1a9c83f93adf079a7f05d693", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "tags": "", "note_attributes": [], "total_price": "20.34", "subtotal_price": "18.00", "total_tax": "2.34", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "20.34", "currency_code": "USD"}, "presentment_money": {"amount": "20.34", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "18.00", "currency_code": "USD"}, "presentment_money": {"amount": "18.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "2.34", "currency_code": "USD"}, "presentment_money": {"amount": "2.34", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "2.00", "currency_code": "USD"}, "presentment_money": {"amount": "2.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920478"}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -90,9 +75,9 @@ describe('DraftOrder resource', () => { "quantity": 1, "applied_discount": { "description": "Custom discount", - "value_type": "fixed_amount", + "value_type": "percentage", "value": "10.0", - "amount": "10.0", + "amount": "2.0", "title": "Custom" } } @@ -105,12 +90,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-10/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.0", "title": "Custom"}}]} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "2.0", "title": "Custom"}}]} } }).toMatchMadeHttpRequest(); }); - it('test_4', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920478, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:01-04:00", "updated_at": "2022-10-03T12:20:01-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630383, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630383"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/58c3ff8f12f0a0f8a552f36dec441b0a", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "30.00", "subtotal_price": "30.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920478", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + it('test_3', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920477, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:31-05:00", "updated_at": "2023-01-03T12:58:31-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630382, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630382"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/17d301f9579f7982e4d1f75dd2b3269c", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "40.00", "subtotal_price": "40.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920477", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -120,13 +105,6 @@ describe('DraftOrder resource', () => { "quantity": 2 } ]; - draft_order.applied_discount = { - "description": "Custom discount", - "value_type": "fixed_amount", - "value": "10.0", - "amount": "10.00", - "title": "Custom" - }; draft_order.customer = { "id": 207119551 }; @@ -139,12 +117,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-10/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.00", "title": "Custom"}, "customer": {"id": 207119551}, "use_customer_default_address": true} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "customer": {"id": 207119551}, "use_customer_default_address": true} } }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920479, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:03-04:00", "updated_at": "2022-10-03T12:20:03-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630384, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630384"}], "shipping_address": null, "billing_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/b351a137cc201ae891ddcda59a58179e", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920479", "customer": {"id": 1073339456, "email": null, "accepts_marketing": false, "created_at": "2022-10-03T12:20:03-04:00", "updated_at": "2022-10-03T12:20:03-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-10-03T12:20:03-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317287, "customer_id": 1073339456, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + it('test_4', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920475, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:23-05:00", "updated_at": "2023-01-03T12:58:23-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630380, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630380"}], "shipping_address": null, "billing_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/5f465084cd7442780b87241fed885a5e", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920475", "customer": {"id": 1073339480, "email": null, "accepts_marketing": false, "created_at": "2023-01-03T12:58:23-05:00", "updated_at": "2023-01-03T12:58:23-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:58:23-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339480", "default_address": {"id": 1053317317, "customer_id": 1073339480, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -175,8 +153,8 @@ describe('DraftOrder resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920480, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:10-04:00", "updated_at": "2022-10-03T12:20:10-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630385, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630385"}], "shipping_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/8e652af09741964f24a0f2b12c70e416", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920480", "customer": {"id": 1073339457, "email": null, "accepts_marketing": false, "created_at": "2022-10-03T12:20:10-04:00", "updated_at": "2022-10-03T12:20:10-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-10-03T12:20:10-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339457", "default_address": {"id": 1053317289, "customer_id": 1073339457, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + it('test_5', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920476, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:25-05:00", "updated_at": "2023-01-03T12:58:25-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630381, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630381"}], "shipping_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/a9d2db17815b237bbc13d6ecd39d8f11", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920476", "customer": {"id": 1073339481, "email": null, "accepts_marketing": false, "created_at": "2023-01-03T12:58:25-05:00", "updated_at": "2023-01-03T12:58:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:58:25-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339481", "default_address": {"id": 1053317318, "customer_id": 1073339481, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -207,8 +185,8 @@ describe('DraftOrder resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920481, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:20:14-04:00", "updated_at": "2022-10-03T12:20:14-04:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630386, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "2.00", "value_type": "percentage"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630386"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/45664b5ac2738c15446732395e47b6a1", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "tags": "", "note_attributes": [], "total_price": "20.34", "subtotal_price": "18.00", "total_tax": "2.34", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "20.34", "currency_code": "USD"}, "presentment_money": {"amount": "20.34", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "18.00", "currency_code": "USD"}, "presentment_money": {"amount": "18.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "2.34", "currency_code": "USD"}, "presentment_money": {"amount": "2.34", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "2.00", "currency_code": "USD"}, "presentment_money": {"amount": "2.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920481", "customer": null}})); + it('test_6', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920481, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:56-05:00", "updated_at": "2023-01-03T12:58:56-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630386, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630386"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/46a7191808bee9d2bb0979533fa3b4b4", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "tags": "", "note_attributes": [], "total_price": "11.30", "subtotal_price": "10.00", "total_tax": "1.30", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "11.30", "currency_code": "USD"}, "presentment_money": {"amount": "11.30", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "1.30", "currency_code": "USD"}, "presentment_money": {"amount": "1.30", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920481"}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.line_items = [ @@ -218,9 +196,9 @@ describe('DraftOrder resource', () => { "quantity": 1, "applied_discount": { "description": "Custom discount", - "value_type": "percentage", + "value_type": "fixed_amount", "value": "10.0", - "amount": "2.0", + "amount": "10.0", "title": "Custom" } } @@ -233,12 +211,34 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-10/draft_orders.json', query: '', headers, - data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "2.0", "title": "Custom"}}]} } + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.0", "title": "Custom"}}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920480, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:45-05:00", "updated_at": "2023-01-03T12:58:45-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630385, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630385"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/42fb27c2a95082c0217255df38363371", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920480"}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D4", "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D4", "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869", "customer": null}]})); + queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D4", "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D4", "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869"}]})); await shopify.rest.DraftOrder.all({ session: session, @@ -255,11 +255,17 @@ describe('DraftOrder resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "Customer contacted us about a custom engraving on this iPod", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:19:57-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "194.00", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:49-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "19.90", "value_type": "percentage"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "179.10", "subtotal_price": "179.10", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "19.90", "currency_code": "USD"}, "presentment_money": {"amount": "19.90", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - draft_order.note = "Customer contacted us about a custom engraving on this iPod"; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "percentage", + "value": "10.0", + "amount": "19.90", + "title": "Custom" + }; await draft_order.save({}); expect({ @@ -268,22 +274,16 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-10/draft_orders/994118539.json', query: '', headers, - data: { "draft_order": {"note": "Customer contacted us about a custom engraving on this iPod"} } + data: { "draft_order": {"applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "19.90", "title": "Custom"}} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:20:17-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "19.90", "value_type": "percentage"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "179.10", "subtotal_price": "179.10", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "19.90", "currency_code": "USD"}, "presentment_money": {"amount": "19.90", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "Customer contacted us about a custom engraving on this iPod", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:47-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "194.00", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - draft_order.applied_discount = { - "description": "Custom discount", - "value_type": "percentage", - "value": "10.0", - "amount": "19.90", - "title": "Custom" - }; + draft_order.note = "Customer contacted us about a custom engraving on this iPod"; await draft_order.save({}); expect({ @@ -292,12 +292,12 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-10/draft_orders/994118539.json', query: '', headers, - data: { "draft_order": {"applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "19.90", "title": "Custom"}} } + data: { "draft_order": {"note": "Customer contacted us about a custom engraving on this iPod"} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); await shopify.rest.DraftOrder.find({ session: session, @@ -350,12 +350,12 @@ describe('DraftOrder resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "bob.norman@mail.example.com", "from": "j.smith@example.com", "subject": "Draft Order #D2", "custom_message": "", "bcc": []}})); + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!", "bcc": ["j.smith@example.com"]}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; await draft_order.send_invoice({ - body: {"draft_order_invoice": {}}, + body: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}}, }); expect({ @@ -364,17 +364,17 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-10/draft_orders/994118539/send_invoice.json', query: '', headers, - data: {"draft_order_invoice": {}} + data: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}} }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!", "bcc": ["j.smith@example.com"]}})); + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "bob.norman@mail.example.com", "from": "j.smith@example.com", "subject": "Draft Order #D2", "custom_message": "", "bcc": []}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; await draft_order.send_invoice({ - body: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}}, + body: {"draft_order_invoice": {}}, }); expect({ @@ -383,41 +383,41 @@ describe('DraftOrder resource', () => { path: '/admin/api/2022-10/draft_orders/994118539/send_invoice.json', query: '', headers, - data: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}} + data: {"draft_order_invoice": {}} }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"email": "bob.norman@mail.example.com", "id": 994118539, "note": "rush order", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:19:56-04:00", "tax_exempt": false, "completed_at": "2022-10-03T12:19:56-04:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459962, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": false}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:20-05:00", "tax_exempt": false, "completed_at": "2023-01-03T12:58:20-05:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459975, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:20-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 2, "state": "disabled", "total_spent": "405.90", "last_order_id": 1073459975, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1002", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317316, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - await draft_order.complete({ - payment_pending: "true", - }); + await draft_order.complete({}); expect({ method: 'PUT', domain, path: '/admin/api/2022-10/draft_orders/994118539/complete.json', - query: 'payment_pending=true', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"draft_order": {"email": "bob.norman@mail.example.com", "id": 994118539, "note": "rush order", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:20:08-04:00", "tax_exempt": false, "completed_at": "2022-10-03T12:20:08-04:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459963, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-10-03T12:15:55-04:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": false}}}})); + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:36-05:00", "tax_exempt": false, "completed_at": "2023-01-03T12:58:36-05:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459976, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 2, "state": "disabled", "total_spent": "405.90", "last_order_id": 1073459976, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1002", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317319, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); const draft_order = new shopify.rest.DraftOrder({session: session}); draft_order.id = 994118539; - await draft_order.complete({}); + await draft_order.complete({ + payment_pending: "true", + }); expect({ method: 'PUT', domain, path: '/admin/api/2022-10/draft_orders/994118539/complete.json', - query: '', + query: 'payment_pending=true', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-10/fulfillment.test.ts b/rest/admin/__tests__/2022-10/fulfillment.test.ts index daeaaff81..0f335d4ae 100644 --- a/rest/admin/__tests__/2022-10/fulfillment.test.ts +++ b/rest/admin/__tests__/2022-10/fulfillment.test.ts @@ -31,54 +31,54 @@ describe('Fulfillment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019884, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:18-04:00", "service": "shipwire-app", "updated_at": "2022-10-21T08:57:18-04:00", "tracking_company": "TNT", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "shipwire-app", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shipwire-app", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789", "tracking_urls": ["https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019884"}]})); + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}]})); await shopify.rest.Fulfillment.all({ session: session, order_id: 450789469, - since_id: "255858046", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/orders/450789469/fulfillments.json', - query: 'since_id=255858046', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillments": [{"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:56:20-04:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}]})); + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019883, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:45-05:00", "service": "shipwire-app", "updated_at": "2023-01-03T12:29:45-05:00", "tracking_company": "TNT", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "shipwire-app", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shipwire-app", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789", "tracking_urls": ["https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019883"}]})); await shopify.rest.Fulfillment.all({ session: session, order_id: 450789469, + since_id: "255858046", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/orders/450789469/fulfillments.json', - query: '', + query: 'since_id=255858046', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019901, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:56:20-04:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823190, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823190", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019901"}]})); + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019874, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823194, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823194", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019874"}]})); await shopify.rest.Fulfillment.all({ session: session, - fulfillment_order_id: 1046000823, + fulfillment_order_id: 1046000790, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000823/fulfillments.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000790/fulfillments.json', query: '', headers, data: undefined @@ -104,7 +104,7 @@ describe('Fulfillment resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:56:20-04:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); await shopify.rest.Fulfillment.find({ session: session, @@ -123,7 +123,7 @@ describe('Fulfillment resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019888, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:29-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:29-04:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823185, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019888"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019869, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:52-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:52-05:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823189, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823189", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019869"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.message = "The package was shipped this morning."; @@ -135,7 +135,13 @@ describe('Fulfillment resource', () => { }; fulfillment.line_items_by_fulfillment_order = [ { - "fulfillment_order_id": 1046000807 + "fulfillment_order_id": 1046000785, + "fulfillment_order_line_items": [ + { + "id": 1058737495, + "quantity": 1 + } + ] } ]; await fulfillment.save({}); @@ -146,12 +152,12 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-10/fulfillments.json', query: '', headers, - data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000807}]} } + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000785, "fulfillment_order_line_items": [{"id": 1058737495, "quantity": 1}]}]} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019894, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:57:51-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:51-04:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823189, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823189", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019894"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019865, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:37-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:37-05:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823187, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823187", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019865"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); fulfillment.message = "The package was shipped this morning."; @@ -163,13 +169,7 @@ describe('Fulfillment resource', () => { }; fulfillment.line_items_by_fulfillment_order = [ { - "fulfillment_order_id": 1046000813, - "fulfillment_order_line_items": [ - { - "id": 1058737556, - "quantity": 1 - } - ] + "fulfillment_order_id": 1046000780 } ]; await fulfillment.save({}); @@ -180,15 +180,15 @@ describe('Fulfillment resource', () => { path: '/admin/api/2022-10/fulfillments.json', query: '', headers, - data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000813, "fulfillment_order_line_items": [{"id": 1058737556, "quantity": 1}]}]} } + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000780}]} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"tracking_company": "my-company", "location_id": 24826418, "id": 1069019889, "order_id": 450789469, "status": "success", "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:33-04:00", "shipment_status": null, "line_items": [{"id": 1071823186, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823186", "tax_lines": []}], "tracking_number": "1111", "tracking_numbers": ["1111"], "tracking_url": "http://www.my-url.com", "tracking_urls": ["http://www.my-url.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019889"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"tracking_company": "my-company", "location_id": 24826418, "id": 1069019871, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:57-05:00", "shipment_status": null, "line_items": [{"id": 1071823192, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823192", "tax_lines": []}], "tracking_number": "1111", "tracking_numbers": ["1111"], "tracking_url": "http://www.my-url.com", "tracking_urls": ["http://www.my-url.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019871"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); - fulfillment.id = 1069019889; + fulfillment.id = 1069019871; await fulfillment.update_tracking({ body: {"fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com", "company": "my-company"}}}, }); @@ -196,7 +196,7 @@ describe('Fulfillment resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillments/1069019889/update_tracking.json', + path: '/admin/api/2022-10/fulfillments/1069019871/update_tracking.json', query: '', headers, data: { "fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com", "company": "my-company"}} } @@ -204,16 +204,16 @@ describe('Fulfillment resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 24826418, "id": 1069019883, "created_at": "2022-10-21T08:56:20-04:00", "service": "manual", "updated_at": "2022-10-21T08:57:13-04:00", "tracking_company": "UPS", "shipment_status": null, "line_items": [{"id": 1071823182, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019883"}})); + queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 24826418, "id": 1069019870, "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:54-05:00", "tracking_company": "UPS", "shipment_status": null, "line_items": [{"id": 1071823190, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823190", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019870"}})); const fulfillment = new shopify.rest.Fulfillment({session: session}); - fulfillment.id = 1069019883; + fulfillment.id = 1069019870; await fulfillment.cancel({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillments/1069019883/cancel.json', + path: '/admin/api/2022-10/fulfillments/1069019870/cancel.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/fulfillment_event.test.ts b/rest/admin/__tests__/2022-10/fulfillment_event.test.ts index 7897a05a9..a67702a65 100644 --- a/rest/admin/__tests__/2022-10/fulfillment_event.test.ts +++ b/rest/admin/__tests__/2022-10/fulfillment_event.test.ts @@ -31,7 +31,7 @@ describe('FulfillmentEvent resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_events": [{"id": 944956394, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2022-10-03T13:13:46-04:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2022-10-03T13:13:46-04:00", "updated_at": "2022-10-03T13:13:46-04:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956394"}]})); + queueMockResponse(JSON.stringify({"fulfillment_events": [{"id": 944956391, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:58:57-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:58:57-05:00", "updated_at": "2023-01-03T12:58:57-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956391"}]})); await shopify.rest.FulfillmentEvent.all({ session: session, @@ -50,7 +50,7 @@ describe('FulfillmentEvent resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956392, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2022-10-03T13:13:41-04:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2022-10-03T13:13:41-04:00", "updated_at": "2022-10-03T13:13:41-04:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956392"}})); + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956392, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:59:00-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:59:00-05:00", "updated_at": "2023-01-03T12:59:00-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956392"}})); const fulfillment_event = new shopify.rest.FulfillmentEvent({session: session}); fulfillment_event.order_id = 450789469; @@ -69,7 +69,7 @@ describe('FulfillmentEvent resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956393, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2022-10-03T13:13:43-04:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2022-10-03T13:13:43-04:00", "updated_at": "2022-10-03T13:13:43-04:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956393"}})); + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956393, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:59:00-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:59:00-05:00", "updated_at": "2023-01-03T12:59:00-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956393"}})); await shopify.rest.FulfillmentEvent.find({ session: session, @@ -95,13 +95,13 @@ describe('FulfillmentEvent resource', () => { session: session, order_id: 450789469, fulfillment_id: 255858046, - id: 944956391, + id: 944956394, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/orders/450789469/fulfillments/255858046/events/944956391.json', + path: '/admin/api/2022-10/orders/450789469/fulfillments/255858046/events/944956394.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/fulfillment_order.test.ts b/rest/admin/__tests__/2022-10/fulfillment_order.test.ts index 99ca63bee..5d27d7a03 100644 --- a/rest/admin/__tests__/2022-10/fulfillment_order.test.ts +++ b/rest/admin/__tests__/2022-10/fulfillment_order.test.ts @@ -31,7 +31,7 @@ describe('FulfillmentOrder resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000840, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000840, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737539, "shop_id": 548380009, "fulfillment_order_id": 1046000840, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000823, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000815, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737562, "shop_id": 548380009, "fulfillment_order_id": 1046000823, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); await shopify.rest.FulfillmentOrder.all({ session: session, @@ -49,17 +49,17 @@ describe('FulfillmentOrder resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000843, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000843, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000843, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000825, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000817, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737564, "shop_id": 548380009, "fulfillment_order_id": 1046000825, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); await shopify.rest.FulfillmentOrder.find({ session: session, - id: 1046000843, + id: 1046000825, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000843.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000825.json', query: '', headers, data: undefined @@ -67,16 +67,16 @@ describe('FulfillmentOrder resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000836, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000836, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "replacement_fulfillment_order": {"id": 1046000837, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000837, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737536, "shop_id": 548380009, "fulfillment_order_id": 1046000837, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000815, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000807, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "replacement_fulfillment_order": {"id": 1046000816, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000808, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737555, "shop_id": 548380009, "fulfillment_order_id": 1046000816, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000836; + fulfillment_order.id = 1046000815; await fulfillment_order.cancel({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000836/cancel.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000815/cancel.json', query: '', headers, data: undefined @@ -84,10 +84,10 @@ describe('FulfillmentOrder resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000849, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "closed", "status": "incomplete", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000849, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737548, "shop_id": 548380009, "fulfillment_order_id": 1046000849, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000819, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "closed", "status": "incomplete", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000811, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737558, "shop_id": 548380009, "fulfillment_order_id": 1046000819, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000849; + fulfillment_order.id = 1046000819; await fulfillment_order.close({ body: {"fulfillment_order": {"message": "Not enough inventory to complete this work."}}, }); @@ -95,7 +95,7 @@ describe('FulfillmentOrder resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000849/close.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000819/close.json', query: '', headers, data: { "fulfillment_order": {"message": "Not enough inventory to complete this work."} } @@ -103,10 +103,10 @@ describe('FulfillmentOrder resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000846, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 487838322, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000846, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737545, "shop_id": 548380009, "fulfillment_order_id": 1046000846, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "moved_fulfillment_order": {"id": 1046000847, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 655441491, "request_status": "unsubmitted", "status": "open", "supported_actions": ["create_fulfillment", "move"], "destination": {"id": 1046000847, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737546, "shop_id": 548380009, "fulfillment_order_id": 1046000847, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "country_code": "CA", "location_id": 655441491, "name": "50 Rideau Street", "phone": null, "province": "Ontario", "zip": "K1N 9J7"}, "merchant_requests": []}, "remaining_fulfillment_order": null})); + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000821, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 487838322, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000813, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737560, "shop_id": 548380009, "fulfillment_order_id": 1046000821, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "moved_fulfillment_order": {"id": 1046000822, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 655441491, "request_status": "unsubmitted", "status": "open", "supported_actions": ["create_fulfillment", "move"], "destination": {"id": 1046000814, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737561, "shop_id": 548380009, "fulfillment_order_id": 1046000822, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "country_code": "CA", "location_id": 655441491, "name": "50 Rideau Street", "phone": null, "province": "Ontario", "zip": "K1N 9J7"}, "merchant_requests": []}, "remaining_fulfillment_order": null})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000846; + fulfillment_order.id = 1046000821; await fulfillment_order.move({ body: {"fulfillment_order": {"new_location_id": 655441491}}, }); @@ -114,7 +114,7 @@ describe('FulfillmentOrder resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000846/move.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000821/move.json', query: '', headers, data: { "fulfillment_order": {"new_location_id": 655441491} } @@ -122,16 +122,16 @@ describe('FulfillmentOrder resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000845, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000845, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737544, "shop_id": 548380009, "fulfillment_order_id": 1046000845, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000828, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000820, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737567, "shop_id": 548380009, "fulfillment_order_id": 1046000828, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000845; + fulfillment_order.id = 1046000828; await fulfillment_order.open({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000845/open.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000828/open.json', query: '', headers, data: undefined @@ -139,29 +139,29 @@ describe('FulfillmentOrder resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000841, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "scheduled", "supported_actions": ["mark_as_open"], "destination": {"id": 1046000841, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000841, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": "2023-11-19T03:43:00-05:00", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000824, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "scheduled", "supported_actions": ["mark_as_open"], "destination": {"id": 1046000816, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737563, "shop_id": 548380009, "fulfillment_order_id": 1046000824, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": "2024-02-03T12:57:00-05:00", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000841; + fulfillment_order.id = 1046000824; await fulfillment_order.reschedule({ - body: {"fulfillment_order": {"new_fulfill_at": "2023-11-19 08:43 UTC"}}, + body: {"fulfillment_order": {"new_fulfill_at": "2024-02-03 17:57 UTC"}}, }); expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000841/reschedule.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000824/reschedule.json', query: '', headers, - data: { "fulfillment_order": {"new_fulfill_at": "2023-11-19 08:43 UTC"} } + data: { "fulfillment_order": {"new_fulfill_at": "2024-02-03 17:57 UTC"} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000848, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "on_hold", "supported_actions": ["release_hold"], "destination": {"id": 1046000848, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737547, "shop_id": 548380009, "fulfillment_order_id": 1046000848, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [{"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000826, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "on_hold", "supported_actions": ["release_hold"], "destination": {"id": 1046000818, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737565, "shop_id": 548380009, "fulfillment_order_id": 1046000826, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [{"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000848; + fulfillment_order.id = 1046000826; await fulfillment_order.hold({ body: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}}, }); @@ -169,7 +169,7 @@ describe('FulfillmentOrder resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000848/hold.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000826/hold.json', query: '', headers, data: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}} @@ -182,7 +182,7 @@ describe('FulfillmentOrder resource', () => { const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); await fulfillment_order.set_fulfillment_orders_deadline({ - body: {"fulfillment_order_ids": [1046000838], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"}, + body: {"fulfillment_order_ids": [1046000818], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"}, }); expect({ @@ -191,21 +191,21 @@ describe('FulfillmentOrder resource', () => { path: '/admin/api/2022-10/fulfillment_orders/set_fulfillment_orders_deadline.json', query: '', headers, - data: {"fulfillment_order_ids": [1046000838], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"} + data: {"fulfillment_order_ids": [1046000818], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"} }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000839, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000839, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737538, "shop_id": 548380009, "fulfillment_order_id": 1046000839, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000820, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000812, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737559, "shop_id": 548380009, "fulfillment_order_id": 1046000820, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); - fulfillment_order.id = 1046000839; + fulfillment_order.id = 1046000820; await fulfillment_order.release_hold({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000839/release_hold.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000820/release_hold.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/fulfillment_request.test.ts b/rest/admin/__tests__/2022-10/fulfillment_request.test.ts index 222d8de8a..d43339768 100644 --- a/rest/admin/__tests__/2022-10/fulfillment_request.test.ts +++ b/rest/admin/__tests__/2022-10/fulfillment_request.test.ts @@ -31,56 +31,56 @@ describe('FulfillmentRequest resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000798, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000795, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737501, "shop_id": 548380009, "fulfillment_order_id": 1046000798, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737502, "shop_id": 548380009, "fulfillment_order_id": 1046000798, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737503, "shop_id": 548380009, "fulfillment_order_id": 1046000798, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000799, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000796, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737504, "shop_id": 548380009, "fulfillment_order_id": 1046000799, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737505, "shop_id": 548380009, "fulfillment_order_id": 1046000799, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2022-10-03T13:19:53-04:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": {"id": 1046000800, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000797, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737506, "shop_id": 548380009, "fulfillment_order_id": 1046000800, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000809, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000801, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737541, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:15-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000809, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000801, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737541, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:15-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": null})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000798; + fulfillment_request.fulfillment_order_id = 1046000809; fulfillment_request.message = "Fulfill this ASAP please."; - fulfillment_request.fulfillment_order_line_items = [ - { - "id": 1058737501, - "quantity": 1 - }, - { - "id": 1058737502, - "quantity": 1 - } - ]; await fulfillment_request.save({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000798/fulfillment_request.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000809/fulfillment_request.json', query: '', headers, - data: { "fulfillment_request": {"message": "Fulfill this ASAP please.", "fulfillment_order_line_items": [{"id": 1058737501, "quantity": 1}, {"id": 1058737502, "quantity": 1}]} } + data: { "fulfillment_request": {"message": "Fulfill this ASAP please."} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000803, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737513, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737514, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737515, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2022-10-03T13:20:20-04:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000803, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737513, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737514, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737515, "shop_id": 548380009, "fulfillment_order_id": 1046000803, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2022-10-03T13:20:20-04:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": null})); + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000812, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000804, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737549, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737550, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737551, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000813, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000805, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737552, "shop_id": 548380009, "fulfillment_order_id": 1046000813, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737553, "shop_id": 548380009, "fulfillment_order_id": 1046000813, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:27-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": {"id": 1046000814, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000806, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737554, "shop_id": 548380009, "fulfillment_order_id": 1046000814, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000803; + fulfillment_request.fulfillment_order_id = 1046000812; fulfillment_request.message = "Fulfill this ASAP please."; + fulfillment_request.fulfillment_order_line_items = [ + { + "id": 1058737549, + "quantity": 1 + }, + { + "id": 1058737550, + "quantity": 1 + } + ]; await fulfillment_request.save({}); expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000803/fulfillment_request.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000812/fulfillment_request.json', query: '', headers, - data: { "fulfillment_request": {"message": "Fulfill this ASAP please."} } + data: { "fulfillment_request": {"message": "Fulfill this ASAP please.", "fulfillment_order_line_items": [{"id": 1058737549, "quantity": 1}, {"id": 1058737550, "quantity": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000801, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "accepted", "status": "in_progress", "supported_actions": ["request_cancellation", "create_fulfillment"], "destination": {"id": 1046000798, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737507, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737508, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737509, "shop_id": 548380009, "fulfillment_order_id": 1046000801, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000810, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "accepted", "status": "in_progress", "supported_actions": ["request_cancellation", "create_fulfillment"], "destination": {"id": 1046000802, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737543, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737544, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737545, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000801; + fulfillment_request.fulfillment_order_id = 1046000810; await fulfillment_request.accept({ body: {"fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."}}, }); @@ -88,7 +88,7 @@ describe('FulfillmentRequest resource', () => { expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000801/fulfillment_request/accept.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000810/fulfillment_request/accept.json', query: '', headers, data: { "fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."} } @@ -96,21 +96,21 @@ describe('FulfillmentRequest resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000802, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "rejected", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000799, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737510, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737511, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737512, "shop_id": 548380009, "fulfillment_order_id": 1046000802, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000811, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "rejected", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000803, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737546, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737547, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737548, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); - fulfillment_request.fulfillment_order_id = 1046000802; + fulfillment_request.fulfillment_order_id = 1046000811; await fulfillment_request.reject({ - body: {"fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737510, "message": "Not enough inventory."}]}}, + body: {"fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737546, "message": "Not enough inventory."}]}}, }); expect({ method: 'POST', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000802/fulfillment_request/reject.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000811/fulfillment_request/reject.json', query: '', headers, - data: { "fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737510, "message": "Not enough inventory."}]} } + data: { "fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737546, "message": "Not enough inventory."}]} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/fulfillment_service.test.ts b/rest/admin/__tests__/2022-10/fulfillment_service.test.ts index 88ca247ec..e72ec9e61 100644 --- a/rest/admin/__tests__/2022-10/fulfillment_service.test.ts +++ b/rest/admin/__tests__/2022-10/fulfillment_service.test.ts @@ -66,7 +66,7 @@ describe('FulfillmentService resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 1061774524, "name": "Jupiter Fulfillment", "email": null, "service_name": "Jupiter Fulfillment", "handle": "jupiter-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 1072404579, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/1061774524", "permits_sku_sharing": true}})); + queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 1061774488, "name": "Jupiter Fulfillment", "email": null, "service_name": "Jupiter Fulfillment", "handle": "jupiter-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 1072404543, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/1061774488", "permits_sku_sharing": true}})); const fulfillment_service = new shopify.rest.FulfillmentService({session: session}); fulfillment_service.name = "Jupiter Fulfillment"; diff --git a/rest/admin/__tests__/2022-10/gift_card.test.ts b/rest/admin/__tests__/2022-10/gift_card.test.ts index d509745c0..ddb2c6999 100644 --- a/rest/admin/__tests__/2022-10/gift_card.test.ts +++ b/rest/admin/__tests__/2022-10/gift_card.test.ts @@ -31,79 +31,42 @@ describe('GiftCard resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1035197676, "balance": "100.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}, {"id": 766118925, "balance": "25.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2021-10-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 766118925, "balance": "25.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2022-01-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); await shopify.rest.GiftCard.all({ session: session, + status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/gift_cards.json', - query: '', + query: 'status=enabled', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"gift_cards": [{"id": 766118925, "balance": "25.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2021-10-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1035197676, "balance": "100.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}, {"id": 766118925, "balance": "25.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2022-01-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); await shopify.rest.GiftCard.all({ session: session, - status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/gift_cards.json', - query: 'status=enabled', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936316, "balance": "25.00", "created_at": "2022-10-03T12:50:53-04:00", "updated_at": "2022-10-03T12:50:53-04:00", "currency": "USD", "initial_value": "25.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "ce2g", "order_id": null, "code": "b72c6222b9chce2g"}})); - - const gift_card = new shopify.rest.GiftCard({session: session}); - gift_card.initial_value = 25.0; - await gift_card.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-10/gift_cards.json', - query: '', - headers, - data: { "gift_card": {"initial_value": 25.0} } - }).toMatchMadeHttpRequest(); - }); - - it('test_4', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936319, "balance": "100.00", "created_at": "2022-10-03T12:51:09-04:00", "updated_at": "2022-10-03T12:51:09-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": "This is a note", "expires_on": null, "template_suffix": "gift_cards.birthday.liquid", "last_characters": "mnop", "order_id": null, "code": "abcdefghijklmnop"}})); - - const gift_card = new shopify.rest.GiftCard({session: session}); - gift_card.note = "This is a note"; - gift_card.initial_value = 100.0; - gift_card.code = "ABCD EFGH IJKL MNOP"; - gift_card.template_suffix = "gift_cards.birthday.liquid"; - await gift_card.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-10/gift_cards.json', - query: '', - headers, - data: { "gift_card": {"note": "This is a note", "initial_value": 100.0, "code": "ABCD EFGH IJKL MNOP", "template_suffix": "gift_cards.birthday.liquid"} } - }).toMatchMadeHttpRequest(); - }); - - it('test_5', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"id": 1035197676, "balance": "100.00", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}})); + queueMockResponse(JSON.stringify({"gift_card": {"id": 1035197676, "balance": "100.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}})); await shopify.rest.GiftCard.find({ session: session, @@ -120,12 +83,12 @@ describe('GiftCard resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"note": "Updating with a new note", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:58-04:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + it('test_4', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"expires_on": "2020-01-01", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:02-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "last_characters": "0d0d", "order_id": null}})); const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; - gift_card.note = "Updating with a new note"; + gift_card.expires_on = "2020-01-01"; await gift_card.save({}); expect({ @@ -134,16 +97,16 @@ describe('GiftCard resource', () => { path: '/admin/api/2022-10/gift_cards/1035197676.json', query: '', headers, - data: { "gift_card": {"note": "Updating with a new note"} } + data: { "gift_card": {"expires_on": "2020-01-01"} } }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"expires_on": "2020-01-01", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:51:03-04:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "last_characters": "0d0d", "order_id": null}})); + it('test_5', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"note": "Updating with a new note", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:10-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; - gift_card.expires_on = "2020-01-01"; + gift_card.note = "Updating with a new note"; await gift_card.save({}); expect({ @@ -152,47 +115,84 @@ describe('GiftCard resource', () => { path: '/admin/api/2022-10/gift_cards/1035197676.json', query: '', headers, - data: { "gift_card": {"expires_on": "2020-01-01"} } + data: { "gift_card": {"note": "Updating with a new note"} } }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { + it('test_6', async () => { queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.GiftCard.count({ session: session, - status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/gift_cards/count.json', - query: 'status=enabled', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_9', async () => { + it('test_7', async () => { queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.GiftCard.count({ session: session, + status: "enabled", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/gift_cards/count.json', - query: '', + query: 'status=enabled', headers, data: undefined }).toMatchMadeHttpRequest(); }); + it('test_8', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936318, "balance": "100.00", "created_at": "2023-01-03T12:30:11-05:00", "updated_at": "2023-01-03T12:30:11-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": "This is a note", "expires_on": null, "template_suffix": "gift_cards.birthday.liquid", "last_characters": "mnop", "order_id": null, "code": "abcdefghijklmnop"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.note = "This is a note"; + gift_card.initial_value = 100.0; + gift_card.code = "ABCD EFGH IJKL MNOP"; + gift_card.template_suffix = "gift_cards.birthday.liquid"; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"note": "This is a note", "initial_value": 100.0, "code": "ABCD EFGH IJKL MNOP", "template_suffix": "gift_cards.birthday.liquid"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936317, "balance": "25.00", "created_at": "2023-01-03T12:30:08-05:00", "updated_at": "2023-01-03T12:30:08-05:00", "currency": "USD", "initial_value": "25.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "fc53", "order_id": null, "code": "58he9ffdhhc4fc53"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.initial_value = 25.0; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"initial_value": 25.0} } + }).toMatchMadeHttpRequest(); + }); + it('test_10', async () => { - queueMockResponse(JSON.stringify({"gift_card": {"disabled_at": "2022-10-03T12:50:50-04:00", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:50-04:00", "currency": "USD", "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + queueMockResponse(JSON.stringify({"gift_card": {"disabled_at": "2023-01-03T12:30:07-05:00", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:07-05:00", "currency": "USD", "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); const gift_card = new shopify.rest.GiftCard({session: session}); gift_card.id = 1035197676; @@ -211,7 +211,7 @@ describe('GiftCard resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1063936318, "balance": "10.00", "created_at": "2022-10-03T12:51:07-04:00", "updated_at": "2022-10-03T12:51:07-04:00", "currency": "USD", "initial_value": "10.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "mnop", "order_id": null}]})); + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1063936316, "balance": "10.00", "created_at": "2023-01-03T12:30:02-05:00", "updated_at": "2023-01-03T12:30:02-05:00", "currency": "USD", "initial_value": "10.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "mnop", "order_id": null}]})); await shopify.rest.GiftCard.search({ session: session, diff --git a/rest/admin/__tests__/2022-10/gift_card_adjustment.test.ts b/rest/admin/__tests__/2022-10/gift_card_adjustment.test.ts index 80e097554..3e31c0b6b 100644 --- a/rest/admin/__tests__/2022-10/gift_card_adjustment.test.ts +++ b/rest/admin/__tests__/2022-10/gift_card_adjustment.test.ts @@ -31,7 +31,7 @@ describe('GiftCardAdjustment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"adjustments": [{"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}]})); + queueMockResponse(JSON.stringify({"adjustments": [{"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}]})); await shopify.rest.GiftCardAdjustment.all({ session: session, @@ -49,12 +49,13 @@ describe('GiftCardAdjustment resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273909, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-04-03T13:10:51-04:00", "created_at": "2022-10-03T13:10:51-04:00", "updated_at": "2022-10-03T13:10:51-04:00", "note": null, "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273912, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2023-01-03T12:44:55-05:00", "created_at": "2023-01-03T12:44:55-05:00", "updated_at": "2023-01-03T12:44:55-05:00", "note": null, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; gift_card_adjustment.amount = 10.0; - gift_card_adjustment.processed_at = "2022-04-03T13:10:51-04:00"; + gift_card_adjustment.remote_transaction_ref = "gift_card_app_transaction_193402"; + gift_card_adjustment.remote_transaction_url = "http://example.com/my-gift-card-app/gift_card_adjustments/193402"; await gift_card_adjustment.save({}); expect({ @@ -63,12 +64,12 @@ describe('GiftCardAdjustment resource', () => { path: '/admin/api/2022-10/gift_cards/1035197676/adjustments.json', query: '', headers, - data: { "adjustment": {"amount": 10.0, "processed_at": "2022-04-03T13:10:51-04:00"} } + data: { "adjustment": {"amount": 10.0, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273910, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-10-03T13:10:53-04:00", "created_at": "2022-10-03T13:10:53-04:00", "updated_at": "2022-10-03T13:10:53-04:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273911, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2023-01-03T12:44:54-05:00", "created_at": "2023-01-03T12:44:54-05:00", "updated_at": "2023-01-03T12:44:54-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; @@ -87,7 +88,7 @@ describe('GiftCardAdjustment resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273911, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "-20.00", "processed_at": "2022-10-03T13:10:54-04:00", "created_at": "2022-10-03T13:10:54-04:00", "updated_at": "2022-10-03T13:10:54-04:00", "note": "Customer spent $20 via external service", "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273913, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "-20.00", "processed_at": "2023-01-03T12:44:57-05:00", "created_at": "2023-01-03T12:44:57-05:00", "updated_at": "2023-01-03T12:44:57-05:00", "note": "Customer spent $20 via external service", "remote_transaction_ref": null, "remote_transaction_url": null}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; @@ -106,13 +107,12 @@ describe('GiftCardAdjustment resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273912, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-10-03T13:10:57-04:00", "created_at": "2022-10-03T13:10:57-04:00", "updated_at": "2022-10-03T13:10:57-04:00", "note": null, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273910, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-07-03T12:44:50-04:00", "created_at": "2023-01-03T12:44:50-05:00", "updated_at": "2023-01-03T12:44:50-05:00", "note": null, "remote_transaction_ref": null, "remote_transaction_url": null}})); const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); gift_card_adjustment.gift_card_id = 1035197676; gift_card_adjustment.amount = 10.0; - gift_card_adjustment.remote_transaction_ref = "gift_card_app_transaction_193402"; - gift_card_adjustment.remote_transaction_url = "http://example.com/my-gift-card-app/gift_card_adjustments/193402"; + gift_card_adjustment.processed_at = "2022-07-03T12:44:50-04:00"; await gift_card_adjustment.save({}); expect({ @@ -121,12 +121,12 @@ describe('GiftCardAdjustment resource', () => { path: '/admin/api/2022-10/gift_cards/1035197676/adjustments.json', query: '', headers, - data: { "adjustment": {"amount": 10.0, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"} } + data: { "adjustment": {"amount": 10.0, "processed_at": "2022-07-03T12:44:50-04:00"} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); await shopify.rest.GiftCardAdjustment.find({ session: session, diff --git a/rest/admin/__tests__/2022-10/image.test.ts b/rest/admin/__tests__/2022-10/image.test.ts index 222305815..da995be9d 100644 --- a/rest/admin/__tests__/2022-10/image.test.ts +++ b/rest/admin/__tests__/2022-10/image.test.ts @@ -31,290 +31,290 @@ describe('Image resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"images": [{"id": 1001473895, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:29-04:00", "updated_at": "2022-10-03T12:20:29-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814029", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473895"}]})); + queueMockResponse(JSON.stringify({"images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]})); await shopify.rest.Image.all({ session: session, product_id: 632910392, - since_id: "850703190", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products/632910392/images.json', - query: 'since_id=850703190', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]})); + queueMockResponse(JSON.stringify({"images": [{"id": 1001473900, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:38:59-05:00", "updated_at": "2023-01-03T12:38:59-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767539", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473900"}]})); await shopify.rest.Image.all({ session: session, product_id: 632910392, + since_id: "850703190", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products/632910392/images.json', - query: '', + query: 'since_id=850703190', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"count": 3})); + queueMockResponse(JSON.stringify({"image": {"width": 110, "height": 140, "position": 1, "alt": null, "id": 1001473901, "product_id": 632910392, "created_at": "2023-01-03T12:39:02-05:00", "updated_at": "2023-01-03T12:39:02-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767542", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473901"}})); - await shopify.rest.Image.count({ - session: session, - product_id: 632910392, - }); + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text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GC6862KKRgHGY6K9zlEPdyP8AJcteo\n3ClsQCHq0AF0QdkN+HbjlxygL31hO13tMrW7lwkB0BiUoR3x4EfmrYlCNjAF\nCRAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392/images/count.json', + path: '/admin/api/2022-10/products/632910392/images.json', query: '', headers, - data: undefined + data: { "image": {"position": 1, "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZRPLIgMZUeJ+jKvrAlK6AhJ65A\nMpMpKuC3j5obIs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vCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"count": 0})); + queueMockResponse(JSON.stringify({"image": {"id": 1001473905, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:39:23-05:00", "updated_at": "2023-01-03T12:39:23-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767563", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473905"}})); - await shopify.rest.Image.count({ - session: session, - product_id: 632910392, - since_id: "850703190", - }); + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.variant_ids = [ + 808950810, + 457924702 + ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhv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WKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392/images/count.json', - query: 'since_id=850703190', + path: '/admin/api/2022-10/products/632910392/images.json', + query: '', headers, - data: undefined + data: { "image": {"variant_ids": [808950810, 457924702], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIen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5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"image": {"position": 1, "width": 110, "height": 140, "alt": null, "id": 1001473903, "product_id": 632910392, "created_at": "2023-01-03T12:39:08-05:00", "updated_at": "2023-01-03T12:39:08-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767548", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473903"}})); - await shopify.rest.Image.find({ - session: session, - product_id: 632910392, - id: 850703190, - }); + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZ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9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392/images/850703190.json', + path: '/admin/api/2022-10/products/632910392/images.json', query: '', headers, - data: undefined + data: { "image": {"position": 1, "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2q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MrW7lwkB0BiUoR3x4EfmrYlCNjAF\nCRAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 2, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:20:39-04:00", "alt": "new alt tag content", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664814039", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"image": {"id": 1001473904, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:39:10-05:00", "updated_at": "2023-01-03T12:39:10-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-c155h.gif?v=1672767550", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473904"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.id = 850703190; - image.position = 2; - image.alt = "new alt tag content"; + image.src = "http://example.com/rails_logo.gif"; await image.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392/images/850703190.json', + path: '/admin/api/2022-10/products/632910392/images.json', query: '', headers, - data: { "image": {"position": 2, "alt": "new alt tag content"} } + data: { "image": {"src": "http://example.com/rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"image": {"updated_at": "2022-10-03T12:20:45-04:00", "id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664814045", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"image": {"id": 1001473896, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:38:46-05:00", "updated_at": "2023-01-03T12:38:46-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767526", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473896"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.id = 850703190; - image.metafields = [ - { - "key": "my_new_metafield", - "value": "my_new_value", - "type": "single_line_text_field", - "namespace": "tags" - } - ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZRPLIgMZUeJ+jKvrAlK6AhJ65A\nMpMpKuC3j5obIsRwS7hAN8l/YtvDvn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+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; await image.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392/images/850703190.json', + path: '/admin/api/2022-10/products/632910392/images.json', query: '', headers, - data: { "image": {"metafields": [{"key": "my_new_metafield", "value": "my_new_value", "type": "single_line_text_field", "namespace": "tags"}]} } + data: { "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aq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O7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + queueMockResponse(JSON.stringify({"count": 3})); - const image = new shopify.rest.Image({session: session}); - image.product_id = 632910392; - image.id = 850703190; - image.variant_ids = [ - 808950810, - 457924702 - ]; - await image.save({}); + await shopify.rest.Image.count({ + session: session, + product_id: 632910392, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-10/products/632910392/images/850703190.json', + path: '/admin/api/2022-10/products/632910392/images/count.json', query: '', headers, - data: { "image": {"variant_ids": [808950810, 457924702]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"count": 0})); - await shopify.rest.Image.delete({ + await shopify.rest.Image.count({ session: session, product_id: 632910392, - id: 850703190, + since_id: "850703190", }); expect({ - method: 'DELETE', + method: 'GET', domain, - path: '/admin/api/2022-10/products/632910392/images/850703190.json', - query: '', + path: '/admin/api/2022-10/products/632910392/images/count.json', + query: 'since_id=850703190', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 1001473896, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:33-04:00", "updated_at": "2022-10-03T12:20:33-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20221003-23488-mgiwm9.gif?v=1664814033", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473896"}})); + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); - const image = new shopify.rest.Image({session: session}); - image.product_id = 632910392; - image.src = "http://example.com/rails_logo.gif"; - await image.save({}); + await shopify.rest.Image.find({ + session: session, + product_id: 632910392, + id: 850703190, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/products/632910392/images.json', + path: '/admin/api/2022-10/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"src": "http://example.com/rails_logo.gif"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 1001473897, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:36-04:00", "updated_at": "2022-10-03T12:20:36-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814036", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473897"}})); + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:53-05:00", "alt": "new alt tag content", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672767533", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK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B0BiUoR3x4EfmrYlCNjAF\nCRAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; + image.id = 850703190; + image.position = 2; + image.alt = "new alt tag content"; await image.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products/632910392/images.json', + path: '/admin/api/2022-10/products/632910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Fj2ZGC6862KKRgHGY6K9zlEPdyP8AJcteo\n3ClsQCHq0AF0QdkN+HbjlxygL31hO13tMrW7lwkB0BiUoR3x4EfmrYlCNjAF\nCRAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: { "image": {"position": 2, "alt": "new alt tag content"} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"image": {"id": 1001473899, "product_id": 632910392, "position": 4, "created_at": "2022-10-03T12:20:47-04:00", "updated_at": "2022-10-03T12:20:47-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814047", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473899"}})); + queueMockResponse(JSON.stringify({"image": {"updated_at": "2023-01-03T12:39:13-05:00", "id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672767553", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.variant_ids = [ - 808950810, - 457924702 + image.id = 850703190; + image.metafields = [ + { + "key": "my_new_metafield", + "value": "my_new_value", + "type": "single_line_text_field", + "namespace": "tags" + } ]; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0b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Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; await image.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products/632910392/images.json', + path: '/admin/api/2022-10/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"variant_ids": [808950810, 457924702], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXC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wAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: { "image": {"metafields": [{"key": "my_new_metafield", "value": "my_new_value", "type": "single_line_text_field", "namespace": "tags"}]} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"image": {"position": 1, "width": 110, "height": 140, "alt": null, "id": 1001473900, "product_id": 632910392, "created_at": "2022-10-03T12:20:50-04:00", "updated_at": "2022-10-03T12:20:50-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814050", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473900"}})); + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); const image = new shopify.rest.Image({session: session}); image.product_id = 632910392; - image.position = 1; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZRPLIgMZUeJ+jKvrAlK6AhJ65A\nMpMpKuC3j5obIsRwS7hAN8l/YtvDvnYXHbAoLI47SIUsOMenorF4gO/m4+fH\npo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"; + image.id = 850703190; + image.variant_ids = [ + 808950810, + 457924702 + ]; await image.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products/632910392/images.json', + path: '/admin/api/2022-10/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"position": 1, "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZRPLIgMZ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2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: { "image": {"variant_ids": [808950810, 457924702]} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"image": {"width": 110, "height": 140, "position": 1, "alt": null, "id": 1001473904, "product_id": 632910392, "created_at": "2022-10-03T12:21:03-04:00", "updated_at": "2022-10-03T12:21:03-04:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1664814063", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473904"}})); + queueMockResponse(JSON.stringify({})); - const image = new shopify.rest.Image({session: session}); - image.product_id = 632910392; - image.position = 1; - image.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; - image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvM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0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; - image.filename = "rails_logo.gif"; - await image.save({}); + await shopify.rest.Image.delete({ + session: session, + product_id: 632910392, + id: 850703190, + }); expect({ - method: 'POST', + method: 'DELETE', domain, - path: '/admin/api/2022-10/products/632910392/images.json', + path: '/admin/api/2022-10/products/632910392/images/850703190.json', query: '', headers, - data: { "image": {"position": 1, "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9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O5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + data: undefined }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/inventory_item.test.ts b/rest/admin/__tests__/2022-10/inventory_item.test.ts index 4b50a00ca..a6fcf615a 100644 --- a/rest/admin/__tests__/2022-10/inventory_item.test.ts +++ b/rest/admin/__tests__/2022-10/inventory_item.test.ts @@ -31,7 +31,7 @@ describe('InventoryItem resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"inventory_items": [{"id": 39072856, "sku": "IPOD2008GREEN", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/39072856"}, {"id": 457924702, "sku": "IPOD2008BLACK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/457924702"}, {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}]})); + queueMockResponse(JSON.stringify({"inventory_items": [{"id": 39072856, "sku": "IPOD2008GREEN", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/39072856"}, {"id": 457924702, "sku": "IPOD2008BLACK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/457924702"}, {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}]})); await shopify.rest.InventoryItem.all({ session: session, @@ -49,7 +49,7 @@ describe('InventoryItem resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); await shopify.rest.InventoryItem.find({ session: session, @@ -67,7 +67,7 @@ describe('InventoryItem resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "new sku", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:11:09-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "new sku", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:07-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); const inventory_item = new shopify.rest.InventoryItem({session: session}); inventory_item.id = 808950810; @@ -85,7 +85,7 @@ describe('InventoryItem resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2022-10-03T13:07:13-04:00", "updated_at": "2022-10-03T13:07:13-04:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); const inventory_item = new shopify.rest.InventoryItem({session: session}); inventory_item.id = 808950810; diff --git a/rest/admin/__tests__/2022-10/inventory_level.test.ts b/rest/admin/__tests__/2022-10/inventory_level.test.ts index 89ac440af..c264bf7e8 100644 --- a/rest/admin/__tests__/2022-10/inventory_level.test.ts +++ b/rest/admin/__tests__/2022-10/inventory_level.test.ts @@ -31,7 +31,7 @@ describe('InventoryLevel resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 655441491, "available": 2, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 655441491, "available": 4, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 655441491, "available": 2, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 655441491, "available": 4, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); await shopify.rest.InventoryLevel.all({ session: session, @@ -49,44 +49,44 @@ describe('InventoryLevel resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}]})); await shopify.rest.InventoryLevel.all({ session: session, - inventory_item_ids: "808950810,39072856", - location_ids: "655441491,487838322", + inventory_item_ids: "808950810", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/inventory_levels.json', - query: 'inventory_item_ids=808950810%2C39072856&location_ids=655441491%2C487838322', + query: 'inventory_item_ids=808950810', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2022-10-03T13:07:13-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); await shopify.rest.InventoryLevel.all({ session: session, - inventory_item_ids: "808950810", + inventory_item_ids: "808950810,39072856", + location_ids: "655441491,487838322", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/inventory_levels.json', - query: 'inventory_item_ids=808950810', + query: 'inventory_item_ids=808950810%2C39072856&location_ids=655441491%2C487838322', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 6, "updated_at": "2022-10-03T13:14:39-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 6, "updated_at": "2023-01-03T13:03:33-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); const inventory_level = new shopify.rest.InventoryLevel({session: session}); @@ -124,7 +124,7 @@ describe('InventoryLevel resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 457924702, "location_id": 844681632, "available": 0, "updated_at": "2022-10-03T13:14:35-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702"}})); + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 457924702, "location_id": 844681632, "available": 0, "updated_at": "2023-01-03T13:03:42-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702"}})); const inventory_level = new shopify.rest.InventoryLevel({session: session}); @@ -143,7 +143,7 @@ describe('InventoryLevel resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 42, "updated_at": "2022-10-03T13:14:50-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 42, "updated_at": "2023-01-03T13:03:52-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); const inventory_level = new shopify.rest.InventoryLevel({session: session}); diff --git a/rest/admin/__tests__/2022-10/location.test.ts b/rest/admin/__tests__/2022-10/location.test.ts index 27a8d7dcb..43a0de8cf 100644 --- a/rest/admin/__tests__/2022-10/location.test.ts +++ b/rest/admin/__tests__/2022-10/location.test.ts @@ -31,7 +31,7 @@ describe('Location resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"locations": [{"id": 655441491, "name": "50 Rideau Street", "address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "zip": "K1N 9J7", "province": "Ontario", "country": "CA", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "CA", "country_name": "Canada", "province_code": "ON", "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/655441491", "localized_country_name": "Canada", "localized_province_name": "Ontario"}, {"id": 24826418, "name": "Apple Api Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/24826418", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 844681632, "name": "Apple Cupertino", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/844681632", "localized_country_name": "United States", "localized_province_name": null}, {"id": 611870435, "name": "Apple Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/611870435", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322", "localized_country_name": "United States", "localized_province_name": null}]})); + queueMockResponse(JSON.stringify({"locations": [{"id": 655441491, "name": "50 Rideau Street", "address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "zip": "K1N 9J7", "province": "Ontario", "country": "CA", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "CA", "country_name": "Canada", "province_code": "ON", "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/655441491", "localized_country_name": "Canada", "localized_province_name": "Ontario"}, {"id": 24826418, "name": "Apple Api Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/24826418", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 844681632, "name": "Apple Cupertino", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/844681632", "localized_country_name": "United States", "localized_province_name": null}, {"id": 611870435, "name": "Apple Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/611870435", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322", "localized_country_name": "United States", "localized_province_name": null}]})); await shopify.rest.Location.all({ session: session, @@ -48,7 +48,7 @@ describe('Location resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"location": {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322"}})); + queueMockResponse(JSON.stringify({"location": {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322"}})); await shopify.rest.Location.find({ session: session, @@ -83,7 +83,7 @@ describe('Location resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 487838322, "available": 18, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 487838322, "available": 36, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2022-10-03T12:44:45-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}]})); + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 487838322, "available": 18, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 487838322, "available": 36, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}]})); await shopify.rest.Location.inventory_levels({ session: session, diff --git a/rest/admin/__tests__/2022-10/locations_for_move.test.ts b/rest/admin/__tests__/2022-10/locations_for_move.test.ts index 358d307a0..ca8187aec 100644 --- a/rest/admin/__tests__/2022-10/locations_for_move.test.ts +++ b/rest/admin/__tests__/2022-10/locations_for_move.test.ts @@ -35,13 +35,13 @@ describe('LocationsForMove resource', () => { await shopify.rest.LocationsForMove.all({ session: session, - fulfillment_order_id: 1046000830, + fulfillment_order_id: 1046000829, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/fulfillment_orders/1046000830/locations_for_move.json', + path: '/admin/api/2022-10/fulfillment_orders/1046000829/locations_for_move.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/marketing_event.test.ts b/rest/admin/__tests__/2022-10/marketing_event.test.ts index fb3f3b2d2..e9c5bc1db 100644 --- a/rest/admin/__tests__/2022-10/marketing_event.test.ts +++ b/rest/admin/__tests__/2022-10/marketing_event.test.ts @@ -31,7 +31,7 @@ describe('MarketingEvent resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"marketing_events": [{"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2022-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}]})); + queueMockResponse(JSON.stringify({"marketing_events": [{"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2023-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}]})); await shopify.rest.MarketingEvent.all({ session: session, @@ -48,11 +48,11 @@ describe('MarketingEvent resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"marketing_event": {"id": 1069063883, "event_type": "ad", "remote_id": null, "started_at": "2022-12-15T00:00:00-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": null, "currency": null, "manage_url": null, "preview_url": null, "utm_campaign": "Christmas2022", "utm_source": "facebook", "utm_medium": "cpc", "budget_type": null, "description": null, "marketing_channel": "social", "paid": true, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": 1063897333, "admin_graphql_api_id": "gid://shopify/MarketingEvent/1069063883", "marketed_resources": []}})); + queueMockResponse(JSON.stringify({"marketing_event": {"id": 1069063883, "event_type": "ad", "remote_id": null, "started_at": "2023-12-14T19:00:00-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": null, "currency": null, "manage_url": null, "preview_url": null, "utm_campaign": "Christmas2023", "utm_source": "facebook", "utm_medium": "cpc", "budget_type": null, "description": null, "marketing_channel": "social", "paid": true, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": 1063897333, "admin_graphql_api_id": "gid://shopify/MarketingEvent/1069063883", "marketed_resources": []}})); const marketing_event = new shopify.rest.MarketingEvent({session: session}); - marketing_event.started_at = "2022-12-15"; - marketing_event.utm_campaign = "Christmas2022"; + marketing_event.started_at = "2023-12-15"; + marketing_event.utm_campaign = "Christmas2023"; marketing_event.utm_source = "facebook"; marketing_event.utm_medium = "cpc"; marketing_event.event_type = "ad"; @@ -67,7 +67,7 @@ describe('MarketingEvent resource', () => { path: '/admin/api/2022-10/marketing_events.json', query: '', headers, - data: { "marketing_event": {"started_at": "2022-12-15", "utm_campaign": "Christmas2022", "utm_source": "facebook", "utm_medium": "cpc", "event_type": "ad", "referring_domain": "facebook.com", "marketing_channel": "social", "paid": true} } + data: { "marketing_event": {"started_at": "2023-12-15", "utm_campaign": "Christmas2023", "utm_source": "facebook", "utm_medium": "cpc", "event_type": "ad", "referring_domain": "facebook.com", "marketing_channel": "social", "paid": true} } }).toMatchMadeHttpRequest(); }); @@ -89,7 +89,7 @@ describe('MarketingEvent resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"marketing_event": {"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2022-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + queueMockResponse(JSON.stringify({"marketing_event": {"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2023-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); await shopify.rest.MarketingEvent.find({ session: session, @@ -107,14 +107,14 @@ describe('MarketingEvent resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"marketing_event": {"started_at": "2022-02-01T19:00:00-05:00", "ended_at": "2022-02-02T19:00:00-05:00", "scheduled_to_end_at": "2022-02-03T19:00:00-05:00", "remote_id": "1000:2000", "currency": "CAD", "budget": "11.1", "budget_type": "daily", "id": 998730532, "event_type": "post", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + queueMockResponse(JSON.stringify({"marketing_event": {"started_at": "2023-02-01T19:00:00-05:00", "ended_at": "2023-02-02T19:00:00-05:00", "scheduled_to_end_at": "2023-02-03T19:00:00-05:00", "remote_id": "1000:2000", "currency": "CAD", "budget": "11.1", "budget_type": "daily", "id": 998730532, "event_type": "post", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); const marketing_event = new shopify.rest.MarketingEvent({session: session}); marketing_event.id = 998730532; marketing_event.remote_id = "1000:2000"; - marketing_event.started_at = "2022-02-02T00:00 +00:00"; - marketing_event.ended_at = "2022-02-03T00:00 +00:00"; - marketing_event.scheduled_to_end_at = "2022-02-04T00:00 +00:00"; + marketing_event.started_at = "2023-02-02T00:00 +00:00"; + marketing_event.ended_at = "2023-02-03T00:00 +00:00"; + marketing_event.scheduled_to_end_at = "2023-02-04T00:00 +00:00"; marketing_event.budget = "11.1"; marketing_event.budget_type = "daily"; marketing_event.currency = "CAD"; @@ -131,7 +131,7 @@ describe('MarketingEvent resource', () => { path: '/admin/api/2022-10/marketing_events/998730532.json', query: '', headers, - data: { "marketing_event": {"remote_id": "1000:2000", "started_at": "2022-02-02T00:00 +00:00", "ended_at": "2022-02-03T00:00 +00:00", "scheduled_to_end_at": "2022-02-04T00:00 +00:00", "budget": "11.1", "budget_type": "daily", "currency": "CAD", "utm_campaign": "other", "utm_source": "other", "utm_medium": "other", "event_type": "ad", "referring_domain": "instagram.com"} } + data: { "marketing_event": {"remote_id": "1000:2000", "started_at": "2023-02-02T00:00 +00:00", "ended_at": "2023-02-03T00:00 +00:00", "scheduled_to_end_at": "2023-02-04T00:00 +00:00", "budget": "11.1", "budget_type": "daily", "currency": "CAD", "utm_campaign": "other", "utm_source": "other", "utm_medium": "other", "event_type": "ad", "referring_domain": "instagram.com"} } }).toMatchMadeHttpRequest(); }); @@ -154,12 +154,12 @@ describe('MarketingEvent resource', () => { }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"engagements": [{"occurred_on": "2022-01-15", "fetched_at": null, "views_count": 0, "impressions_count": null, "clicks_count": 0, "favorites_count": 0, "comments_count": null, "shares_count": null, "ad_spend": "10.0", "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2022-01-16", "fetched_at": null, "views_count": 100, "impressions_count": null, "clicks_count": 50, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2022-01-17", "fetched_at": null, "views_count": 200, "impressions_count": null, "clicks_count": 100, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}]})); + queueMockResponse(JSON.stringify({"engagements": [{"occurred_on": "2023-01-15", "fetched_at": null, "views_count": 0, "impressions_count": null, "clicks_count": 0, "favorites_count": 0, "comments_count": null, "shares_count": null, "ad_spend": "10.0", "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2023-01-16", "fetched_at": null, "views_count": 100, "impressions_count": null, "clicks_count": 50, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2023-01-17", "fetched_at": null, "views_count": 200, "impressions_count": null, "clicks_count": 100, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}]})); const marketing_event = new shopify.rest.MarketingEvent({session: session}); marketing_event.id = 998730532; await marketing_event.engagements({ - body: {"engagements": [{"occurred_on": "2022-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2022-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2022-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]}, + body: {"engagements": [{"occurred_on": "2023-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2023-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2023-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]}, }); expect({ @@ -168,7 +168,7 @@ describe('MarketingEvent resource', () => { path: '/admin/api/2022-10/marketing_events/998730532/engagements.json', query: '', headers, - data: {"engagements": [{"occurred_on": "2022-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2022-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2022-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]} + data: {"engagements": [{"occurred_on": "2023-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2023-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2023-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]} }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/metafield.test.ts b/rest/admin/__tests__/2022-10/metafield.test.ts index 0361b86cd..18fbe67a3 100644 --- a/rest/admin/__tests__/2022-10/metafield.test.ts +++ b/rest/admin/__tests__/2022-10/metafield.test.ts @@ -49,25 +49,25 @@ describe('Metafield resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 51714266, "namespace": "my_namespace", "key": "my_key", "value": "Hello", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/51714266"}, {"id": 116539875, "namespace": "descriptors", "key": "subtitle", "value": "The best ipod", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/116539875"}, {"id": 263497237, "namespace": "installments", "key": "disable", "value": true, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/263497237"}, {"id": 273160493, "namespace": "facts", "key": "isbn", "value": "978-0-14-004259-7", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/273160493"}, {"id": 524118066, "namespace": "facts", "key": "ean", "value": "0123456789012", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/524118066"}, {"id": 543636738, "namespace": "reviews", "key": "rating_count", "value": 1, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/543636738"}, {"id": 572384404, "namespace": "reviews", "key": "rating", "value": "{\"value\": \"3.5\", \"scale_min\": \"1.0\", \"scale_max\": \"5.0\"}", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "rating", "admin_graphql_api_id": "gid://shopify/Metafield/572384404"}, {"id": 613330208, "namespace": "shopify_filter", "key": "display", "value": "retina", "description": "This field keeps track of the type of display", "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/613330208"}, {"id": 779326701, "namespace": "facts", "key": "upc", "value": "012345678901", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/779326701"}, {"id": 845366454, "namespace": "translations", "key": "title_fr", "value": "produit", "description": "French product title", "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/845366454"}, {"id": 861799889, "namespace": "my_other_fields", "key": "organic", "value": true, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/861799889"}, {"id": 870326793, "namespace": "descriptors", "key": "care_guide", "value": "Wash in cold water", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": null, "admin_graphql_api_id": "gid://shopify/Metafield/870326793"}, {"id": 908250163, "namespace": "my_other_fields", "key": "shipping_policy", "value": "Ships for free in Canada", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/908250163"}, {"id": 925288667, "namespace": "my_other_fields", "key": "year_released", "value": 2019, "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/925288667"}, {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}, {"id": 1029402048, "namespace": "my_other_fields", "key": "ingredients", "value": "[\"apple\", \"music\", \"u2\"]", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "list.single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1029402048"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 519046726, "namespace": "notes", "key": "descriptionription", "value": "Collection description", "description": "Custom Collection notes", "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/519046726"}, {"id": 624849518, "namespace": "global", "key": "description_tag", "value": "Some seo description value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/624849518"}, {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "632910392", "owner_resource": "product"}, + metafield: {"owner_id": "482865238", "owner_resource": "collection"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/metafields.json', - query: 'metafield%5Bowner_id%5D=632910392&metafield%5Bowner_resource%5D=product', + query: 'metafield%5Bowner_id%5D=482865238&metafield%5Bowner_resource%5D=collection', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}]})); await shopify.rest.Metafield.all({ session: session, @@ -85,7 +85,7 @@ describe('Metafield resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}]})); await shopify.rest.Metafield.all({ session: session, @@ -103,7 +103,7 @@ describe('Metafield resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}]})); await shopify.rest.Metafield.all({ session: session, @@ -121,54 +121,54 @@ describe('Metafield resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 1063298188, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2022-10-03T12:17:58-04:00", "updated_at": "2022-10-03T12:17:58-04:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1063298188"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 51714266, "namespace": "my_namespace", "key": "my_key", "value": "Hello", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/51714266"}, {"id": 116539875, "namespace": "descriptors", "key": "subtitle", "value": "The best ipod", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/116539875"}, {"id": 263497237, "namespace": "installments", "key": "disable", "value": true, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/263497237"}, {"id": 273160493, "namespace": "facts", "key": "isbn", "value": "978-0-14-004259-7", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/273160493"}, {"id": 524118066, "namespace": "facts", "key": "ean", "value": "0123456789012", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/524118066"}, {"id": 543636738, "namespace": "reviews", "key": "rating_count", "value": 1, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/543636738"}, {"id": 572384404, "namespace": "reviews", "key": "rating", "value": "{\"value\": \"3.5\", \"scale_min\": \"1.0\", \"scale_max\": \"5.0\"}", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "rating", "admin_graphql_api_id": "gid://shopify/Metafield/572384404"}, {"id": 613330208, "namespace": "shopify_filter", "key": "display", "value": "retina", "description": "This field keeps track of the type of display", "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/613330208"}, {"id": 779326701, "namespace": "facts", "key": "upc", "value": "012345678901", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/779326701"}, {"id": 845366454, "namespace": "translations", "key": "title_fr", "value": "produit", "description": "French product title", "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/845366454"}, {"id": 861799889, "namespace": "my_other_fields", "key": "organic", "value": true, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/861799889"}, {"id": 870326793, "namespace": "descriptors", "key": "care_guide", "value": "Wash in cold water", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": null, "admin_graphql_api_id": "gid://shopify/Metafield/870326793"}, {"id": 908250163, "namespace": "my_other_fields", "key": "shipping_policy", "value": "Ships for free in Canada", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/908250163"}, {"id": 925288667, "namespace": "my_other_fields", "key": "year_released", "value": 2019, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/925288667"}, {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}, {"id": 1029402048, "namespace": "my_other_fields", "key": "ingredients", "value": "[\"apple\", \"music\", \"u2\"]", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "list.single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1029402048"}]})); await shopify.rest.Metafield.all({ session: session, - since_id: "721389482", + metafield: {"owner_id": "632910392", "owner_resource": "product"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/metafields.json', - query: 'since_id=721389482', + query: 'metafield%5Bowner_id%5D=632910392&metafield%5Bowner_resource%5D=product', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"metafields": []})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "674387490", "owner_resource": "article"}, + metafield: {"owner_id": "850703190", "owner_resource": "product_image"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/metafields.json', - query: 'metafield%5Bowner_id%5D=674387490&metafield%5Bowner_resource%5D=article', + query: 'metafield%5Bowner_id%5D=850703190&metafield%5Bowner_resource%5D=product_image', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 519046726, "namespace": "notes", "key": "descriptionription", "value": "Collection description", "description": "Custom Collection notes", "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/519046726"}, {"id": 624849518, "namespace": "global", "key": "description_tag", "value": "Some seo description value", "description": null, "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/624849518"}, {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}]})); + queueMockResponse(JSON.stringify({"metafields": []})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "482865238", "owner_resource": "collection"}, + metafield: {"owner_id": "49148385", "owner_resource": "variants"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/metafields.json', - query: 'metafield%5Bowner_id%5D=482865238&metafield%5Bowner_resource%5D=collection', + query: 'metafield%5Bowner_id%5D=49148385&metafield%5Bowner_resource%5D=variants', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -179,234 +179,447 @@ describe('Metafield resource', () => { await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "49148385", "owner_resource": "variants"}, + metafield: {"owner_id": "674387490", "owner_resource": "article"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/metafields.json', - query: 'metafield%5Bowner_id%5D=49148385&metafield%5Bowner_resource%5D=variants', + query: 'metafield%5Bowner_id%5D=674387490&metafield%5Bowner_resource%5D=article', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}]})); await shopify.rest.Metafield.all({ session: session, + metafield: {"owner_id": "450789469", "owner_resource": "order"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/metafields.json', - query: '', + query: 'metafield%5Bowner_id%5D=450789469&metafield%5Bowner_resource%5D=order', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "450789469", "owner_resource": "order"}, }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/metafields.json', - query: 'metafield%5Bowner_id%5D=450789469&metafield%5Bowner_resource%5D=order', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"metafields": [{"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}]})); + queueMockResponse(JSON.stringify({"metafields": [{"id": 1069229006, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:53:15-05:00", "updated_at": "2023-01-03T12:53:15-05:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069229006"}]})); await shopify.rest.Metafield.all({ session: session, - metafield: {"owner_id": "850703190", "owner_resource": "product_image"}, + since_id: "721389482", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/metafields.json', - query: 'metafield%5Bowner_id%5D=850703190&metafield%5Bowner_resource%5D=product_image', + query: 'since_id=721389482', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228998, "namespace": "my_fields", "key": "sponsor", "value": "Shopify", "description": null, "owner_id": 382285388, "created_at": "2023-01-03T12:52:48-05:00", "updated_at": "2023-01-03T12:52:48-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228998"}})); - await shopify.rest.Metafield.count({ - session: session, - page_id: 131092082, - }); + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.namespace = "my_fields"; + metafield.key = "sponsor"; + metafield.type = "single_line_text_field"; + metafield.value = "Shopify"; + await metafield.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/pages/131092082/metafields/count.json', + path: '/admin/api/2022-10/blogs/382285388/metafields.json', query: '', headers, - data: undefined + data: { "metafield": {"namespace": "my_fields", "key": "sponsor", "type": "single_line_text_field", "value": "Shopify"} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"count": 3})); + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228972, "namespace": "my_fields", "key": "discount", "value": "25%", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:50:28-05:00", "updated_at": "2023-01-03T12:50:28-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228972"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.namespace = "my_fields"; + metafield.key = "discount"; + metafield.type = "single_line_text_field"; + metafield.value = "25%"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/collections/482865238/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "discount", "type": "single_line_text_field", "value": "25%"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228983, "namespace": "discounts", "key": "special", "value": "yes", "description": null, "owner_id": 207119551, "created_at": "2023-01-03T12:51:01-05:00", "updated_at": "2023-01-03T12:51:01-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228983"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.namespace = "discounts"; + metafield.key = "special"; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/customers/207119551/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "discounts", "key": "special", "value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069229003, "namespace": "my_fields", "key": "purchase_order", "value": "97453", "description": null, "owner_id": 622762746, "created_at": "2023-01-03T12:53:03-05:00", "updated_at": "2023-01-03T12:53:03-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069229003"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "97453"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/draft_orders/622762746/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "97453"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228969, "namespace": "my_fields", "key": "subtitle", "value": "A subtitle for my page", "description": null, "owner_id": 131092082, "created_at": "2023-01-03T12:49:57-05:00", "updated_at": "2023-01-03T12:49:57-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228969"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.namespace = "my_fields"; + metafield.key = "subtitle"; + metafield.type = "single_line_text_field"; + metafield.value = "A subtitle for my page"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/pages/131092082/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "subtitle", "type": "single_line_text_field", "value": "A subtitle for my page"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228994, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:51:54-05:00", "updated_at": "2023-01-03T12:51:54-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228994"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.namespace = "inventory"; + metafield.key = "warehouse"; + metafield.value = 25; + metafield.type = "number_integer"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/products/632910392/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "inventory", "key": "warehouse", "value": 25, "type": "number_integer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228985, "namespace": "translaction", "key": "title_spanish", "value": "botas", "description": null, "owner_id": 850703190, "created_at": "2023-01-03T12:51:06-05:00", "updated_at": "2023-01-03T12:51:06-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228985"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.namespace = "translaction"; + metafield.key = "title_spanish"; + metafield.type = "single_line_text_field"; + metafield.value = "botas"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/product_images/850703190/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "translaction", "key": "title_spanish", "type": "single_line_text_field", "value": "botas"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228995, "namespace": "my_fields", "key": "liner_material", "value": "synthetic leather", "description": null, "owner_id": 49148385, "created_at": "2023-01-03T12:52:21-05:00", "updated_at": "2023-01-03T12:52:21-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228995"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.namespace = "my_fields"; + metafield.key = "liner_material"; + metafield.type = "single_line_text_field"; + metafield.value = "synthetic leather"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/variants/49148385/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "liner_material", "type": "single_line_text_field", "value": "synthetic leather"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228982, "namespace": "my_fields", "key": "category", "value": "outdoors", "description": null, "owner_id": 674387490, "created_at": "2023-01-03T12:50:58-05:00", "updated_at": "2023-01-03T12:50:58-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228982"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.namespace = "my_fields"; + metafield.key = "category"; + metafield.type = "single_line_text_field"; + metafield.value = "outdoors"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/articles/674387490/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "category", "type": "single_line_text_field", "value": "outdoors"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069229001, "namespace": "my_fields", "key": "purchase_order", "value": "123", "description": null, "owner_id": 450789469, "created_at": "2023-01-03T12:52:57-05:00", "updated_at": "2023-01-03T12:52:57-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069229001"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "123"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/orders/450789469/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "123"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228973, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:50:31-05:00", "updated_at": "2023-01-03T12:50:31-05:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228973"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.namespace = "inventory"; + metafield.key = "warehouse"; + metafield.value = 25; + metafield.type = "number_integer"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "inventory", "key": "warehouse", "value": 25, "type": "number_integer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + queueMockResponse(JSON.stringify({"count": 0})); await shopify.rest.Metafield.count({ session: session, - collection_id: 482865238, + blog_id: 382285388, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/collections/482865238/metafields/count.json', + path: '/admin/api/2022-10/blogs/382285388/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_15', async () => { - queueMockResponse(JSON.stringify({"count": 0})); + it('test_25', async () => { + queueMockResponse(JSON.stringify({"count": 3})); await shopify.rest.Metafield.count({ session: session, - variant_id: 49148385, + collection_id: 482865238, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/variants/49148385/metafields/count.json', + path: '/admin/api/2022-10/collections/482865238/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_16', async () => { + it('test_26', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - order_id: 450789469, + customer_id: 207119551, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/orders/450789469/metafields/count.json', + path: '/admin/api/2022-10/customers/207119551/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_17', async () => { + it('test_27', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, + draft_order_id: 622762746, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/metafields/count.json', + path: '/admin/api/2022-10/draft_orders/622762746/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_18', async () => { + it('test_28', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - draft_order_id: 622762746, + page_id: 131092082, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/draft_orders/622762746/metafields/count.json', + path: '/admin/api/2022-10/pages/131092082/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_19', async () => { - queueMockResponse(JSON.stringify({"count": 0})); + it('test_29', async () => { + queueMockResponse(JSON.stringify({"count": 16})); await shopify.rest.Metafield.count({ session: session, - blog_id: 382285388, + product_id: 632910392, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/blogs/382285388/metafields/count.json', + path: '/admin/api/2022-10/products/632910392/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_20', async () => { + it('test_30', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - customer_id: 207119551, + product_image_id: 850703190, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/customers/207119551/metafields/count.json', + path: '/admin/api/2022-10/product_images/850703190/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_21', async () => { - queueMockResponse(JSON.stringify({"count": 16})); + it('test_31', async () => { + queueMockResponse(JSON.stringify({"count": 0})); await shopify.rest.Metafield.count({ session: session, - product_id: 632910392, + variant_id: 49148385, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/products/632910392/metafields/count.json', + path: '/admin/api/2022-10/variants/49148385/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_22', async () => { + it('test_32', async () => { queueMockResponse(JSON.stringify({"count": 0})); await shopify.rest.Metafield.count({ @@ -424,64 +637,62 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_23', async () => { + it('test_33', async () => { queueMockResponse(JSON.stringify({"count": 1})); await shopify.rest.Metafield.count({ session: session, - product_image_id: 850703190, + order_id: 450789469, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/product_images/850703190/metafields/count.json', + path: '/admin/api/2022-10/orders/450789469/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_24', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 323119633, "namespace": "my_fields", "key": "color", "value": "Pink", "description": null, "owner_id": 808950810, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + it('test_34', async () => { + queueMockResponse(JSON.stringify({"count": 1})); - await shopify.rest.Metafield.find({ + await shopify.rest.Metafield.count({ session: session, - variant_id: 49148385, - id: 323119633, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/variants/49148385/metafields/323119633.json', + path: '/admin/api/2022-10/metafields/count.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_25', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + it('test_35', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 534526895, "namespace": "translation", "key": "title_fr", "value": "Le iPod", "description": "Blog French title translation", "owner_id": 241253187, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); await shopify.rest.Metafield.find({ session: session, - product_image_id: 850703190, - id: 625663657, + blog_id: 382285388, + id: 534526895, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/product_images/850703190/metafields/625663657.json', + path: '/admin/api/2022-10/blogs/382285388/metafields/534526895.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_26', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + it('test_36', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); await shopify.rest.Metafield.find({ session: session, @@ -499,8 +710,27 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_27', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + it('test_37', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + await shopify.rest.Metafield.find({ + session: session, + customer_id: 207119551, + id: 220591908, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2022-10/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_38', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); await shopify.rest.Metafield.find({ session: session, @@ -518,102 +748,103 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_28', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + it('test_39', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); await shopify.rest.Metafield.find({ session: session, - product_id: 632910392, - id: 1001077698, + page_id: 131092082, + id: 290519330, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/products/632910392/metafields/1001077698.json', + path: '/admin/api/2022-10/pages/131092082/metafields/290519330.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_29', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + it('test_40', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); await shopify.rest.Metafield.find({ session: session, - id: 721389482, + product_id: 632910392, + id: 1001077698, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/metafields/721389482.json', + path: '/admin/api/2022-10/products/632910392/metafields/1001077698.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_30', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + it('test_41', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); await shopify.rest.Metafield.find({ session: session, - customer_id: 207119551, - id: 220591908, + product_image_id: 850703190, + id: 625663657, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/customers/207119551/metafields/220591908.json', + path: '/admin/api/2022-10/product_images/850703190/metafields/625663657.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_31', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 534526895, "namespace": "translation", "key": "title_fr", "value": "Le iPod", "description": "Blog French title translation", "owner_id": 241253187, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + it('test_42', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 323119633, "namespace": "my_fields", "key": "color", "value": "Pink", "description": null, "owner_id": 808950810, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); await shopify.rest.Metafield.find({ session: session, - blog_id: 382285388, - id: 534526895, + variant_id: 49148385, + id: 323119633, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/blogs/382285388/metafields/534526895.json', + path: '/admin/api/2022-10/variants/49148385/metafields/323119633.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_32', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + it('test_43', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 838981074, "namespace": "translation", "key": "title_fr", "value": "Le Article", "description": "Article French title translation", "owner_id": 134645308, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); await shopify.rest.Metafield.find({ session: session, - page_id: 131092082, - id: 290519330, + article_id: 674387490, + id: 838981074, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/pages/131092082/metafields/290519330.json', + path: '/admin/api/2022-10/articles/674387490/metafields/838981074.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_33', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + it('test_44', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); await shopify.rest.Metafield.find({ session: session, @@ -631,64 +862,282 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_34', async () => { - queueMockResponse(JSON.stringify({"metafield": {"id": 838981074, "namespace": "translation", "key": "title_fr", "value": "Le Article", "description": "Article French title translation", "owner_id": 134645308, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + it('test_45', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); await shopify.rest.Metafield.find({ session: session, - article_id: 674387490, - id: 838981074, + id: 721389482, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/articles/674387490/metafields/838981074.json', + path: '/admin/api/2022-10/metafields/721389482.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_35', async () => { + it('test_46', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated blog title", "owner_id": 241253187, "namespace": "translation", "key": "title_fr", "id": 534526895, "description": "Blog French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:53:17-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.id = 534526895; + metafield.value = "a translated blog title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/blogs/382285388/metafields/534526895.json', + query: '', + headers, + data: { "metafield": {"value": "a translated blog title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_47', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "seo title", "owner_id": 482865238, "namespace": "global", "key": "title_tag", "id": 1010236510, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:49:17-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.id = 1010236510; + metafield.value = "seo title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/collections/482865238/metafields/1010236510.json', + query: '', + headers, + data: { "metafield": {"value": "seo title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_48', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "yes", "owner_id": 207119551, "namespace": "discounts", "key": "returning_customer", "id": 220591908, "description": "Customer deserves discount", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:50:56-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.id = 220591908; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: { "metafield": {"value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_49', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "110000", "owner_id": 622762746, "namespace": "notes", "key": "note", "id": 106172460, "description": "This is for notes", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:51:31-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.id = 106172460; + metafield.value = "110000"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/draft_orders/622762746/metafields/106172460.json', + query: '', + headers, + data: { "metafield": {"value": "110000", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_50', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "An updated translation", "owner_id": 131092082, "namespace": "translation", "key": "title_fr", "id": 290519330, "description": "Page French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:39-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.id = 290519330; + metafield.value = "An updated translation"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/pages/131092082/metafields/290519330.json', + query: '', + headers, + data: { "metafield": {"value": "An updated translation", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_51', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "having fun", "owner_id": 632910392, "namespace": "my_fields", "key": "best_for", "id": 1001077698, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:51:25-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.id = 1001077698; + metafield.value = "having fun"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/products/632910392/metafields/1001077698.json', + query: '', + headers, + data: { "metafield": {"value": "having fun", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_52', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "translated description", "owner_id": 850703190, "namespace": "translation", "key": "title_fr", "id": 625663657, "description": "French product image title", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:31-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.id = 625663657; + metafield.value = "translated description"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/product_images/850703190/metafields/625663657.json', + query: '', + headers, + data: { "metafield": {"value": "translated description", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_53', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "Red", "owner_id": 808950810, "namespace": "my_fields", "key": "color", "id": 323119633, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:53:00-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.id = 323119633; + metafield.value = "Red"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/variants/49148385/metafields/323119633.json', + query: '', + headers, + data: { "metafield": {"value": "Red", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_54', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "something new", "owner_id": 548380009, "namespace": "affiliates", "key": "app_key", "id": 721389482, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:02-05:00", "owner_resource": "shop", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.id = 721389482; + metafield.value = "something new"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/metafields/721389482.json', + query: '', + headers, + data: { "metafield": {"value": "something new", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_55', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated title", "owner_id": 134645308, "namespace": "translation", "key": "title_fr", "id": 838981074, "description": "Article French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:50:36-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.id = 838981074; + metafield.value = "a translated title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/articles/674387490/metafields/838981074.json', + query: '', + headers, + data: { "metafield": {"value": "a translated title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_56', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "Provided a discount code", "owner_id": 450789469, "namespace": "notes", "key": "buyer", "id": 915396079, "description": "This field is for buyer notes", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:49:41-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.id = 915396079; + metafield.value = "Provided a discount code"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2022-10/orders/450789469/metafields/915396079.json', + query: '', + headers, + data: { "metafield": {"value": "Provided a discount code", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_57', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - product_image_id: 850703190, - id: 625663657, + blog_id: 382285388, + id: 534526895, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/product_images/850703190/metafields/625663657.json', + path: '/admin/api/2022-10/blogs/382285388/metafields/534526895.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_36', async () => { + it('test_58', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - draft_order_id: 622762746, - id: 106172460, + collection_id: 482865238, + id: 1010236510, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/draft_orders/622762746/metafields/106172460.json', + path: '/admin/api/2022-10/collections/482865238/metafields/1010236510.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_37', async () => { + it('test_59', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ @@ -707,120 +1156,121 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_38', async () => { + it('test_60', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - collection_id: 482865238, - id: 1010236510, + draft_order_id: 622762746, + id: 106172460, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/collections/482865238/metafields/1010236510.json', + path: '/admin/api/2022-10/draft_orders/622762746/metafields/106172460.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_39', async () => { + it('test_61', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - blog_id: 382285388, - id: 534526895, + page_id: 131092082, + id: 290519330, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/blogs/382285388/metafields/534526895.json', + path: '/admin/api/2022-10/pages/131092082/metafields/290519330.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_40', async () => { + it('test_62', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - id: 721389482, + product_id: 632910392, + id: 1001077698, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/metafields/721389482.json', + path: '/admin/api/2022-10/products/632910392/metafields/1001077698.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_41', async () => { + it('test_63', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - variant_id: 49148385, - id: 323119633, + product_image_id: 850703190, + id: 625663657, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/variants/49148385/metafields/323119633.json', + path: '/admin/api/2022-10/product_images/850703190/metafields/625663657.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_42', async () => { + it('test_64', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - page_id: 131092082, - id: 290519330, + variant_id: 49148385, + id: 323119633, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/pages/131092082/metafields/290519330.json', + path: '/admin/api/2022-10/variants/49148385/metafields/323119633.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_43', async () => { + it('test_65', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - product_id: 632910392, - id: 1001077698, + article_id: 674387490, + id: 838981074, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/products/632910392/metafields/1001077698.json', + path: '/admin/api/2022-10/articles/674387490/metafields/838981074.json', query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); - it('test_44', async () => { + it('test_66', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ @@ -839,19 +1289,18 @@ describe('Metafield resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_45', async () => { + it('test_67', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Metafield.delete({ session: session, - article_id: 674387490, - id: 838981074, + id: 721389482, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/articles/674387490/metafields/838981074.json', + path: '/admin/api/2022-10/metafields/721389482.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/mobile_platform_application.test.ts b/rest/admin/__tests__/2022-10/mobile_platform_application.test.ts index fecab2bcc..9b30537c0 100644 --- a/rest/admin/__tests__/2022-10/mobile_platform_application.test.ts +++ b/rest/admin/__tests__/2022-10/mobile_platform_application.test.ts @@ -31,7 +31,7 @@ describe('MobilePlatformApplication resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_applications": [{"id": 1066176058, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:58-05:00", "updated_at": "2022-11-29T17:07:58-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true}, {"id": 1066176059, "application_id": "com.example", "platform": "android", "created_at": "2022-11-29T17:07:58-05:00", "updated_at": "2022-11-29T17:07:58-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false}]})); + queueMockResponse(JSON.stringify({"mobile_platform_applications": [{"id": 1066175996, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:47-05:00", "updated_at": "2023-01-03T12:42:47-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}, {"id": 1066175997, "application_id": "com.example", "platform": "android", "created_at": "2023-01-03T12:42:47-05:00", "updated_at": "2023-01-03T12:42:47-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}]})); await shopify.rest.MobilePlatformApplication.all({ session: session, @@ -48,7 +48,7 @@ describe('MobilePlatformApplication resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176055, "application_id": "com.example", "platform": "android", "created_at": "2022-11-29T17:07:53-05:00", "updated_at": "2022-11-29T17:07:53-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176002, "application_id": "com.example", "platform": "android", "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:42:58-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); mobile_platform_application.platform = "android"; @@ -70,7 +70,7 @@ describe('MobilePlatformApplication resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176052, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:49-05:00", "updated_at": "2022-11-29T17:07:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176000, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:54-05:00", "updated_at": "2023-01-03T12:42:54-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); mobile_platform_application.platform = "ios"; @@ -90,17 +90,17 @@ describe('MobilePlatformApplication resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176053, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:49-05:00", "updated_at": "2022-11-29T17:07:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066175998, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:49-05:00", "updated_at": "2023-01-03T12:42:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); await shopify.rest.MobilePlatformApplication.find({ session: session, - id: 1066176053, + id: 1066175998, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/mobile_platform_applications/1066176053.json', + path: '/admin/api/2022-10/mobile_platform_applications/1066175998.json', query: '', headers, data: undefined @@ -108,52 +108,56 @@ describe('MobilePlatformApplication resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "id": 1066176057, "created_at": "2022-11-29T17:07:56-05:00", "updated_at": "2022-11-29T17:07:58-05:00"}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "id": 1066175999, "created_at": "2023-01-03T12:42:50-05:00", "updated_at": "2023-01-03T12:42:52-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); - mobile_platform_application.id = 1066176057; + mobile_platform_application.id = 1066175999; mobile_platform_application.application_id = "com.example.news.app"; mobile_platform_application.platform = "android"; - mobile_platform_application.created_at = "2022-11-29T17:07:56-05:00"; - mobile_platform_application.updated_at = "2022-11-29T17:07:56-05:00"; + mobile_platform_application.created_at = "2023-01-03T12:42:50-05:00"; + mobile_platform_application.updated_at = "2023-01-03T12:42:50-05:00"; mobile_platform_application.sha256_cert_fingerprints = [ "14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5" ]; mobile_platform_application.enabled_universal_or_app_links = true; mobile_platform_application.enabled_shared_webcredentials = false; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; await mobile_platform_application.save({}); expect({ method: 'PUT', domain, - path: '/admin/api/2022-10/mobile_platform_applications/1066176057.json', + path: '/admin/api/2022-10/mobile_platform_applications/1066175999.json', query: '', headers, - data: { "mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "created_at": "2022-11-29T17:07:56-05:00", "updated_at": "2022-11-29T17:07:56-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false} } + data: { "mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "created_at": "2023-01-03T12:42:50-05:00", "updated_at": "2023-01-03T12:42:50-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "id": 1066176054, "created_at": "2022-11-29T17:07:50-05:00", "updated_at": "2022-11-29T17:07:52-05:00"}})); + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "id": 1066176003, "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:43:00-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); - mobile_platform_application.id = 1066176054; + mobile_platform_application.id = 1066176003; mobile_platform_application.application_id = "A1B2.ca.domain.app"; mobile_platform_application.platform = "ios"; - mobile_platform_application.created_at = "2022-11-29T17:07:50-05:00"; - mobile_platform_application.updated_at = "2022-11-29T17:07:50-05:00"; + mobile_platform_application.created_at = "2023-01-03T12:42:58-05:00"; + mobile_platform_application.updated_at = "2023-01-03T12:42:58-05:00"; mobile_platform_application.sha256_cert_fingerprints = []; mobile_platform_application.enabled_universal_or_app_links = true; mobile_platform_application.enabled_shared_webcredentials = true; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; await mobile_platform_application.save({}); expect({ method: 'PUT', domain, - path: '/admin/api/2022-10/mobile_platform_applications/1066176054.json', + path: '/admin/api/2022-10/mobile_platform_applications/1066176003.json', query: '', headers, - data: { "mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "created_at": "2022-11-29T17:07:50-05:00", "updated_at": "2022-11-29T17:07:50-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true} } + data: { "mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:42:58-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null} } }).toMatchMadeHttpRequest(); }); @@ -162,13 +166,13 @@ describe('MobilePlatformApplication resource', () => { await shopify.rest.MobilePlatformApplication.delete({ session: session, - id: 1066176056, + id: 1066176001, }); expect({ method: 'DELETE', domain, - path: '/admin/api/2022-10/mobile_platform_applications/1066176056.json', + path: '/admin/api/2022-10/mobile_platform_applications/1066176001.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/order.test.ts b/rest/admin/__tests__/2022-10/order.test.ts index 98e152f56..7359f1d3c 100644 --- a/rest/admin/__tests__/2022-10/order.test.ts +++ b/rest/admin/__tests__/2022-10/order.test.ts @@ -31,7 +31,7 @@ describe('Order resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -49,7 +49,7 @@ describe('Order resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -85,7 +85,7 @@ describe('Order resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -103,7 +103,7 @@ describe('Order resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "authorized", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:49-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "authorized", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:50-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); await shopify.rest.Order.all({ session: session, @@ -121,18 +121,18 @@ describe('Order resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"orders": [{"id": 1073459967, "admin_graphql_api_id": "gid://shopify/Order/1073459967", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:13:16-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/81b17d6d6ffa8c0b72f0e55af850e748/authenticate?key=f4f59da955f9c30e59bab8cbe1d0ea6a", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:16-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "81b17d6d6ffa8c0b72f0e55af850e748", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_usd": "199.00", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:16-05:00", "user_id": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823177, "admin_graphql_api_id": "gid://shopify/LineItem/1071823177", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "refunds": [], "shipping_lines": []}]})); + queueMockResponse(JSON.stringify({"orders": [{"id": 1073459972, "admin_graphql_api_id": "gid://shopify/Order/1073459972", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:28:16-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/3598b8ae8cac731d0e7996f0d2d09e1d/authenticate?key=966f252275757105ae9b631628c76c1a", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:28:16-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "3598b8ae8cac731d0e7996f0d2d09e1d", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_usd": "199.00", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:16-05:00", "user_id": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823184, "admin_graphql_api_id": "gid://shopify/LineItem/1071823184", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "refunds": [], "shipping_lines": []}]})); await shopify.rest.Order.all({ session: session, - ids: "1073459967", + ids: "1073459972", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/orders.json', - query: 'ids=1073459967', + query: 'ids=1073459972', headers, data: undefined }).toMatchMadeHttpRequest(); @@ -158,7 +158,7 @@ describe('Order resource', () => { }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); await shopify.rest.Order.find({ session: session, @@ -212,7 +212,7 @@ describe('Order resource', () => { }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": "2022-11-28T17:12:48-05:00", "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:48-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": "2023-01-03T12:26:44-05:00", "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:44-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -229,7 +229,7 @@ describe('Order resource', () => { }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:14:32-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:29-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -246,7 +246,7 @@ describe('Order resource', () => { }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -263,7 +263,7 @@ describe('Order resource', () => { }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "bogus", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:14:20-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361463, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "created_at": "2022-11-28T17:14:20-05:00", "note": null, "order_id": 450789469, "processed_at": "2022-11-28T17:14:20-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [], "transactions": [{"id": 1068278479, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278479", "amount": "10.00", "authorization": null, "created_at": "2022-11-28T17:14:20-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278478, "payment_id": "c901414060.3", "processed_at": "2022-11-28T17:14:20-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}], "refund_line_items": [{"id": 1058498308, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498309, "line_item_id": 518995019, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498310, "line_item_id": 703073504, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "bogus", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:21-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361462, "admin_graphql_api_id": "gid://shopify/Refund/929361462", "created_at": "2023-01-03T12:27:21-05:00", "note": null, "order_id": 450789469, "processed_at": "2023-01-03T12:27:21-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [], "transactions": [{"id": 1068278471, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278471", "amount": "10.00", "authorization": null, "created_at": "2023-01-03T12:27:21-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278470, "payment_id": "c901414060.3", "processed_at": "2023-01-03T12:27:21-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}], "refund_line_items": [{"id": 1058498307, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498308, "line_item_id": 518995019, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498309, "line_item_id": 703073504, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -282,12 +282,12 @@ describe('Order resource', () => { }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "gift_card", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus", "gift_card"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:48-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361462, "admin_graphql_api_id": "gid://shopify/Refund/929361462", "created_at": "2022-11-28T17:13:48-05:00", "note": "Customer made a mistake", "order_id": 450789469, "processed_at": "2022-11-28T17:13:48-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [{"id": 1030976842, "amount": "89.64", "amount_set": {"shop_money": {"amount": "89.64", "currency_code": "USD"}, "presentment_money": {"amount": "89.64", "currency_code": "USD"}}, "kind": "refund_discrepancy", "order_id": 450789469, "reason": "Refund discrepancy", "refund_id": 929361462, "tax_amount": "0.00", "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}], "transactions": [{"id": 1068278475, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278475", "amount": "10.00", "authorization": null, "created_at": "2022-11-28T17:13:47-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278473, "payment_id": "c901414060.4", "processed_at": "2022-11-28T17:13:47-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}, {"id": 1068278476, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278476", "amount": "100.00", "authorization": null, "created_at": "2022-11-28T17:13:47-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "gift_card", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 1068278474, "payment_id": "c901414060.5", "processed_at": "2022-11-28T17:13:47-05:00", "receipt": {"gift_card_id": 1035197676, "gift_card_last_characters": "0d0d"}, "source_name": "755357713", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 1058498307, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "gift_card", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus", "gift_card"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:49-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361463, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "created_at": "2023-01-03T12:27:49-05:00", "note": "Customer made a mistake", "order_id": 450789469, "processed_at": "2023-01-03T12:27:49-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [{"id": 1030976842, "amount": "89.64", "amount_set": {"shop_money": {"amount": "89.64", "currency_code": "USD"}, "presentment_money": {"amount": "89.64", "currency_code": "USD"}}, "kind": "refund_discrepancy", "order_id": 450789469, "reason": "Refund discrepancy", "refund_id": 929361463, "tax_amount": "0.00", "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}], "transactions": [{"id": 1068278477, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278477", "amount": "10.00", "authorization": null, "created_at": "2023-01-03T12:27:48-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278475, "payment_id": "c901414060.4", "processed_at": "2023-01-03T12:27:48-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}, {"id": 1068278478, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278478", "amount": "100.00", "authorization": null, "created_at": "2023-01-03T12:27:49-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "gift_card", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 1068278476, "payment_id": "c901414060.5", "processed_at": "2023-01-03T12:27:49-05:00", "receipt": {"gift_card_id": 1035197676, "gift_card_last_characters": "0d0d"}, "source_name": "755357713", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 1058498310, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; await order.cancel({ - body: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278473, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278474, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}}, + body: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278475, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278476, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}}, }); expect({ @@ -296,12 +296,12 @@ describe('Order resource', () => { path: '/admin/api/2022-10/orders/450789469/cancel.json', query: '', headers, - data: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278473, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278474, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}} + data: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278475, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278476, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}} }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459964, "admin_graphql_api_id": "gid://shopify/Order/1073459964", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:12:59-05:00", "currency": "EUR", "current_subtotal_price": "224.97", "current_subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "current_total_duties_set": null, "current_total_price": "238.47", "current_total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "current_total_tax": "13.50", "current_total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/a11600292b5e91907c5846e0cfb3ad6f/authenticate?key=497840c834d9e9f67f790e0b61be5505", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "EUR", "processed_at": "2022-11-28T17:12:59-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "224.97", "subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "tags": "", "tax_lines": [{"price": "13.50", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "a11600292b5e91907c5846e0cfb3ad6f", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_line_items_price": "224.97", "total_line_items_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "total_outstanding": "0.00", "total_price": "238.47", "total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_tax": "13.50", "total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:59-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 3, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1300, "name": "Big Brown Bear Boots", "price": "74.99", "price_set": {"shop_money": {"amount": "74.99", "currency_code": "EUR"}, "presentment_money": {"amount": "74.99", "currency_code": "EUR"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 3, "requires_shipping": true, "sku": null, "taxable": true, "title": "Big Brown Bear Boots", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "13.50", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "rate": 0.06, "title": "State tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459962, "admin_graphql_api_id": "gid://shopify/Order/1073459962", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:26:04-05:00", "currency": "EUR", "current_subtotal_price": "224.97", "current_subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "current_total_duties_set": null, "current_total_price": "238.47", "current_total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "current_total_tax": "13.50", "current_total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/319b6019f95405472f9713cef70a99a8/authenticate?key=e81d0103ae0eb50bf94365dca29df99f", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "EUR", "processed_at": "2023-01-03T12:26:04-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "224.97", "subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "tags": "", "tax_lines": [{"price": "13.50", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "319b6019f95405472f9713cef70a99a8", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_line_items_price": "224.97", "total_line_items_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "total_outstanding": "0.00", "total_price": "238.47", "total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_tax": "13.50", "total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:04-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823172, "admin_graphql_api_id": "gid://shopify/LineItem/1071823172", "fulfillable_quantity": 3, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1300, "name": "Big Brown Bear Boots", "price": "74.99", "price_set": {"shop_money": {"amount": "74.99", "currency_code": "EUR"}, "presentment_money": {"amount": "74.99", "currency_code": "EUR"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 3, "requires_shipping": true, "sku": null, "taxable": true, "title": "Big Brown Bear Boots", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "13.50", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "rate": 0.06, "title": "State tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -341,7 +341,7 @@ describe('Order resource', () => { }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459970, "admin_graphql_api_id": "gid://shopify/Order/1073459970", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2022-11-28T17:13:25-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "partially_paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/d11dd9362564953962cadfdddd0c0935/authenticate?key=efac2a267fb959addd217bdd2b351c7d", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:25-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "d11dd9362564953962cadfdddd0c0935", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "149.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:25-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339457, "email": "paul.norman@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:25-05:00", "updated_at": "2022-11-28T17:13:26-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:25-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339457", "default_address": {"id": 1053317288, "customer_id": 1073339457, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823182, "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459968, "admin_graphql_api_id": "gid://shopify/Order/1073459968", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2023-01-03T12:27:26-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "partially_paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/668a72716da908e6a2e789db29dbedd6/authenticate?key=c0faefec830fe2bad8902a643f111263", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:26-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "668a72716da908e6a2e789db29dbedd6", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "149.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:26-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339475, "email": "paul.norman@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:26-05:00", "updated_at": "2023-01-03T12:27:26-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:26-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339475", "default_address": {"id": 1053317307, "customer_id": 1073339475, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823178, "admin_graphql_api_id": "gid://shopify/LineItem/1071823178", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -397,7 +397,7 @@ describe('Order resource', () => { }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459966, "admin_graphql_api_id": "gid://shopify/Order/1073459966", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2022-11-28T17:13:12-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "pending", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/e4ba4f4434be3f23a5dc574958531a6b/authenticate?key=b6e7804ea89d507bc7e3d112e75a85d3", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:12-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "e4ba4f4434be3f23a5dc574958531a6b", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:12-05:00", "user_id": null, "billing_address": null, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:13:12-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2022-11-28T17:11:25-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823176, "admin_graphql_api_id": "gid://shopify/LineItem/1071823176", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459965, "admin_graphql_api_id": "gid://shopify/Order/1073459965", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2023-01-03T12:26:32-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "pending", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/c7b936bf26ad5a982dcfa44a5685c79d/authenticate?key=94ef0aea48ebaa2a5c5ca9e24d1e6636", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:26:32-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "c7b936bf26ad5a982dcfa44a5685c79d", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:32-05:00", "user_id": null, "billing_address": null, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:26:33-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823175, "admin_graphql_api_id": "gid://shopify/LineItem/1071823175", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -423,7 +423,7 @@ describe('Order resource', () => { }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459973, "admin_graphql_api_id": "gid://shopify/Order/1073459973", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2022-11-28T17:13:54-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/685d637f0424874611dfd0fb62f495a1/authenticate?key=f08e8c7e76d35afbc5147f84c7067379", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:54-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "685d637f0424874611dfd0fb62f495a1", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:54-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339460, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:54-05:00", "updated_at": "2022-11-28T17:13:54-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:54-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339460"}, "discount_applications": [], "fulfillments": [{"id": 1069019863, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019863", "created_at": "2022-11-28T17:13:55-05:00", "location_id": 24826418, "name": "#1002.1", "order_id": 1073459973, "origin_address": {}, "receipt": {}, "service": "shipwire-app", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2022-11-28T17:13:55-05:00", "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459973, "admin_graphql_api_id": "gid://shopify/Order/1073459973", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:28:24-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/db6850dd9d41e9787662d53205610280/authenticate?key=ef5e08b9b4f5dc44de217e892a73330b", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:28:24-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "db6850dd9d41e9787662d53205610280", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:24-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339477, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:28:24-05:00", "updated_at": "2023-01-03T12:28:24-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:28:24-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339477"}, "discount_applications": [], "fulfillments": [{"id": 1069019863, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019863", "created_at": "2023-01-03T12:28:25-05:00", "location_id": 24826418, "name": "#1002.1", "order_id": 1073459973, "origin_address": {}, "receipt": {}, "service": "shipwire-app", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2023-01-03T12:28:25-05:00", "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.email = "foo@example.com"; @@ -452,7 +452,7 @@ describe('Order resource', () => { }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459969, "admin_graphql_api_id": "gid://shopify/Order/1073459969", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:13:23-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/40b4ff84b38cfb28ae9a30426f47a3ad/authenticate?key=38925de427ae572efde807c6cbd93779", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:23-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "40b4ff84b38cfb28ae9a30426f47a3ad", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:23-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823181, "admin_graphql_api_id": "gid://shopify/LineItem/1071823181", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459969, "admin_graphql_api_id": "gid://shopify/Order/1073459969", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:27:30-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/48b0719e537c3c333216675180fc0662/authenticate?key=e072883103b424ca776545c12110edd4", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:30-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "48b0719e537c3c333216675180fc0662", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:30-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823179, "admin_graphql_api_id": "gid://shopify/LineItem/1071823179", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -474,7 +474,7 @@ describe('Order resource', () => { }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459972, "admin_graphql_api_id": "gid://shopify/Order/1073459972", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2022-11-28T17:13:33-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/8e116c24823eec49a7cc6298924db5ee/authenticate?key=e12e99638b289b07f1416ce16e199c24", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:33-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "8e116c24823eec49a7cc6298924db5ee", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:33-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339459, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:32-05:00", "updated_at": "2022-11-28T17:13:33-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:32-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339459"}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823184, "admin_graphql_api_id": "gid://shopify/LineItem/1071823184", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459967, "admin_graphql_api_id": "gid://shopify/Order/1073459967", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:27:09-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/a322d3b3d1add5bb8671897946a69cbe/authenticate?key=338368464f7b33742721bf04547e1c0b", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:09-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "a322d3b3d1add5bb8671897946a69cbe", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:09-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339474, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:09-05:00", "updated_at": "2023-01-03T12:27:10-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:09-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339474"}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823177, "admin_graphql_api_id": "gid://shopify/LineItem/1071823177", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.email = "foo@example.com"; @@ -498,7 +498,7 @@ describe('Order resource', () => { }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459971, "admin_graphql_api_id": "gid://shopify/Order/1073459971", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2022-11-28T17:13:29-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/e7cefc24914c10ff6c254415f85e6931/authenticate?key=52d7e27a9be1af5a3e5305a06989dca7", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:29-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "e7cefc24914c10ff6c254415f85e6931", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:29-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339458, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:13:29-05:00", "updated_at": "2022-11-28T17:13:30-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:13:29-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339458"}, "discount_applications": [], "fulfillments": [{"id": 1069019862, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019862", "created_at": "2022-11-28T17:13:30-05:00", "location_id": 487838322, "name": "#1002.1", "order_id": 1073459971, "origin_address": {}, "receipt": {}, "service": "manual", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2022-11-28T17:13:30-05:00", "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459964, "admin_graphql_api_id": "gid://shopify/Order/1073459964", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:26:15-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/eecea5ec1db2273b6c5a895c8e13ff58/authenticate?key=a22af164f7a9206bb9254a0724447566", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:26:15-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "eecea5ec1db2273b6c5a895c8e13ff58", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:15-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339473, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:26:15-05:00", "updated_at": "2023-01-03T12:26:16-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:26:15-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339473"}, "discount_applications": [], "fulfillments": [{"id": 1069019862, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019862", "created_at": "2023-01-03T12:26:15-05:00", "location_id": 487838322, "name": "#1002.1", "order_id": 1073459964, "origin_address": {}, "receipt": {}, "service": "manual", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2023-01-03T12:26:15-05:00", "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.email = "foo@example.com"; @@ -524,7 +524,7 @@ describe('Order resource', () => { }); it('test_23', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459962, "admin_graphql_api_id": "gid://shopify/Order/1073459962", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2022-11-28T17:12:22-05:00", "currency": "USD", "current_subtotal_price": "181.09", "current_subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_discounts": "17.91", "current_total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "181.09", "current_total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "FAKE30", "amount": "17.91", "type": "percentage"}], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/cafd791ccfe1480135cba4179151c1a0/authenticate?key=a1f1594e66904b77e01ef5754d5a0145", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": "+18885551234", "presentment_currency": "USD", "processed_at": "2022-11-28T17:12:22-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "181.09", "subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "cafd791ccfe1480135cba4179151c1a0", "total_discounts": "17.91", "total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "131.09", "total_price": "181.09", "total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:22-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339456, "email": "jane@example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:12:21-05:00", "updated_at": "2022-11-28T17:12:22-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2022-11-28T17:12:22-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317286, "customer_id": 1073339456, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "manual", "value": "9.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "FAKE30", "description": "FAKE30"}], "fulfillments": [], "line_items": [{"id": 1071823172, "admin_graphql_api_id": "gid://shopify/LineItem/1071823172", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "17.91", "amount_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459971, "admin_graphql_api_id": "gid://shopify/Order/1073459971", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2023-01-03T12:27:42-05:00", "currency": "USD", "current_subtotal_price": "181.09", "current_subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_discounts": "17.91", "current_total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "181.09", "current_total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "FAKE30", "amount": "17.91", "type": "percentage"}], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1b22331bf230d2f5b192b6c2965aff1/authenticate?key=a77ee802fb9a5928d3e50b38497a0710", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": "+18885551234", "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:42-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "181.09", "subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "b1b22331bf230d2f5b192b6c2965aff1", "total_discounts": "17.91", "total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "131.09", "total_price": "181.09", "total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:42-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339476, "email": "jane@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:41-05:00", "updated_at": "2023-01-03T12:27:42-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:41-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339476", "default_address": {"id": 1053317309, "customer_id": 1073339476, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "manual", "value": "9.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "FAKE30", "description": "FAKE30"}], "fulfillments": [], "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "17.91", "amount_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -583,7 +583,7 @@ describe('Order resource', () => { }); it('test_24', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 1073459968, "admin_graphql_api_id": "gid://shopify/Order/1073459968", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2022-11-28T17:13:20-05:00", "currency": "USD", "current_subtotal_price": "255.92", "current_subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "270.37", "current_total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "current_total_tax": "14.45", "current_total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/85556fb7bf0703395d3e0f7eba8f2675/authenticate?key=36f4e65925a0d2312050634eed0e7650", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2022-11-28T17:13:20-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "255.92", "subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "10.20", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "10.20", "currency_code": "USD"}, "presentment_money": {"amount": "10.20", "currency_code": "USD"}}, "channel_liable": null}, {"price": "4.25", "rate": 0.025, "title": "County tax", "price_set": {"shop_money": {"amount": "4.25", "currency_code": "USD"}, "presentment_money": {"amount": "4.25", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "85556fb7bf0703395d3e0f7eba8f2675", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "255.92", "total_line_items_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "total_outstanding": "270.37", "total_price": "270.37", "total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "14.45", "total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:20-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823178, "admin_graphql_api_id": "gid://shopify/LineItem/1071823178", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1700, "name": "Red Leather Coat", "price": "129.99", "price_set": {"shop_money": {"amount": "129.99", "currency_code": "USD"}, "presentment_money": {"amount": "129.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": true, "title": "Red Leather Coat", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "7.81", "price_set": {"shop_money": {"amount": "7.81", "currency_code": "USD"}, "presentment_money": {"amount": "7.81", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "3.26", "price_set": {"shop_money": {"amount": "3.26", "currency_code": "USD"}, "presentment_money": {"amount": "3.26", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}, {"id": 1071823179, "admin_graphql_api_id": "gid://shopify/LineItem/1071823179", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 750, "name": "Blue Suede Shoes", "price": "85.95", "price_set": {"shop_money": {"amount": "85.95", "currency_code": "USD"}, "presentment_money": {"amount": "85.95", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": false, "title": "Blue Suede Shoes", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [], "duties": [], "discount_allocations": []}, {"id": 1071823180, "admin_graphql_api_id": "gid://shopify/LineItem/1071823180", "fulfillable_quantity": 2, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 320, "name": "Raspberry Beret", "price": "19.99", "price_set": {"shop_money": {"amount": "19.99", "currency_code": "USD"}, "presentment_money": {"amount": "19.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 2, "requires_shipping": true, "sku": null, "taxable": true, "title": "Raspberry Beret", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "2.39", "price_set": {"shop_money": {"amount": "2.39", "currency_code": "USD"}, "presentment_money": {"amount": "2.39", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "0.99", "price_set": {"shop_money": {"amount": "0.99", "currency_code": "USD"}, "presentment_money": {"amount": "0.99", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + queueMockResponse(JSON.stringify({"order": {"id": 1073459970, "admin_graphql_api_id": "gid://shopify/Order/1073459970", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:27:34-05:00", "currency": "USD", "current_subtotal_price": "255.92", "current_subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "270.37", "current_total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "current_total_tax": "14.45", "current_total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/c92054d234b69c849746dd1dd0d1e3c5/authenticate?key=28bd5e97da3a1ed1e62ef43b0349ab20", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:34-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "255.92", "subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "10.20", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "10.20", "currency_code": "USD"}, "presentment_money": {"amount": "10.20", "currency_code": "USD"}}, "channel_liable": null}, {"price": "4.25", "rate": 0.025, "title": "County tax", "price_set": {"shop_money": {"amount": "4.25", "currency_code": "USD"}, "presentment_money": {"amount": "4.25", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "c92054d234b69c849746dd1dd0d1e3c5", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "255.92", "total_line_items_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "total_outstanding": "270.37", "total_price": "270.37", "total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "14.45", "total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:34-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823180, "admin_graphql_api_id": "gid://shopify/LineItem/1071823180", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1700, "name": "Red Leather Coat", "price": "129.99", "price_set": {"shop_money": {"amount": "129.99", "currency_code": "USD"}, "presentment_money": {"amount": "129.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": true, "title": "Red Leather Coat", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "7.81", "price_set": {"shop_money": {"amount": "7.81", "currency_code": "USD"}, "presentment_money": {"amount": "7.81", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "3.26", "price_set": {"shop_money": {"amount": "3.26", "currency_code": "USD"}, "presentment_money": {"amount": "3.26", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}, {"id": 1071823181, "admin_graphql_api_id": "gid://shopify/LineItem/1071823181", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 750, "name": "Blue Suede Shoes", "price": "85.95", "price_set": {"shop_money": {"amount": "85.95", "currency_code": "USD"}, "presentment_money": {"amount": "85.95", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": false, "title": "Blue Suede Shoes", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [], "duties": [], "discount_allocations": []}, {"id": 1071823182, "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "fulfillable_quantity": 2, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 320, "name": "Raspberry Beret", "price": "19.99", "price_set": {"shop_money": {"amount": "19.99", "currency_code": "USD"}, "presentment_money": {"amount": "19.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 2, "requires_shipping": true, "sku": null, "taxable": true, "title": "Raspberry Beret", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "2.39", "price_set": {"shop_money": {"amount": "2.39", "currency_code": "USD"}, "presentment_money": {"amount": "2.39", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "0.99", "price_set": {"shop_money": {"amount": "0.99", "currency_code": "USD"}, "presentment_money": {"amount": "0.99", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); const order = new shopify.rest.Order({session: session}); order.line_items = [ @@ -633,7 +633,7 @@ describe('Order resource', () => { }); it('test_25', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:14:23-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:22-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -658,7 +658,7 @@ describe('Order resource', () => { }); it('test_26', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": "Customer contacted us about a custom engraving on this iPod", "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:41-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": "Customer contacted us about a custom engraving on this iPod", "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:57-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -676,7 +676,7 @@ describe('Order resource', () => { }); it('test_27', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "colour", "value": "red"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:57-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "colour", "value": "red"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:22-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -699,7 +699,7 @@ describe('Order resource', () => { }); it('test_28', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "a-different@email.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "a-different@email.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:43-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "a-different@email.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "a-different@email.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:53-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -717,7 +717,7 @@ describe('Order resource', () => { }); it('test_29', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+15145556677", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:52-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+15145556677", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:07-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -735,7 +735,7 @@ describe('Order resource', () => { }); it('test_30', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": true, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:39-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": true, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:36-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -753,7 +753,7 @@ describe('Order resource', () => { }); it('test_31', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:36-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:27-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -771,7 +771,7 @@ describe('Order resource', () => { }); it('test_32', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "External, Inbound, Outbound", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:12:18-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "External, Inbound, Outbound", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:09-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; @@ -789,7 +789,7 @@ describe('Order resource', () => { }); it('test_33', async () => { - queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2022-11-28T17:13:58-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2022-11-28T17:11:25-05:00", "updated_at": "2022-11-28T17:11:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2022-11-28T17:11:25-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2022-11-28T17:11:25-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2022-11-28T17:11:25-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2022-11-28T17:11:25-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "123 Ship Street", "phone": "+1(502)-459-2181", "city": "Shipsville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:07-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "123 Ship Street", "phone": "+1(502)-459-2181", "city": "Shipsville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); const order = new shopify.rest.Order({session: session}); order.id = 450789469; diff --git a/rest/admin/__tests__/2022-10/page.test.ts b/rest/admin/__tests__/2022-10/page.test.ts index 057ed7c9f..ae69fc805 100644 --- a/rest/admin/__tests__/2022-10/page.test.ts +++ b/rest/admin/__tests__/2022-10/page.test.ts @@ -31,116 +31,140 @@ describe('Page resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"pages": [{"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}]})); + queueMockResponse(JSON.stringify({"pages": [{"id": 108828309, "title": "Sample Page", "shop_id": 548380009, "handle": "sample", "body_html": "

this is a sample page.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}, {"id": 322471, "title": "Support", "shop_id": 548380009, "handle": "support", "body_html": "

Come in store for support.

", "author": "Dennis", "created_at": "2009-07-15T20:00:00-04:00", "updated_at": "2009-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"}, {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}]})); await shopify.rest.Page.all({ session: session, - since_id: "108828309", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/pages.json', - query: 'since_id=108828309', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"pages": [{"id": 108828309, "title": "Sample Page", "shop_id": 548380009, "handle": "sample", "body_html": "

this is a sample page.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}, {"id": 322471, "title": "Support", "shop_id": 548380009, "handle": "support", "body_html": "

Come in store for support.

", "author": "Dennis", "created_at": "2009-07-15T20:00:00-04:00", "updated_at": "2009-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"}, {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}]})); + queueMockResponse(JSON.stringify({"pages": [{"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}]})); await shopify.rest.Page.all({ session: session, + since_id: "108828309", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/pages.json', - query: '', + query: 'since_id=108828309', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"count": 4})); + queueMockResponse(JSON.stringify({"page": {"id": 1025371373, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:23:38-05:00", "updated_at": "2023-01-03T12:23:38-05:00", "published_at": "2023-01-03T12:23:38-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371373"}})); - await shopify.rest.Page.count({ - session: session, - }); + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + await page.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/pages/count.json', + path: '/admin/api/2022-10/pages.json', query: '', headers, - data: undefined + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"page": {"id": 1025371369, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:22:57-05:00", "updated_at": "2023-01-03T12:22:57-05:00", "published_at": "2023-01-03T12:22:57-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371369"}})); - await shopify.rest.Page.find({ - session: session, - id: 131092082, - }); + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.metafields = [ + { + "key": "new", + "value": "new value", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await page.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/pages/131092082.json', + path: '/admin/api/2022-10/pages.json', query: '', headers, - data: undefined + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "author": "Christopher Gorski", "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "handle": "new-warranty", "title": "New warranty", "id": 131092082, "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"page": {"id": 1025371374, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:23:49-05:00", "updated_at": "2023-01-03T12:23:49-05:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371374"}})); const page = new shopify.rest.Page({session: session}); - page.id = 131092082; - page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; - page.author = "Christopher Gorski"; - page.title = "New warranty"; - page.handle = "new-warranty"; + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.published = false; await page.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/pages/131092082.json', + path: '/admin/api/2022-10/pages.json', query: '', headers, - data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "author": "Christopher Gorski", "title": "New warranty", "handle": "new-warranty"} } + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "published": false} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "title": "Terms of Services", "handle": "tos", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:05-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"count": 4})); - const page = new shopify.rest.Page({session: session}); - page.id = 131092082; - page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; - await page.save({}); + await shopify.rest.Page.count({ + session: session, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-10/pages/131092082.json', + path: '/admin/api/2022-10/pages/count.json', query: '', headers, - data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:06-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + queueMockResponse(JSON.stringify({"page": {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + + await shopify.rest.Page.find({ + session: session, + id: 131092082, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2022-10/pages/131092082.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:26-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); page.id = 131092082; @@ -164,8 +188,8 @@ describe('Page resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": null, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:11-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + it('test_9', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": null, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:07-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); page.id = 131092082; @@ -182,8 +206,8 @@ describe('Page resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_9', async () => { - queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": "2022-10-03T12:54:12-04:00", "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2022-10-03T12:54:12-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + it('test_10', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": "2023-01-03T12:23:46-05:00", "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:46-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); page.id = 131092082; @@ -200,84 +224,60 @@ describe('Page resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_10', async () => { - queueMockResponse(JSON.stringify({})); - - await shopify.rest.Page.delete({ - session: session, - id: 131092082, - }); - - expect({ - method: 'DELETE', - domain, - path: '/admin/api/2022-10/pages/131092082.json', - query: '', - headers, - data: undefined - }).toMatchMadeHttpRequest(); - }); - it('test_11', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 1025371368, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2022-10-03T12:53:50-04:00", "updated_at": "2022-10-03T12:53:50-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371368"}})); + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "author": "Christopher Gorski", "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "handle": "new-warranty", "title": "New warranty", "id": 131092082, "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:28-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); - page.title = "Warranty information"; - page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; - page.published = false; + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; + page.author = "Christopher Gorski"; + page.title = "New warranty"; + page.handle = "new-warranty"; await page.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/pages.json', + path: '/admin/api/2022-10/pages/131092082.json', query: '', headers, - data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "published": false} } + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "author": "Christopher Gorski", "title": "New warranty", "handle": "new-warranty"} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 1025371371, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2022-10-03T12:54:10-04:00", "updated_at": "2022-10-03T12:54:10-04:00", "published_at": "2022-10-03T12:54:10-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371371"}})); + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "title": "Terms of Services", "handle": "tos", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:08-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); const page = new shopify.rest.Page({session: session}); - page.title = "Warranty information"; - page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; - page.metafields = [ - { - "key": "new", - "value": "new value", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; await page.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/pages.json', + path: '/admin/api/2022-10/pages/131092082.json', query: '', headers, - data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

"} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"page": {"id": 1025371374, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2022-10-03T12:54:22-04:00", "updated_at": "2022-10-03T12:54:22-04:00", "published_at": "2022-10-03T12:54:22-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371374"}})); + queueMockResponse(JSON.stringify({})); - const page = new shopify.rest.Page({session: session}); - page.title = "Warranty information"; - page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; - await page.save({}); + await shopify.rest.Page.delete({ + session: session, + id: 131092082, + }); expect({ - method: 'POST', + method: 'DELETE', domain, - path: '/admin/api/2022-10/pages.json', + path: '/admin/api/2022-10/pages/131092082.json', query: '', headers, - data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"} } + data: undefined }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/payment.test.ts b/rest/admin/__tests__/2022-10/payment.test.ts index 7ee56b825..5c5247c56 100644 --- a/rest/admin/__tests__/2022-10/payment.test.ts +++ b/rest/admin/__tests__/2022-10/payment.test.ts @@ -31,7 +31,7 @@ describe('Payment resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"payment": {"id": 1071573807, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2023, "customer_id": 207119551}, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}, {"id": 1071573807, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2023, "customer_id": 207119551}}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2022-10-03T12:52:28-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2023, "customer_id": 207119551}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + queueMockResponse(JSON.stringify({"payment": {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}, {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:42:43-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); const payment = new shopify.rest.Payment({session: session}); payment.checkout_id = "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x"; @@ -41,7 +41,7 @@ describe('Payment resource', () => { "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" }; payment.amount = "398.00"; - payment.session_id = "global-98c9624a14e5f4b0"; + payment.session_id = "global-d127b9b88aa1043d"; payment.unique_token = "client-side-idempotency-token"; await payment.save({}); @@ -51,12 +51,12 @@ describe('Payment resource', () => { path: '/admin/api/2022-10/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments.json', query: '', headers, - data: { "payment": {"request_details": {"ip_address": "123.1.1.1", "accept_language": "en-US,en;q=0.8,fr;q=0.6", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, "amount": "398.00", "session_id": "global-98c9624a14e5f4b0", "unique_token": "client-side-idempotency-token"} } + data: { "payment": {"request_details": {"ip_address": "123.1.1.1", "accept_language": "en-US,en;q=0.8,fr;q=0.6", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, "amount": "398.00", "session_id": "global-d127b9b88aa1043d", "unique_token": "client-side-idempotency-token"} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}]})); + queueMockResponse(JSON.stringify({"payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}]})); await shopify.rest.Payment.all({ session: session, @@ -74,7 +74,7 @@ describe('Payment resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:24-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278472, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:24-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278472, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:23-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278482, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:23-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278482, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); await shopify.rest.Payment.find({ session: session, @@ -93,7 +93,7 @@ describe('Payment resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:41-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278473, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2022-10-03T12:52:41-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278473, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "ee655663e1e23e49", "key": "ee655663e1e23e49", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "3592914188ba126a", "key": "3592914188ba126a", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664815485", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:30-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278483, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:30-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278483, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); await shopify.rest.Payment.find({ session: session, diff --git a/rest/admin/__tests__/2022-10/payment_gateway.test.ts b/rest/admin/__tests__/2022-10/payment_gateway.test.ts index 102f1c1f0..bbb15a0d8 100644 --- a/rest/admin/__tests__/2022-10/payment_gateway.test.ts +++ b/rest/admin/__tests__/2022-10/payment_gateway.test.ts @@ -31,42 +31,60 @@ describe('PaymentGateway resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2022-10-03T12:24:45-04:00", "credential4": null, "attachment": null}]})); + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:58-05:00", "credential4": null, "attachment": null}, {"disabled": true, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": false, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}]})); await shopify.rest.PaymentGateway.all({ session: session, - disabled: "false", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/payment_gateways.json', - query: 'disabled=false', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2022-10-03T12:24:52-04:00", "credential4": null, "attachment": null}, {"disabled": true, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": false, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}]})); + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:52-05:00", "credential4": null, "attachment": null}]})); await shopify.rest.PaymentGateway.all({ session: session, + disabled: "false", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/payment_gateways.json', - query: '', + query: 'disabled=false', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"payment": {"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2022-10-03T12:24:50-04:00", "credential4": null, "attachment": null}})); + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 1048196722, "name": "authorize_net", "provider_id": 7, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club", "jcb"], "processing_method": "direct", "service_name": "Authorize.net", "metadata": {}, "created_at": "2023-01-03T12:21:57-05:00", "updated_at": "2023-01-03T12:21:57-05:00", "credential1": "someone@example.com", "credential3": null, "credential4": null, "attachment": null}})); + + const payment_gateway = new shopify.rest.PaymentGateway({session: session}); + payment_gateway.credential1 = "someone@example.com"; + payment_gateway.provider_id = 7; + await payment_gateway.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/payment_gateways.json', + query: '', + headers, + data: { "payment_gateway": {"credential1": "someone@example.com", "provider_id": 7} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"payment": {"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:54-05:00", "credential4": null, "attachment": null}})); await shopify.rest.PaymentGateway.find({ session: session, @@ -83,8 +101,8 @@ describe('PaymentGateway resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_4', async () => { - queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": true, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:24:52-04:00"}})); + it('test_5', async () => { + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": true, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:22:03-05:00"}})); const payment_gateway = new shopify.rest.PaymentGateway({session: session}); payment_gateway.id = 170508070; @@ -101,7 +119,7 @@ describe('PaymentGateway resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { + it('test_6', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.PaymentGateway.delete({ @@ -119,22 +137,4 @@ describe('PaymentGateway resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 1048196722, "name": "authorize_net", "provider_id": 7, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club", "jcb"], "processing_method": "direct", "service_name": "Authorize.net", "metadata": {}, "created_at": "2022-10-03T12:24:47-04:00", "updated_at": "2022-10-03T12:24:47-04:00", "credential1": "someone@example.com", "credential3": null, "credential4": null, "attachment": null}})); - - const payment_gateway = new shopify.rest.PaymentGateway({session: session}); - payment_gateway.credential1 = "someone@example.com"; - payment_gateway.provider_id = 7; - await payment_gateway.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-10/payment_gateways.json', - query: '', - headers, - data: { "payment_gateway": {"credential1": "someone@example.com", "provider_id": 7} } - }).toMatchMadeHttpRequest(); - }); - }); diff --git a/rest/admin/__tests__/2022-10/policy.test.ts b/rest/admin/__tests__/2022-10/policy.test.ts index f9299cda1..cf0e528c2 100644 --- a/rest/admin/__tests__/2022-10/policy.test.ts +++ b/rest/admin/__tests__/2022-10/policy.test.ts @@ -31,7 +31,7 @@ describe('Policy resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"policies": [{"body": "You have 30 days to get a refund", "created_at": "2022-10-03T12:52:45-04:00", "updated_at": "2022-10-03T12:52:45-04:00", "handle": "refund-policy", "title": "Refund policy", "url": "https://jsmith.myshopify.com/548380009/policies/878590288"}]})); + queueMockResponse(JSON.stringify({"policies": [{"body": "You have 30 days to get a refund", "created_at": "2023-01-03T12:39:49-05:00", "updated_at": "2023-01-03T12:39:49-05:00", "handle": "refund-policy", "title": "Refund policy", "url": "https://jsmith.myshopify.com/548380009/policies/878590288"}]})); await shopify.rest.Policy.all({ session: session, diff --git a/rest/admin/__tests__/2022-10/price_rule.test.ts b/rest/admin/__tests__/2022-10/price_rule.test.ts index dd4e78889..ce87eed4b 100644 --- a/rest/admin/__tests__/2022-10/price_rule.test.ts +++ b/rest/admin/__tests__/2022-10/price_rule.test.ts @@ -31,7 +31,7 @@ describe('PriceRule resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341478, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "allocation_limit": 3, "once_per_customer": false, "usage_limit": null, "starts_at": "2018-03-21T20:00:00-04:00", "ends_at": null, "created_at": "2022-10-03T12:24:17-04:00", "updated_at": "2022-10-03T12:24:17-04:00", "entitled_product_ids": [921728736], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [841564295], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "Buy2iPodsGetiPodTouchForFree", "admin_graphql_api_id": "gid://shopify/PriceRule/996341478"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341481, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "allocation_limit": 3, "once_per_customer": false, "usage_limit": null, "starts_at": "2018-03-21T20:00:00-04:00", "ends_at": null, "created_at": "2023-01-03T12:06:59-05:00", "updated_at": "2023-01-03T12:06:59-05:00", "entitled_product_ids": [921728736], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [841564295], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "Buy2iPodsGetiPodTouchForFree", "admin_graphql_api_id": "gid://shopify/PriceRule/996341481"}})); const price_rule = new shopify.rest.PriceRule({session: session}); price_rule.title = "Buy2iPodsGetiPodTouchForFree"; @@ -66,20 +66,16 @@ describe('PriceRule resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341479, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "allocation_limit": null, "once_per_customer": false, "usage_limit": 20, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2022-10-03T12:24:18-04:00", "updated_at": "2022-10-03T12:24:18-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "FREESHIPPING", "admin_graphql_api_id": "gid://shopify/PriceRule/996341479"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341478, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:46-05:00", "updated_at": "2023-01-03T12:06:46-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/996341478"}})); const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.title = "FREESHIPPING"; - price_rule.target_type = "shipping_line"; + price_rule.title = "SUMMERSALE10OFF"; + price_rule.target_type = "line_item"; price_rule.target_selection = "all"; - price_rule.allocation_method = "each"; - price_rule.value_type = "percentage"; - price_rule.value = "-100.0"; - price_rule.usage_limit = 20; + price_rule.allocation_method = "across"; + price_rule.value_type = "fixed_amount"; + price_rule.value = "-10.0"; price_rule.customer_selection = "all"; - price_rule.prerequisite_subtotal_range = { - "greater_than_or_equal_to": "50.0" - }; price_rule.starts_at = "2017-01-19T17:59:10Z"; await price_rule.save({}); @@ -89,21 +85,24 @@ describe('PriceRule resource', () => { path: '/admin/api/2022-10/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "FREESHIPPING", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "value_type": "percentage", "value": "-100.0", "usage_limit": 20, "customer_selection": "all", "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "starts_at": "2017-01-19T17:59:10Z"} } + data: { "price_rule": {"title": "SUMMERSALE10OFF", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "starts_at": "2017-01-19T17:59:10Z"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341480, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2022-10-03T12:24:22-04:00", "updated_at": "2022-10-03T12:24:22-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/996341480"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341480, "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:56-05:00", "updated_at": "2023-01-03T12:06:56-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [841564295], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "15OFFCOLLECTION", "admin_graphql_api_id": "gid://shopify/PriceRule/996341480"}})); const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.title = "SUMMERSALE10OFF"; + price_rule.title = "15OFFCOLLECTION"; price_rule.target_type = "line_item"; - price_rule.target_selection = "all"; + price_rule.target_selection = "entitled"; price_rule.allocation_method = "across"; - price_rule.value_type = "fixed_amount"; - price_rule.value = "-10.0"; + price_rule.value_type = "percentage"; + price_rule.value = "-15.0"; price_rule.customer_selection = "all"; + price_rule.entitled_collection_ids = [ + 841564295 + ]; price_rule.starts_at = "2017-01-19T17:59:10Z"; await price_rule.save({}); @@ -113,24 +112,25 @@ describe('PriceRule resource', () => { path: '/admin/api/2022-10/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "SUMMERSALE10OFF", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "starts_at": "2017-01-19T17:59:10Z"} } + data: { "price_rule": {"title": "15OFFCOLLECTION", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "entitled_collection_ids": [841564295], "starts_at": "2017-01-19T17:59:10Z"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 996341481, "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2022-10-03T12:24:29-04:00", "updated_at": "2022-10-03T12:24:29-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [841564295], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "15OFFCOLLECTION", "admin_graphql_api_id": "gid://shopify/PriceRule/996341481"}})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341479, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "allocation_limit": null, "once_per_customer": false, "usage_limit": 20, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:52-05:00", "updated_at": "2023-01-03T12:06:52-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "FREESHIPPING", "admin_graphql_api_id": "gid://shopify/PriceRule/996341479"}})); const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.title = "15OFFCOLLECTION"; - price_rule.target_type = "line_item"; - price_rule.target_selection = "entitled"; - price_rule.allocation_method = "across"; + price_rule.title = "FREESHIPPING"; + price_rule.target_type = "shipping_line"; + price_rule.target_selection = "all"; + price_rule.allocation_method = "each"; price_rule.value_type = "percentage"; - price_rule.value = "-15.0"; + price_rule.value = "-100.0"; + price_rule.usage_limit = 20; price_rule.customer_selection = "all"; - price_rule.entitled_collection_ids = [ - 841564295 - ]; + price_rule.prerequisite_subtotal_range = { + "greater_than_or_equal_to": "50.0" + }; price_rule.starts_at = "2017-01-19T17:59:10Z"; await price_rule.save({}); @@ -140,93 +140,93 @@ describe('PriceRule resource', () => { path: '/admin/api/2022-10/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "15OFFCOLLECTION", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "entitled_collection_ids": [841564295], "starts_at": "2017-01-19T17:59:10Z"} } + data: { "price_rule": {"title": "FREESHIPPING", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "value_type": "percentage", "value": "-100.0", "usage_limit": 20, "customer_selection": "all", "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "starts_at": "2017-01-19T17:59:10Z"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:24:20-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "WINTER SALE", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}, {"id": 106886544, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2023-01-01T12:05:09-05:00", "ends_at": "2023-01-05T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "TENOFF", "admin_graphql_api_id": "gid://shopify/PriceRule/106886544"}]})); - const price_rule = new shopify.rest.PriceRule({session: session}); - price_rule.id = 507328175; - price_rule.title = "WINTER SALE"; - await price_rule.save({}); + await shopify.rest.PriceRule.all({ + session: session, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-10/price_rules/507328175.json', + path: '/admin/api/2022-10/price_rules.json', query: '', headers, - data: { "price_rule": {"title": "WINTER SALE"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}]})); - await shopify.rest.PriceRule.find({ + await shopify.rest.PriceRule.all({ session: session, - id: 507328175, + since_id: "106886545", }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/price_rules/507328175.json', - query: '', + path: '/admin/api/2022-10/price_rules.json', + query: 'since_id=106886545', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:55-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "WINTER SALE", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); - await shopify.rest.PriceRule.delete({ - session: session, - id: 507328175, - }); + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.id = 507328175; + price_rule.title = "WINTER SALE"; + await price_rule.save({}); expect({ - method: 'DELETE', + method: 'PUT', domain, path: '/admin/api/2022-10/price_rules/507328175.json', query: '', headers, - data: undefined + data: { "price_rule": {"title": "WINTER SALE"} } }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}]})); + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); - await shopify.rest.PriceRule.all({ + await shopify.rest.PriceRule.find({ session: session, - since_id: "106886545", + id: 507328175, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/price_rules.json', - query: 'since_id=106886545', + path: '/admin/api/2022-10/price_rules/507328175.json', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-09-27T12:15:55-04:00", "ends_at": "2022-10-09T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}, {"id": 106886544, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-10-01T12:15:55-04:00", "ends_at": "2022-10-05T12:15:55-04:00", "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "TENOFF", "admin_graphql_api_id": "gid://shopify/PriceRule/106886544"}]})); + queueMockResponse(JSON.stringify({})); - await shopify.rest.PriceRule.all({ + await shopify.rest.PriceRule.delete({ session: session, + id: 507328175, }); expect({ - method: 'GET', + method: 'DELETE', domain, - path: '/admin/api/2022-10/price_rules.json', + path: '/admin/api/2022-10/price_rules/507328175.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/product.test.ts b/rest/admin/__tests__/2022-10/product.test.ts index f981f8c46..50e13c2f5 100644 --- a/rest/admin/__tests__/2022-10/product.test.ts +++ b/rest/admin/__tests__/2022-10/product.test.ts @@ -31,60 +31,60 @@ describe('Product resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, + ids: "632910392,921728736", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products.json', - query: '', + query: 'ids=632910392%2C921728736', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, - ids: "632910392,921728736", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products.json', - query: 'ids=632910392%2C921728736', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}, {"id": 921728736, "title": "IPod Touch 8GB", "images": []}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, - fields: "id,images,title", + since_id: "632910392", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products.json', - query: 'fields=id%2Cimages%2Ctitle', + query: 'since_id=632910392', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); await shopify.rest.Product.all({ session: session, @@ -102,364 +102,344 @@ describe('Product resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); await shopify.rest.Product.all({ session: session, - since_id: "632910392", + presentment_currencies: "USD", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products.json', - query: 'since_id=632910392', + query: 'presentment_currencies=USD', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-touch", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}, {"id": 921728736, "title": "IPod Touch 8GB", "images": []}]})); await shopify.rest.Product.all({ session: session, - presentment_currencies: "USD", + fields: "id,images,title", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products.json', - query: 'presentment_currencies=USD', + query: 'fields=id%2Cimages%2Ctitle', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559591, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:24-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:24-04:00", "published_at": "2022-09-28T16:39:24-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, Big Air, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/1071559591", "variants": [{"id": 1070325046, "product_id": 1071559591, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:24-04:00", "updated_at": "2022-09-28T16:39:24-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325046, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325046"}], "options": [{"id": 1055547204, "product_id": 1071559591, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"count": 2})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.tags = [ - "Barnes & Noble", - "Big Air", - "John's Fav" - ]; - await product.save({}); + await shopify.rest.Product.count({ + session: session, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/products.json', + path: '/admin/api/2022-10/products/count.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "tags": ["Barnes & Noble", "Big Air", "John's Fav"]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559592, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:26-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:26-04:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559592", "variants": [{"id": 1070325047, "product_id": 1071559592, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:26-04:00", "updated_at": "2022-09-28T16:39:26-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325047, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325047"}], "options": [{"id": 1055547205, "product_id": 1071559592, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"count": 1})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.published = false; - await product.save({}); + await shopify.rest.Product.count({ + session: session, + collection_id: "841564295", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/products.json', - query: '', + path: '/admin/api/2022-10/products/count.json', + query: 'collection_id=841564295', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "published": false} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559593, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:28-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:28-04:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559593", "variants": [{"id": 1070325048, "product_id": 1071559593, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:28-04:00", "updated_at": "2022-09-28T16:39:28-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325048, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325048"}], "options": [{"id": 1055547206, "product_id": 1071559593, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.status = "draft"; - await product.save({}); + await shopify.rest.Product.find({ + session: session, + id: 632910392, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/products.json', + path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "status": "draft"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559594, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:29-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:30-04:00", "published_at": "2022-09-28T16:39:29-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559594", "variants": [{"id": 1070325049, "product_id": 1071559594, "title": "First", "price": "10.00", "sku": "123", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "First", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:30-04:00", "updated_at": "2022-09-28T16:39:30-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325049, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "10.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325049"}, {"id": 1070325050, "product_id": 1071559594, "title": "Second", "price": "20.00", "sku": "123", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Second", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:30-04:00", "updated_at": "2022-09-28T16:39:30-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325050, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "20.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325050"}], "options": [{"id": 1055547207, "product_id": 1071559594, "name": "Title", "position": 1, "values": ["First", "Second"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}})); - const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.variants = [ - { - "option1": "First", - "price": "10.00", - "sku": "123" - }, - { - "option1": "Second", - "price": "20.00", - "sku": "123" - } - ]; - await product.save({}); + await shopify.rest.Product.find({ + session: session, + id: 632910392, + fields: "id,images,title", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/products.json', - query: '', + path: '/admin/api/2022-10/products/632910392.json', + query: 'fields=id%2Cimages%2Ctitle', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "First", "price": "10.00", "sku": "123"}, {"option1": "Second", "price": "20.00", "sku": "123"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559595, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:32-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:32-04:00", "published_at": "2022-09-28T16:39:32-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559595", "variants": [{"id": 1070325051, "product_id": 1071559595, "title": "Blue / 155", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Blue", "option2": "155", "option3": null, "created_at": "2022-09-28T16:39:32-04:00", "updated_at": "2022-09-28T16:39:32-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325051, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325051"}, {"id": 1070325052, "product_id": 1071559595, "title": "Black / 159", "price": "0.00", "sku": "", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Black", "option2": "159", "option3": null, "created_at": "2022-09-28T16:39:32-04:00", "updated_at": "2022-09-28T16:39:32-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325052, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325052"}], "options": [{"id": 1055547208, "product_id": 1071559595, "name": "Color", "position": 1, "values": ["Blue", "Black"]}, {"id": 1055547209, "product_id": 1071559595, "name": "Size", "position": 2, "values": ["155", "159"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:19-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.variants = [ - { - "option1": "Blue", - "option2": "155" - }, - { - "option1": "Black", - "option2": "159" - } - ]; - product.options = [ - { - "name": "Color", - "values": [ - "Blue", - "Black" - ] - }, + product.id = 632910392; + product.metafields = [ { - "name": "Size", - "values": [ - "155", - "159" - ] + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" } ]; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products.json', + path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "Blue", "option2": "155"}, {"option1": "Black", "option2": "159"}], "options": [{"name": "Color", "values": ["Blue", "Black"]}, {"name": "Size", "values": ["155", "159"]}]} } + data: { "product": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559596, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:34-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:34-04:00", "published_at": "2022-09-28T16:39:34-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559596", "variants": [{"id": 1070325053, "product_id": 1071559596, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:34-04:00", "updated_at": "2022-09-28T16:39:34-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325053, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325053"}], "options": [{"id": 1055547210, "product_id": 1071559596, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473898, "product_id": 1071559596, "position": 1, "created_at": "2022-09-28T16:39:34-04:00", "updated_at": "2022-09-28T16:39:34-04:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664397574", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473898"}], "image": {"id": 1001473898, "product_id": 1071559596, "position": 1, "created_at": "2022-09-28T16:39:34-04:00", "updated_at": "2022-09-28T16:39:34-04:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664397574", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473898"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:07-05:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.images = [ - { - "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" - } - ]; + product.id = 632910392; + product.published = false; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products.json', + path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}]} } + data: { "product": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559597, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:36-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:37-04:00", "published_at": "2022-09-28T16:39:36-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559597", "variants": [{"id": 1070325054, "product_id": 1071559597, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:36-04:00", "updated_at": "2022-09-28T16:39:36-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325054, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325054"}], "options": [{"id": 1055547211, "product_id": 1071559597, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473899, "product_id": 1071559597, "position": 1, "created_at": "2022-09-28T16:39:36-04:00", "updated_at": "2022-09-28T16:39:36-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20220928-1971383-vfpdob.gif?v=1664397576", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473899"}], "image": {"id": 1001473899, "product_id": 1071559597, "position": 1, "created_at": "2022-09-28T16:39:36-04:00", "updated_at": "2022-09-28T16:39:36-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20220928-1971383-vfpdob.gif?v=1664397576", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473899"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:25-05:00", "published_at": "2023-01-03T12:59:24-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.images = [ - { - "src": "http://example.com/rails_logo.gif" - } - ]; + product.id = 632910392; + product.published = true; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products.json', + path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"src": "http://example.com/rails_logo.gif"}]} } + data: { "product": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559598, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:40-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:40-04:00", "published_at": "2022-09-28T16:39:40-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559598", "variants": [{"id": 1070325055, "product_id": 1071559598, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:40-04:00", "updated_at": "2022-09-28T16:39:40-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325055, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325055"}], "options": [{"id": 1055547212, "product_id": 1071559598, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "Updated Product Title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:21-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "2000.00", "sku": "Updating the Product SKU", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:00:20-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.metafields_global_title_tag = "Product SEO Title"; - product.metafields_global_description_tag = "Product SEO Description"; + product.id = 632910392; + product.title = "Updated Product Title"; + product.variants = [ + { + "id": 808950810, + "price": "2000.00", + "sku": "Updating the Product SKU" + }, + { + "id": 49148385 + }, + { + "id": 39072856 + }, + { + "id": 457924702 + } + ]; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products.json', + path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields_global_title_tag": "Product SEO Title", "metafields_global_description_tag": "Product SEO Description"} } + data: { "product": {"title": "Updated Product Title", "variants": [{"id": 808950810, "price": "2000.00", "sku": "Updating the Product SKU"}, {"id": 49148385}, {"id": 39072856}, {"id": 457924702}]} } }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 1071559599, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-09-28T16:39:42-04:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-09-28T16:39:42-04:00", "published_at": "2022-09-28T16:39:42-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559599", "variants": [{"id": 1070325056, "product_id": 1071559599, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-09-28T16:39:42-04:00", "updated_at": "2022-09-28T16:39:42-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325056, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325056"}], "options": [{"id": 1055547213, "product_id": 1071559599, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:02:22-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 1001473910, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T13:02:22-05:00", "updated_at": "2023-01-03T13:02:22-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-3uie15.gif?v=1672768942", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473910"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); - product.title = "Burton Custom Freestyle 151"; - product.body_html = "Good snowboard!"; - product.vendor = "Burton"; - product.product_type = "Snowboard"; - product.metafields = [ + product.id = 632910392; + product.images = [ { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" + "id": 850703190 + }, + { + "id": 562641783 + }, + { + "id": 378407906 + }, + { + "src": "http://example.com/rails_logo.gif" } ]; await product.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products.json', + path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "product": {"images": [{"id": 850703190}, {"id": 562641783}, {"id": 378407906}, {"src": "http://example.com/rails_logo.gif"}]} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"count": 2})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:57-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:59:57-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [], "image": null}})); - await shopify.rest.Product.count({ - session: session, - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = []; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-10/products/count.json', + path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: undefined + data: { "product": {"images": []} } }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:01:34-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 850703190, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}], "image": {"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}}})); - await shopify.rest.Product.count({ - session: session, - collection_id: "841564295", - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = [ + { + "id": 850703190, + "position": 3 + }, + { + "id": 562641783, + "position": 2 + }, + { + "id": 378407906, + "position": 1 + } + ]; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-10/products/count.json', - query: 'collection_id=841564295', + path: '/admin/api/2022-10/products/632910392.json', + query: '', headers, - data: undefined + data: { "product": {"images": [{"id": 850703190, "position": 3}, {"id": 562641783, "position": 2}, {"id": 378407906, "position": 1}]} } }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:02:16-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Black", "Green", "Red", "Pink"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); - await shopify.rest.Product.find({ - session: session, - id: 632910392, - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.variants = [ + { + "id": 457924702 + }, + { + "id": 39072856 + }, + { + "id": 49148385 + }, + { + "id": 808950810 + } + ]; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: undefined + data: { "product": {"variants": [{"id": 457924702}, {"id": 39072856}, {"id": 49148385}, {"id": 808950810}]} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); - await shopify.rest.Product.find({ - session: session, - id: 632910392, - fields: "id,images,title", - }); + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.metafields_global_title_tag = "Brand new title"; + product.metafields_global_description_tag = "Brand new description"; + await product.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-10/products/632910392.json', - query: 'fields=id%2Cimages%2Ctitle', + query: '', headers, - data: undefined + data: { "product": {"metafields_global_title_tag": "Brand new title", "metafields_global_description_tag": "Brand new description"} } }).toMatchMadeHttpRequest(); }); it('test_20', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "New product title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:20-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:11-05:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); product.id = 632910392; - product.title = "New product title"; + product.status = "draft"; await product.save({}); expect({ @@ -468,16 +448,16 @@ describe('Product resource', () => { path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"title": "New product title"} } + data: { "product": {"status": "draft"} } }).toMatchMadeHttpRequest(); }); it('test_21', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:22-04:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:46-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); product.id = 632910392; - product.status = "draft"; + product.tags = "Barnes & Noble, John's Fav"; await product.save({}); expect({ @@ -486,16 +466,16 @@ describe('Product resource', () => { path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"status": "draft"} } + data: { "product": {"tags": "Barnes & Noble, John's Fav"} } }).toMatchMadeHttpRequest(); }); it('test_22', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:24-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "New product title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:01:10-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); const product = new shopify.rest.Product({session: session}); product.id = 632910392; - product.tags = "Barnes & Noble, John's Fav"; + product.title = "New product title"; await product.save({}); expect({ @@ -504,215 +484,231 @@ describe('Product resource', () => { path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"tags": "Barnes & Noble, John's Fav"} } + data: { "product": {"title": "New product title"} } }).toMatchMadeHttpRequest(); }); it('test_23', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:26-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:26-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [], "image": null}})); + queueMockResponse(JSON.stringify({})); - const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.images = []; - await product.save({}); + await shopify.rest.Product.delete({ + session: session, + id: 632910392, + }); expect({ - method: 'PUT', + method: 'DELETE', domain, path: '/admin/api/2022-10/products/632910392.json', query: '', headers, - data: { "product": {"images": []} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_24', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:30-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 1001473901, "product_id": 632910392, "position": 4, "created_at": "2022-09-28T16:40:30-04:00", "updated_at": "2022-09-28T16:40:30-04:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20220928-1971383-urea82.gif?v=1664397630", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473901"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559595, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:02:18-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:02:18-05:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559595", "variants": [{"id": 1070325052, "product_id": 1071559595, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:02:18-05:00", "updated_at": "2023-01-03T13:02:18-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325052, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325052"}], "options": [{"id": 1055547207, "product_id": 1071559595, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.images = [ - { - "id": 850703190 - }, - { - "id": 562641783 - }, - { - "id": 378407906 - }, - { - "src": "http://example.com/rails_logo.gif" - } - ]; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.status = "draft"; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392.json', + path: '/admin/api/2022-10/products.json', query: '', headers, - data: { "product": {"images": [{"id": 850703190}, {"id": 562641783}, {"id": 378407906}, {"src": "http://example.com/rails_logo.gif"}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "status": "draft"} } }).toMatchMadeHttpRequest(); }); it('test_25', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:33-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:33-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397633", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 850703190, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:33-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397633", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}], "image": {"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:33-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397633", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559585, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:56-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:56-05:00", "published_at": "2023-01-03T13:00:56-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559585", "variants": [{"id": 1070325040, "product_id": 1071559585, "title": "First", "price": "10.00", "sku": "123", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "First", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:56-05:00", "updated_at": "2023-01-03T13:00:56-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325040, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "10.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325040"}, {"id": 1070325041, "product_id": 1071559585, "title": "Second", "price": "20.00", "sku": "123", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Second", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:56-05:00", "updated_at": "2023-01-03T13:00:56-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325041, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "20.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325041"}], "options": [{"id": 1055547196, "product_id": 1071559585, "name": "Title", "position": 1, "values": ["First", "Second"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.images = [ - { - "id": 850703190, - "position": 3 - }, + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.variants = [ { - "id": 562641783, - "position": 2 + "option1": "First", + "price": "10.00", + "sku": "123" }, { - "id": 378407906, - "position": 1 + "option1": "Second", + "price": "20.00", + "sku": "123" } ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392.json', + path: '/admin/api/2022-10/products.json', query: '', headers, - data: { "product": {"images": [{"id": 850703190, "position": 3}, {"id": 562641783, "position": 2}, {"id": 378407906, "position": 1}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "First", "price": "10.00", "sku": "123"}, {"option1": "Second", "price": "20.00", "sku": "123"}]} } }).toMatchMadeHttpRequest(); }); it('test_26', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:36-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:36-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Black", "Green", "Red", "Pink"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559582, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:15-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:15-05:00", "published_at": "2023-01-03T13:00:15-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559582", "variants": [{"id": 1070325035, "product_id": 1071559582, "title": "Blue / 155", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Blue", "option2": "155", "option3": null, "created_at": "2023-01-03T13:00:15-05:00", "updated_at": "2023-01-03T13:00:15-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325035, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325035"}, {"id": 1070325036, "product_id": 1071559582, "title": "Black / 159", "price": "0.00", "sku": "", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Black", "option2": "159", "option3": null, "created_at": "2023-01-03T13:00:15-05:00", "updated_at": "2023-01-03T13:00:15-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325036, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325036"}], "options": [{"id": 1055547192, "product_id": 1071559582, "name": "Color", "position": 1, "values": ["Blue", "Black"]}, {"id": 1055547193, "product_id": 1071559582, "name": "Size", "position": 2, "values": ["155", "159"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; product.variants = [ { - "id": 457924702 + "option1": "Blue", + "option2": "155" }, { - "id": 39072856 - }, + "option1": "Black", + "option2": "159" + } + ]; + product.options = [ { - "id": 49148385 + "name": "Color", + "values": [ + "Blue", + "Black" + ] }, { - "id": 808950810 + "name": "Size", + "values": [ + "155", + "159" + ] } ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392.json', + path: '/admin/api/2022-10/products.json', query: '', headers, - data: { "product": {"variants": [{"id": 457924702}, {"id": 39072856}, {"id": 49148385}, {"id": 808950810}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "Blue", "option2": "155"}, {"option1": "Black", "option2": "159"}], "options": [{"name": "Color", "values": ["Blue", "Black"]}, {"name": "Size", "values": ["155", "159"]}]} } }).toMatchMadeHttpRequest(); }); it('test_27', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "Updated Product Title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:40-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "2000.00", "sku": "Updating the Product SKU", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:40:40-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559586, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:01:04-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:01:04-05:00", "published_at": "2023-01-03T13:01:04-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "Barnes & Noble, Big Air, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/1071559586", "variants": [{"id": 1070325042, "product_id": 1071559586, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:01:04-05:00", "updated_at": "2023-01-03T13:01:04-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325042, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325042"}], "options": [{"id": 1055547197, "product_id": 1071559586, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.title = "Updated Product Title"; - product.variants = [ - { - "id": 808950810, - "price": "2000.00", - "sku": "Updating the Product SKU" - }, - { - "id": 49148385 - }, - { - "id": 39072856 - }, - { - "id": 457924702 - } + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.tags = [ + "Barnes & Noble", + "Big Air", + "John's Fav" ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392.json', + path: '/admin/api/2022-10/products.json', query: '', headers, - data: { "product": {"title": "Updated Product Title", "variants": [{"id": 808950810, "price": "2000.00", "sku": "Updating the Product SKU"}, {"id": 49148385}, {"id": 39072856}, {"id": 457924702}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "tags": ["Barnes & Noble", "Big Air", "John's Fav"]} } }).toMatchMadeHttpRequest(); }); it('test_28', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:37:04-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559578, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T12:59:53-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T12:59:53-05:00", "published_at": "2023-01-03T12:59:53-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559578", "variants": [{"id": 1070325031, "product_id": 1071559578, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325031, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325031"}], "options": [{"id": 1055547186, "product_id": 1071559578, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473906, "product_id": 1071559578, "position": 1, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-j94qo6.gif?v=1672768793", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473906"}], "image": {"id": 1001473906, "product_id": 1071559578, "position": 1, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-j94qo6.gif?v=1672768793", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473906"}}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.metafields_global_title_tag = "Brand new title"; - product.metafields_global_description_tag = "Brand new description"; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "src": "http://example.com/rails_logo.gif" + } + ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392.json', + path: '/admin/api/2022-10/products.json', query: '', headers, - data: { "product": {"metafields_global_title_tag": "Brand new title", "metafields_global_description_tag": "Brand new description"} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"src": "http://example.com/rails_logo.gif"}]} } }).toMatchMadeHttpRequest(); }); it('test_29', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:45-04:00", "published_at": "2022-09-28T16:40:45-04:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559583, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:23-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:23-05:00", "published_at": "2023-01-03T13:00:23-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559583", "variants": [{"id": 1070325037, "product_id": 1071559583, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325037, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325037"}], "options": [{"id": 1055547194, "product_id": 1071559583, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473907, "product_id": 1071559583, "position": 1, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768823", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473907"}], "image": {"id": 1001473907, "product_id": 1071559583, "position": 1, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768823", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473907"}}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; - product.published = true; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + } + ]; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392.json', + path: '/admin/api/2022-10/products.json', query: '', headers, - data: { "product": {"published": true} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}]} } }).toMatchMadeHttpRequest(); }); it('test_30', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:47-04:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559581, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:09-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:09-05:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559581", "variants": [{"id": 1070325034, "product_id": 1071559581, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:09-05:00", "updated_at": "2023-01-03T13:00:09-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325034, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325034"}], "options": [{"id": 1055547191, "product_id": 1071559581, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; product.published = false; await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392.json', + path: '/admin/api/2022-10/products.json', query: '', headers, - data: { "product": {"published": false} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "published": false} } }).toMatchMadeHttpRequest(); }); it('test_31', async () => { - queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2022-09-28T16:37:04-04:00", "handle": "ipod-nano", "updated_at": "2022-09-28T16:40:49-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664397424", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2022-09-28T16:37:04-04:00", "updated_at": "2022-09-28T16:37:04-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664397424", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559576, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T12:59:44-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T12:59:44-05:00", "published_at": "2023-01-03T12:59:44-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559576", "variants": [{"id": 1070325030, "product_id": 1071559576, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T12:59:44-05:00", "updated_at": "2023-01-03T12:59:44-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325030, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325030"}], "options": [{"id": 1055547183, "product_id": 1071559576, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); const product = new shopify.rest.Product({session: session}); - product.id = 632910392; + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; product.metafields = [ { "key": "new", @@ -724,30 +720,34 @@ describe('Product resource', () => { await product.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392.json', + path: '/admin/api/2022-10/products.json', query: '', headers, - data: { "product": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_32', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"product": {"id": 1071559584, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:52-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:52-05:00", "published_at": "2023-01-03T13:00:52-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559584", "variants": [{"id": 1070325039, "product_id": 1071559584, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:52-05:00", "updated_at": "2023-01-03T13:00:52-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325039, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325039"}], "options": [{"id": 1055547195, "product_id": 1071559584, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); - await shopify.rest.Product.delete({ - session: session, - id: 632910392, - }); + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.metafields_global_title_tag = "Product SEO Title"; + product.metafields_global_description_tag = "Product SEO Description"; + await product.save({}); expect({ - method: 'DELETE', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392.json', + path: '/admin/api/2022-10/products.json', query: '', headers, - data: undefined + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields_global_title_tag": "Product SEO Title", "metafields_global_description_tag": "Product SEO Description"} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/product_listing.test.ts b/rest/admin/__tests__/2022-10/product_listing.test.ts index aa7a7d9e3..2440f735f 100644 --- a/rest/admin/__tests__/2022-10/product_listing.test.ts +++ b/rest/admin/__tests__/2022-10/product_listing.test.ts @@ -31,7 +31,7 @@ describe('ProductListing resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"product_listings": [{"product_id": 632910392, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "handle": "ipod-nano", "product_type": "Cult Products", "title": "IPod Nano - 8GB", "vendor": "Apple", "available": true, "tags": "Emotive, Flash Memory, MP3, Music", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 808950810, "title": "Pink", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Pink"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008PINK", "barcode": "1234_pink", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 10, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": 562641783, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}, {"id": 49148385, "title": "Red", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Red"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008RED", "barcode": "1234_red", "taxable": true, "position": 2, "available": true, "inventory_policy": "continue", "inventory_quantity": 20, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}, {"id": 39072856, "title": "Green", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Green"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008GREEN", "barcode": "1234_green", "taxable": true, "position": 3, "available": true, "inventory_policy": "continue", "inventory_quantity": 30, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}, {"id": 457924702, "title": "Black", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008BLACK", "barcode": "1234_black", "taxable": true, "position": 4, "available": true, "inventory_policy": "continue", "inventory_quantity": 40, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [{"id": 850703190, "created_at": "2022-10-03T12:15:55-04:00", "position": 1, "updated_at": "2022-10-03T12:15:55-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "width": 123, "height": 456}, {"id": 562641783, "created_at": "2022-10-03T12:15:55-04:00", "position": 2, "updated_at": "2022-10-03T12:15:55-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1664813755", "variant_ids": [808950810], "width": 123, "height": 456}, {"id": 378407906, "created_at": "2022-10-03T12:15:55-04:00", "position": 3, "updated_at": "2022-10-03T12:15:55-04:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1664813755", "variant_ids": [], "width": 123, "height": 456}], "options": [{"id": 594680422, "name": "Color", "product_id": 632910392, "position": 1, "values": ["Pink", "Red", "Green", "Black"]}]}, {"product_id": 921728736, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}]})); + queueMockResponse(JSON.stringify({"product_listings": [{"product_id": 632910392, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "handle": "ipod-nano", "product_type": "Cult Products", "title": "IPod Nano - 8GB", "vendor": "Apple", "available": true, "tags": "Emotive, Flash Memory, MP3, Music", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 808950810, "title": "Pink", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Pink"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008PINK", "barcode": "1234_pink", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 10, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": 562641783, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 49148385, "title": "Red", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Red"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008RED", "barcode": "1234_red", "taxable": true, "position": 2, "available": true, "inventory_policy": "continue", "inventory_quantity": 20, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 39072856, "title": "Green", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Green"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008GREEN", "barcode": "1234_green", "taxable": true, "position": 3, "available": true, "inventory_policy": "continue", "inventory_quantity": 30, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 457924702, "title": "Black", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008BLACK", "barcode": "1234_black", "taxable": true, "position": 4, "available": true, "inventory_policy": "continue", "inventory_quantity": 40, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [{"id": 850703190, "created_at": "2023-01-03T12:05:09-05:00", "position": 1, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672765509", "variant_ids": [], "width": 123, "height": 456}, {"id": 562641783, "created_at": "2023-01-03T12:05:09-05:00", "position": 2, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672765509", "variant_ids": [808950810], "width": 123, "height": 456}, {"id": 378407906, "created_at": "2023-01-03T12:05:09-05:00", "position": 3, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672765509", "variant_ids": [], "width": 123, "height": 456}], "options": [{"id": 594680422, "name": "Color", "product_id": 632910392, "position": 1, "values": ["Pink", "Red", "Green", "Black"]}]}, {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}]})); await shopify.rest.ProductListing.all({ session: session, @@ -82,7 +82,7 @@ describe('ProductListing resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); await shopify.rest.ProductListing.find({ session: session, @@ -100,7 +100,7 @@ describe('ProductListing resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2022-10-03T12:15:55-04:00", "updated_at": "2022-10-03T12:15:55-04:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); const product_listing = new shopify.rest.ProductListing({session: session}); product_listing.product_id = 921728736; diff --git a/rest/admin/__tests__/2022-10/product_resource_feedback.test.ts b/rest/admin/__tests__/2022-10/product_resource_feedback.test.ts index 51d087f9f..b37bb85e6 100644 --- a/rest/admin/__tests__/2022-10/product_resource_feedback.test.ts +++ b/rest/admin/__tests__/2022-10/product_resource_feedback.test.ts @@ -31,7 +31,7 @@ describe('ProductResourceFeedback resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T13:22:08-04:00", "updated_at": "2022-10-03T13:22:08-04:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2022-10-03T13:07:13-04:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2022-10-03T13:22:08-04:00", "state": "requires_action"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:45:42-05:00", "updated_at": "2023-01-03T12:45:42-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2023-01-03T12:45:40-05:00", "state": "requires_action"}})); const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); product_resource_feedback.product_id = 632910392; @@ -39,8 +39,8 @@ describe('ProductResourceFeedback resource', () => { product_resource_feedback.messages = [ "Needs at least one image." ]; - product_resource_feedback.resource_updated_at = "2022-10-03T13:07:13-04:00"; - product_resource_feedback.feedback_generated_at = "2022-10-03T17:22:08.114485Z"; + product_resource_feedback.resource_updated_at = "2023-01-03T12:21:36-05:00"; + product_resource_feedback.feedback_generated_at = "2023-01-03T17:45:40.928568Z"; await product_resource_feedback.save({}); expect({ @@ -49,18 +49,18 @@ describe('ProductResourceFeedback resource', () => { path: '/admin/api/2022-10/products/632910392/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "requires_action", "messages": ["Needs at least one image."], "resource_updated_at": "2022-10-03T13:07:13-04:00", "feedback_generated_at": "2022-10-03T17:22:08.114485Z"} } + data: { "resource_feedback": {"state": "requires_action", "messages": ["Needs at least one image."], "resource_updated_at": "2023-01-03T12:21:36-05:00", "feedback_generated_at": "2023-01-03T17:45:40.928568Z"} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T13:22:10-04:00", "updated_at": "2022-10-03T13:22:10-04:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2022-10-03T13:07:13-04:00", "messages": [], "feedback_generated_at": "2022-10-03T13:22:09-04:00", "state": "success"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:45:45-05:00", "updated_at": "2023-01-03T12:45:45-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": [], "feedback_generated_at": "2023-01-03T12:45:44-05:00", "state": "success"}})); const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); product_resource_feedback.product_id = 632910392; product_resource_feedback.state = "success"; - product_resource_feedback.resource_updated_at = "2022-10-03T13:07:13-04:00"; - product_resource_feedback.feedback_generated_at = "2022-10-03T17:22:09.073706Z"; + product_resource_feedback.resource_updated_at = "2023-01-03T12:21:36-05:00"; + product_resource_feedback.feedback_generated_at = "2023-01-03T17:45:44.063762Z"; await product_resource_feedback.save({}); expect({ @@ -69,12 +69,12 @@ describe('ProductResourceFeedback resource', () => { path: '/admin/api/2022-10/products/632910392/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "success", "resource_updated_at": "2022-10-03T13:07:13-04:00", "feedback_generated_at": "2022-10-03T17:22:09.073706Z"} } + data: { "resource_feedback": {"state": "success", "resource_updated_at": "2023-01-03T12:21:36-05:00", "feedback_generated_at": "2023-01-03T17:45:44.063762Z"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2022-10-03T13:22:11-04:00", "updated_at": "2022-10-03T13:22:11-04:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2022-10-03T13:07:13-04:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2022-10-03T12:22:11-04:00", "state": "requires_action"}]})); + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2023-01-03T12:45:45-05:00", "updated_at": "2023-01-03T12:45:45-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2023-01-03T11:45:45-05:00", "state": "requires_action"}]})); await shopify.rest.ProductResourceFeedback.all({ session: session, diff --git a/rest/admin/__tests__/2022-10/recurring_application_charge.test.ts b/rest/admin/__tests__/2022-10/recurring_application_charge.test.ts index 13bfc3325..c20a6c89f 100644 --- a/rest/admin/__tests__/2022-10/recurring_application_charge.test.ts +++ b/rest/admin/__tests__/2022-10/recurring_application_charge.test.ts @@ -31,12 +31,13 @@ describe('RecurringApplicationCharge resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266947, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:52:52-04:00", "updated_at": "2022-10-03T12:52:52-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266947", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266947/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBANeWT06EmF1dG9fYWN0aXZhdGVU--fd1fceece89091b9d39f3c13b2b6ba1868c07823"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266949, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:35-05:00", "updated_at": "2023-01-03T13:06:35-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 5, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266949", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266949/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAVeWT06EmF1dG9fYWN0aXZhdGVU--9b5c79476bf6e10095d51a27255892c04e5dd4fa"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + recurring_application_charge.trial_days = 5; await recurring_application_charge.save({}); expect({ @@ -45,18 +46,19 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-10/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com"} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "trial_days": 5} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266950, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:52:58-04:00", "updated_at": "2022-10-03T12:52:58-04:00", "test": true, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266950", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266950/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAZeWT06EmF1dG9fYWN0aXZhdGVU--c5d071902db4f2e27dd740432882625a5fab74c9"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266951, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:39-05:00", "updated_at": "2023-01-03T13:06:39-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": null, "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266951", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266951/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAdeWT06EmF1dG9fYWN0aXZhdGVU--4e07fb141094c2ffacfcff713a2dc85eab38a229"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; - recurring_application_charge.test = true; + recurring_application_charge.capped_amount = 100; + recurring_application_charge.terms = "$1 for 1000 emails"; await recurring_application_charge.save({}); expect({ @@ -65,19 +67,17 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-10/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "capped_amount": 100, "terms": "$1 for 1000 emails"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266951, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:52:59-04:00", "updated_at": "2022-10-03T12:52:59-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": null, "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266951", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266951/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAdeWT06EmF1dG9fYWN0aXZhdGVU--c1960487d59ce5a37a7ff2dfa85ca64c904b92cd"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266952, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:41-05:00", "updated_at": "2023-01-03T13:06:41-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266952", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266952/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAheWT06EmF1dG9fYWN0aXZhdGVU--c278a9ebe0e4885c8b9df2be46598c9b9abf0731"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; - recurring_application_charge.capped_amount = 100; - recurring_application_charge.terms = "$1 for 1000 emails"; await recurring_application_charge.save({}); expect({ @@ -86,18 +86,18 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-10/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "capped_amount": 100, "terms": "$1 for 1000 emails"} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com"} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266954, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:53:11-04:00", "updated_at": "2022-10-03T12:53:11-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 5, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266954", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266954/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBApeWT06EmF1dG9fYWN0aXZhdGVU--784a3d7ab3ffbe680e66bc9b6017f0b19a84eb94"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266954, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:51-05:00", "updated_at": "2023-01-03T13:06:51-05:00", "test": true, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266954", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266954/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBApeWT06EmF1dG9fYWN0aXZhdGVU--f0a955813cb17f90e052cdbc976832ce6f213068"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.name = "Super Duper Plan"; recurring_application_charge.price = 10.0; recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; - recurring_application_charge.trial_days = 5; + recurring_application_charge.test = true; await recurring_application_charge.save({}); expect({ @@ -106,22 +106,21 @@ describe('RecurringApplicationCharge resource', () => { path: '/admin/api/2022-10/recurring_application_charges.json', query: '', headers, - data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "trial_days": 5} } + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "pending", "return_url": "http://yourapp.example.org", "billing_on": "2022-10-03", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVU--b5f90d04779cc5242b396e4054f2e650c5dace1c"}})); + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "accepted", "return_url": "http://yourapp.example.org", "billing_on": "2023-01-03", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:06:22-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195"}]})); - await shopify.rest.RecurringApplicationCharge.find({ + await shopify.rest.RecurringApplicationCharge.all({ session: session, - id: 455696195, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/recurring_application_charges/455696195.json', + path: '/admin/api/2022-10/recurring_application_charges.json', query: '', headers, data: undefined @@ -129,52 +128,53 @@ describe('RecurringApplicationCharge resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 1029266947, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:21-05:00", "updated_at": "2023-01-03T13:06:21-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266947", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266947/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBANeWT06EmF1dG9fYWN0aXZhdGVU--4e6554253be678506a3421452fb801fd291e6db7"}]})); - await shopify.rest.RecurringApplicationCharge.delete({ + await shopify.rest.RecurringApplicationCharge.all({ session: session, - id: 455696195, + since_id: "455696195", }); expect({ - method: 'DELETE', + method: 'GET', domain, - path: '/admin/api/2022-10/recurring_application_charges/455696195.json', - query: '', + path: '/admin/api/2022-10/recurring_application_charges.json', + query: 'since_id=455696195', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 1029266953, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2022-10-03T12:53:09-04:00", "updated_at": "2022-10-03T12:53:09-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266953", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266953/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAleWT06EmF1dG9fYWN0aXZhdGVU--1255bd14c50f77b5a2bab1190e116c8784e01280"}]})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "pending", "return_url": "http://yourapp.example.org", "billing_on": "2023-01-03", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVU--b5f90d04779cc5242b396e4054f2e650c5dace1c"}})); - await shopify.rest.RecurringApplicationCharge.all({ + await shopify.rest.RecurringApplicationCharge.find({ session: session, - since_id: "455696195", + id: 455696195, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/recurring_application_charges.json', - query: 'since_id=455696195', + path: '/admin/api/2022-10/recurring_application_charges/455696195.json', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "accepted", "return_url": "http://yourapp.example.org", "billing_on": "2022-10-03", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:53:11-04:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195"}]})); + queueMockResponse(JSON.stringify({})); - await shopify.rest.RecurringApplicationCharge.all({ + await shopify.rest.RecurringApplicationCharge.delete({ session: session, + id: 455696195, }); expect({ - method: 'GET', + method: 'DELETE', domain, - path: '/admin/api/2022-10/recurring_application_charges.json', + path: '/admin/api/2022-10/recurring_application_charges/455696195.json', query: '', headers, data: undefined @@ -182,7 +182,7 @@ describe('RecurringApplicationCharge resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"recurring_application_charge": {"return_url": "http://yourapp.example.org/", "id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "active", "billing_on": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:53:07-04:00", "test": null, "activated_on": "2022-10-03", "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": "2022-10-03", "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://yourapp.example.org/?charge_id=455696195", "update_capped_amount_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_update_capped_amount?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVG--4fa9614788ca5e1cf650a7e46ca7681295b568d8"}})); + queueMockResponse(JSON.stringify({"recurring_application_charge": {"return_url": "http://yourapp.example.org/", "id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "active", "billing_on": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:06:19-05:00", "test": null, "activated_on": "2023-01-03", "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": "2023-01-03", "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://yourapp.example.org/?charge_id=455696195", "update_capped_amount_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_update_capped_amount?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVG--c9d104c0a19c52b84fa17360f32abc13aae86935"}})); const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); recurring_application_charge.id = 455696195; diff --git a/rest/admin/__tests__/2022-10/redirect.test.ts b/rest/admin/__tests__/2022-10/redirect.test.ts index b60ea83ef..4e5faff01 100644 --- a/rest/admin/__tests__/2022-10/redirect.test.ts +++ b/rest/admin/__tests__/2022-10/redirect.test.ts @@ -174,7 +174,7 @@ describe('Redirect resource', () => { }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"redirect": {"id": 984542199, "path": "/ipod", "target": "/pages/itunes"}})); + queueMockResponse(JSON.stringify({"redirect": {"id": 984542200, "path": "/ipod", "target": "/pages/itunes"}})); const redirect = new shopify.rest.Redirect({session: session}); redirect.path = "/ipod"; @@ -192,7 +192,7 @@ describe('Redirect resource', () => { }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"redirect": {"id": 984542200, "path": "/forums", "target": "http://forums.apple.com/"}})); + queueMockResponse(JSON.stringify({"redirect": {"id": 984542199, "path": "/forums", "target": "http://forums.apple.com/"}})); const redirect = new shopify.rest.Redirect({session: session}); redirect.path = "http://www.apple.com/forums"; diff --git a/rest/admin/__tests__/2022-10/refund.test.ts b/rest/admin/__tests__/2022-10/refund.test.ts index 6afbdc95c..bbae20cc9 100644 --- a/rest/admin/__tests__/2022-10/refund.test.ts +++ b/rest/admin/__tests__/2022-10/refund.test.ts @@ -31,7 +31,7 @@ describe('Refund resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"refunds": [{"id": 509562969, "order_id": 450789469, "created_at": "2022-10-03T12:44:45-04:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2022-10-03T12:44:45-04:00", "restock": true, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}]})); + queueMockResponse(JSON.stringify({"refunds": [{"id": 509562969, "order_id": 450789469, "created_at": "2023-01-03T12:56:35-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2023-01-03T12:56:35-05:00", "restock": true, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}]})); await shopify.rest.Refund.all({ session: session, @@ -49,18 +49,28 @@ describe('Refund resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"refund": {"id": 929361463, "order_id": 450789469, "created_at": "2022-10-03T12:51:57-04:00", "note": null, "user_id": null, "processed_at": "2022-10-03T12:51:57-04:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "refund_line_items": [], "transactions": [{"id": 1068278470, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-10-03T12:51:57-04:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2022-10-03T12:51:57-04:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "currency_exchange_adjustment": null, "amount": "5.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278470"}], "order_adjustments": [{"id": 1030976842, "order_id": 450789469, "refund_id": 929361463, "amount": "-5.00", "tax_amount": "0.00", "kind": "shipping_refund", "reason": "Shipping refund", "amount_set": {"shop_money": {"amount": "-5.00", "currency_code": "USD"}, "presentment_money": {"amount": "-5.00", "currency_code": "USD"}}, "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}]}})); + queueMockResponse(JSON.stringify({"refund": {"id": 929361465, "order_id": 450789469, "created_at": "2023-01-03T13:05:55-05:00", "note": "wrong size", "user_id": null, "processed_at": "2023-01-03T13:05:55-05:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/929361465", "refund_line_items": [{"location_id": null, "restock_type": "no_restock", "quantity": 1, "id": 1058498312, "line_item_id": 518995019, "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 1068278491, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T13:05:54-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2023-01-03T13:05:54-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "41.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278491"}], "order_adjustments": []}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; refund.currency = "USD"; + refund.notify = true; + refund.note = "wrong size"; refund.shipping = { - "amount": 5.0 + "full_refund": true }; + refund.refund_line_items = [ + { + "line_item_id": 518995019, + "quantity": 1, + "restock_type": "return", + "location_id": 487838322 + } + ]; refund.transactions = [ { "parent_id": 801038806, - "amount": 5.0, + "amount": 41.94, "kind": "refund", "gateway": "bogus" } @@ -73,33 +83,23 @@ describe('Refund resource', () => { path: '/admin/api/2022-10/orders/450789469/refunds.json', query: '', headers, - data: { "refund": {"currency": "USD", "shipping": {"amount": 5.0}, "transactions": [{"parent_id": 801038806, "amount": 5.0, "kind": "refund", "gateway": "bogus"}]} } + data: { "refund": {"currency": "USD", "notify": true, "note": "wrong size", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "return", "location_id": 487838322}], "transactions": [{"parent_id": 801038806, "amount": 41.94, "kind": "refund", "gateway": "bogus"}]} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"refund": {"id": 929361464, "order_id": 450789469, "created_at": "2022-10-03T12:52:06-04:00", "note": "wrong size", "user_id": null, "processed_at": "2022-10-03T12:52:06-04:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/Refund/929361464", "refund_line_items": [{"location_id": null, "restock_type": "no_restock", "quantity": 1, "id": 1058498308, "line_item_id": 518995019, "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 1068278471, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-10-03T12:52:05-04:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2022-10-03T12:52:05-04:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "currency_exchange_adjustment": null, "amount": "41.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278471"}], "order_adjustments": []}})); + queueMockResponse(JSON.stringify({"refund": {"id": 929361466, "order_id": 450789469, "created_at": "2023-01-03T13:05:59-05:00", "note": null, "user_id": null, "processed_at": "2023-01-03T13:05:59-05:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/929361466", "refund_line_items": [], "transactions": [{"id": 1068278492, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T13:05:59-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2023-01-03T13:05:59-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "5.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278492"}], "order_adjustments": [{"id": 1030976843, "order_id": 450789469, "refund_id": 929361466, "amount": "-5.00", "tax_amount": "0.00", "kind": "shipping_refund", "reason": "Shipping refund", "amount_set": {"shop_money": {"amount": "-5.00", "currency_code": "USD"}, "presentment_money": {"amount": "-5.00", "currency_code": "USD"}}, "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}]}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; refund.currency = "USD"; - refund.notify = true; - refund.note = "wrong size"; refund.shipping = { - "full_refund": true + "amount": 5.0 }; - refund.refund_line_items = [ - { - "line_item_id": 518995019, - "quantity": 1, - "restock_type": "return", - "location_id": 487838322 - } - ]; refund.transactions = [ { "parent_id": 801038806, - "amount": 41.94, + "amount": 5.0, "kind": "refund", "gateway": "bogus" } @@ -112,12 +112,12 @@ describe('Refund resource', () => { path: '/admin/api/2022-10/orders/450789469/refunds.json', query: '', headers, - data: { "refund": {"currency": "USD", "notify": true, "note": "wrong size", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "return", "location_id": 487838322}], "transactions": [{"parent_id": 801038806, "amount": 41.94, "kind": "refund", "gateway": "bogus"}]} } + data: { "refund": {"currency": "USD", "shipping": {"amount": 5.0}, "transactions": [{"parent_id": 801038806, "amount": 5.0, "kind": "refund", "gateway": "bogus"}]} } }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"refund": {"id": 509562969, "order_id": 450789469, "created_at": "2022-10-03T12:44:45-04:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2022-10-03T12:44:45-04:00", "restock": true, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "c901414060.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}})); + queueMockResponse(JSON.stringify({"refund": {"id": 509562969, "order_id": 450789469, "created_at": "2023-01-03T12:56:35-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2023-01-03T12:56:35-05:00", "restock": true, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}})); await shopify.rest.Refund.find({ session: session, @@ -136,12 +136,12 @@ describe('Refund resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "2.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "2.00", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; await refund.calculate({ - body: {"refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + body: {"refund": {"currency": "USD", "shipping": {"amount": 2.0}}}, }); expect({ @@ -150,17 +150,17 @@ describe('Refund resource', () => { path: '/admin/api/2022-10/orders/450789469/refunds/calculate.json', query: '', headers, - data: { "refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + data: { "refund": {"currency": "USD", "shipping": {"amount": 2.0}} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; await refund.calculate({ - body: {"refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + body: {"refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, }); expect({ @@ -169,17 +169,17 @@ describe('Refund resource', () => { path: '/admin/api/2022-10/orders/450789469/refunds/calculate.json', query: '', headers, - data: { "refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + data: { "refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "2.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "refund_line_items": [], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "2.00", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); const refund = new shopify.rest.Refund({session: session}); refund.order_id = 450789469; await refund.calculate({ - body: {"refund": {"currency": "USD", "shipping": {"amount": 2.0}}}, + body: {"refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, }); expect({ @@ -188,7 +188,7 @@ describe('Refund resource', () => { path: '/admin/api/2022-10/orders/450789469/refunds/calculate.json', query: '', headers, - data: { "refund": {"currency": "USD", "shipping": {"amount": 2.0}} } + data: { "refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/report.test.ts b/rest/admin/__tests__/2022-10/report.test.ts index da1be9d0a..78a24f4a7 100644 --- a/rest/admin/__tests__/2022-10/report.test.ts +++ b/rest/admin/__tests__/2022-10/report.test.ts @@ -31,113 +31,95 @@ describe('Report resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2022-10-03T12:44:45-04:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}, {"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, + since_id: "123", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/reports.json', - query: '', + query: 'since_id=123', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2022-10-03T12:44:45-04:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, - updated_at_min: "2005-07-31 15:57:11 EDT -04:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/reports.json', - query: 'updated_at_min=2005-07-31+15%3A57%3A11+EDT+-04%3A00', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales"}, {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}]})); await shopify.rest.Report.all({ session: session, - ids: "517154478", + fields: "id,shopify_ql", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/reports.json', - query: 'ids=517154478', + query: 'fields=id%2Cshopify_ql', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}, {"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2022-10-03T12:44:45-04:00", "category": "custom_app_reports"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, - since_id: "123", + ids: "517154478", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/reports.json', - query: 'since_id=123', + query: 'ids=517154478', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales"}, {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}]})); + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); await shopify.rest.Report.all({ session: session, - fields: "id,shopify_ql", + updated_at_min: "2005-07-31 15:57:11 EDT -04:00", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/reports.json', - query: 'fields=id%2Cshopify_ql', + query: 'updated_at_min=2005-07-31+15%3A57%3A11+EDT+-04%3A00', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"report": {"id": 1016888664, "name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales", "updated_at": "2022-10-03T12:53:33-04:00", "category": "custom_app_reports"}})); - - const report = new shopify.rest.Report({session: session}); - report.name = "A new app report"; - report.shopify_ql = "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"; - await report.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-10/reports.json', - query: '', - headers, - data: { "report": {"name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"} } - }).toMatchMadeHttpRequest(); - }); - - it('test_7', async () => { queueMockResponse(JSON.stringify({"report": {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}})); await shopify.rest.Report.find({ @@ -155,7 +137,7 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { + it('test_7', async () => { queueMockResponse(JSON.stringify({"report": {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}})); await shopify.rest.Report.find({ @@ -174,8 +156,8 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_9', async () => { - queueMockResponse(JSON.stringify({"report": {"name": "Changed Report Name", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -12m UNTIL today ORDER BY total_sales", "id": 517154478, "updated_at": "2022-10-03T12:53:27-04:00", "category": "custom_app_reports"}})); + it('test_8', async () => { + queueMockResponse(JSON.stringify({"report": {"name": "Changed Report Name", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -12m UNTIL today ORDER BY total_sales", "id": 517154478, "updated_at": "2023-01-03T12:47:04-05:00", "category": "custom_app_reports"}})); const report = new shopify.rest.Report({session: session}); report.id = 517154478; @@ -193,7 +175,7 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_10', async () => { + it('test_9', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.Report.delete({ @@ -211,4 +193,22 @@ describe('Report resource', () => { }).toMatchMadeHttpRequest(); }); + it('test_10', async () => { + queueMockResponse(JSON.stringify({"report": {"id": 1016888664, "name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales", "updated_at": "2023-01-03T12:46:45-05:00", "category": "custom_app_reports"}})); + + const report = new shopify.rest.Report({session: session}); + report.name = "A new app report"; + report.shopify_ql = "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"; + await report.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/reports.json', + query: '', + headers, + data: { "report": {"name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"} } + }).toMatchMadeHttpRequest(); + }); + }); diff --git a/rest/admin/__tests__/2022-10/resource_feedback.test.ts b/rest/admin/__tests__/2022-10/resource_feedback.test.ts index 91b71fe6a..d64d314a3 100644 --- a/rest/admin/__tests__/2022-10/resource_feedback.test.ts +++ b/rest/admin/__tests__/2022-10/resource_feedback.test.ts @@ -31,14 +31,14 @@ describe('ResourceFeedback resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T12:45:53-04:00", "updated_at": "2022-10-03T12:45:53-04:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2022-10-03T12:45:51-04:00", "state": "requires_action"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:53:47-05:00", "updated_at": "2023-01-03T12:53:47-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T12:53:46-05:00", "state": "requires_action"}})); const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); resource_feedback.state = "requires_action"; resource_feedback.messages = [ "is not connected. Connect your account to use this sales channel." ]; - resource_feedback.feedback_generated_at = "2022-10-03T16:45:51.594730Z"; + resource_feedback.feedback_generated_at = "2023-01-03T17:53:46.212756Z"; await resource_feedback.save({}); expect({ @@ -47,16 +47,16 @@ describe('ResourceFeedback resource', () => { path: '/admin/api/2022-10/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "requires_action", "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2022-10-03T16:45:51.594730Z"} } + data: { "resource_feedback": {"state": "requires_action", "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T17:53:46.212756Z"} } }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2022-10-03T12:45:55-04:00", "updated_at": "2022-10-03T12:45:55-04:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": [], "feedback_generated_at": "2022-10-03T12:45:53-04:00", "state": "success"}})); + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:53:50-05:00", "updated_at": "2023-01-03T12:53:50-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": [], "feedback_generated_at": "2023-01-03T12:53:49-05:00", "state": "success"}})); const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); resource_feedback.state = "success"; - resource_feedback.feedback_generated_at = "2022-10-03T16:45:53.872041Z"; + resource_feedback.feedback_generated_at = "2023-01-03T17:53:49.185362Z"; await resource_feedback.save({}); expect({ @@ -65,12 +65,12 @@ describe('ResourceFeedback resource', () => { path: '/admin/api/2022-10/resource_feedback.json', query: '', headers, - data: { "resource_feedback": {"state": "success", "feedback_generated_at": "2022-10-03T16:45:53.872041Z"} } + data: { "resource_feedback": {"state": "success", "feedback_generated_at": "2023-01-03T17:53:49.185362Z"} } }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2022-10-03T12:45:57-04:00", "updated_at": "2022-10-03T12:45:57-04:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2022-10-03T11:45:57-04:00", "state": "requires_action"}]})); + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2023-01-03T12:53:44-05:00", "updated_at": "2023-01-03T12:53:44-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T11:53:44-05:00", "state": "requires_action"}]})); await shopify.rest.ResourceFeedback.all({ session: session, diff --git a/rest/admin/__tests__/2022-10/script_tag.test.ts b/rest/admin/__tests__/2022-10/script_tag.test.ts index a070181cf..d24c16c3e 100644 --- a/rest/admin/__tests__/2022-10/script_tag.test.ts +++ b/rest/admin/__tests__/2022-10/script_tag.test.ts @@ -31,59 +31,77 @@ describe('ScriptTag resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}]})); + queueMockResponse(JSON.stringify({"script_tags": [{"id": 421379493, "src": "https://js.example.org/bar.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}, {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); await shopify.rest.ScriptTag.all({ session: session, - since_id: "421379493", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/script_tags.json', - query: 'since_id=421379493', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}]})); + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); await shopify.rest.ScriptTag.all({ session: session, - src: "https://js.example.org/foo.js", + since_id: "421379493", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/script_tags.json', - query: 'src=https%3A%2F%2Fjs.example.org%2Ffoo.js', + query: 'since_id=421379493', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"script_tags": [{"id": 421379493, "src": "https://js.example.org/bar.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}, {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all"}]})); + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); await shopify.rest.ScriptTag.all({ session: session, + src: "https://js.example.org/foo.js", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/script_tags.json', - query: '', + query: 'src=https%3A%2F%2Fjs.example.org%2Ffoo.js', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"id": 870402688, "src": "https://example.com/my_script.js", "event": "onload", "created_at": "2023-01-03T12:54:19-05:00", "updated_at": "2023-01-03T12:54:19-05:00", "display_scope": "all", "cache": false}})); + + const script_tag = new shopify.rest.ScriptTag({session: session}); + script_tag.event = "onload"; + script_tag.src = "https://example.com/my_script.js"; + await script_tag.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2022-10/script_tags.json', + query: '', + headers, + data: { "script_tag": {"event": "onload", "src": "https://example.com/my_script.js"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { queueMockResponse(JSON.stringify({"count": 2})); await shopify.rest.ScriptTag.count({ @@ -100,8 +118,8 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_5', async () => { - queueMockResponse(JSON.stringify({"script_tag": {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "display_scope": "all", "cache": false}})); + it('test_6', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all", "cache": false}})); await shopify.rest.ScriptTag.find({ session: session, @@ -118,8 +136,8 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_6', async () => { - queueMockResponse(JSON.stringify({"script_tag": {"src": "https://somewhere-else.com/another.js", "cache": false, "id": 596726825, "event": "onload", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:46:10-04:00", "display_scope": "all"}})); + it('test_7', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"src": "https://somewhere-else.com/another.js", "cache": false, "id": 596726825, "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:54:18-05:00", "display_scope": "all"}})); const script_tag = new shopify.rest.ScriptTag({session: session}); script_tag.id = 596726825; @@ -136,7 +154,7 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_7', async () => { + it('test_8', async () => { queueMockResponse(JSON.stringify({})); await shopify.rest.ScriptTag.delete({ @@ -154,22 +172,4 @@ describe('ScriptTag resource', () => { }).toMatchMadeHttpRequest(); }); - it('test_8', async () => { - queueMockResponse(JSON.stringify({"script_tag": {"id": 870402687, "src": "https://example.com/my_script.js", "event": "onload", "created_at": "2022-10-03T12:46:20-04:00", "updated_at": "2022-10-03T12:46:20-04:00", "display_scope": "all", "cache": false}})); - - const script_tag = new shopify.rest.ScriptTag({session: session}); - script_tag.event = "onload"; - script_tag.src = "https://example.com/my_script.js"; - await script_tag.save({}); - - expect({ - method: 'POST', - domain, - path: '/admin/api/2022-10/script_tags.json', - query: '', - headers, - data: { "script_tag": {"event": "onload", "src": "https://example.com/my_script.js"} } - }).toMatchMadeHttpRequest(); - }); - }); diff --git a/rest/admin/__tests__/2022-10/shop.test.ts b/rest/admin/__tests__/2022-10/shop.test.ts index d323cfa60..65c95b9f1 100644 --- a/rest/admin/__tests__/2022-10/shop.test.ts +++ b/rest/admin/__tests__/2022-10/shop.test.ts @@ -31,7 +31,7 @@ describe('Shop resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"shop": {"id": 548380009, "name": "John Smith Test Store", "email": "j.smith@example.com", "domain": "shop.apple.com", "province": "California", "country": "US", "address1": "1 Infinite Loop", "zip": "95014", "city": "Cupertino", "source": null, "phone": "1231231234", "latitude": 45.45, "longitude": -75.43, "primary_locale": "en", "address2": "Suite 100", "created_at": "2007-12-31T19:00:00-05:00", "updated_at": "2022-10-03T13:22:14-04:00", "country_code": "US", "country_name": "United States", "currency": "USD", "customer_email": "customers@apple.com", "timezone": "(GMT-05:00) Eastern Time (US & Canada)", "iana_timezone": "America/New_York", "shop_owner": "John Smith", "money_format": "${{amount}}", "money_with_currency_format": "${{amount}} USD", "weight_unit": "lb", "province_code": "CA", "taxes_included": null, "auto_configure_tax_inclusivity": null, "tax_shipping": null, "county_taxes": true, "plan_display_name": "Shopify Plus", "plan_name": "enterprise", "has_discounts": true, "has_gift_cards": true, "myshopify_domain": "jsmith.myshopify.com", "google_apps_domain": null, "google_apps_login_enabled": null, "money_in_emails_format": "${{amount}}", "money_with_currency_in_emails_format": "${{amount}} USD", "eligible_for_payments": true, "requires_extra_payments_agreement": false, "password_enabled": false, "has_storefront": true, "eligible_for_card_reader_giveaway": false, "finances": true, "primary_location_id": 655441491, "cookie_consent_level": "implicit", "visitor_tracking_consent_preference": "allow_all", "checkout_api_supported": true, "multi_location_enabled": true, "setup_required": false, "pre_launch_enabled": false, "enabled_presentment_currencies": ["USD"], "transactional_sms_disabled": false, "marketing_sms_consent_enabled_at_checkout": false}})); + queueMockResponse(JSON.stringify({"shop": {"id": 548380009, "name": "John Smith Test Store", "email": "j.smith@example.com", "domain": "shop.apple.com", "province": "California", "country": "US", "address1": "1 Infinite Loop", "zip": "95014", "city": "Cupertino", "source": null, "phone": "1231231234", "latitude": 45.45, "longitude": -75.43, "primary_locale": "en", "address2": "Suite 100", "created_at": "2007-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:55:05-05:00", "country_code": "US", "country_name": "United States", "currency": "USD", "customer_email": "customers@apple.com", "timezone": "(GMT-05:00) Eastern Time (US & Canada)", "iana_timezone": "America/New_York", "shop_owner": "John Smith", "money_format": "${{amount}}", "money_with_currency_format": "${{amount}} USD", "weight_unit": "lb", "province_code": "CA", "taxes_included": null, "auto_configure_tax_inclusivity": null, "tax_shipping": null, "county_taxes": true, "plan_display_name": "Shopify Plus", "plan_name": "enterprise", "has_discounts": true, "has_gift_cards": true, "myshopify_domain": "jsmith.myshopify.com", "google_apps_domain": null, "google_apps_login_enabled": null, "money_in_emails_format": "${{amount}}", "money_with_currency_in_emails_format": "${{amount}} USD", "eligible_for_payments": true, "requires_extra_payments_agreement": false, "password_enabled": false, "has_storefront": true, "eligible_for_card_reader_giveaway": false, "finances": true, "primary_location_id": 655441491, "cookie_consent_level": "implicit", "visitor_tracking_consent_preference": "allow_all", "checkout_api_supported": true, "multi_location_enabled": true, "setup_required": false, "pre_launch_enabled": false, "enabled_presentment_currencies": ["USD"], "transactional_sms_disabled": false, "marketing_sms_consent_enabled_at_checkout": false}})); await shopify.rest.Shop.all({ session: session, diff --git a/rest/admin/__tests__/2022-10/smart_collection.test.ts b/rest/admin/__tests__/2022-10/smart_collection.test.ts index 615341a62..05e5f4448 100644 --- a/rest/admin/__tests__/2022-10/smart_collection.test.ts +++ b/rest/admin/__tests__/2022-10/smart_collection.test.ts @@ -31,42 +31,42 @@ describe('SmartCollection resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001318, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T12:43:30-05:00", "body_html": null, "published_at": "2023-01-03T12:43:29-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001318"}]})); await shopify.rest.SmartCollection.all({ session: session, + since_id: "482865238", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/smart_collections.json', - query: '', + query: 'since_id=482865238', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001333, "handle": "ipods-1", "title": "IPods", "updated_at": "2022-10-03T13:16:25-04:00", "body_html": null, "published_at": "2022-10-03T13:16:25-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001333"}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); await shopify.rest.SmartCollection.all({ session: session, - since_id: "482865238", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/smart_collections.json', - query: 'since_id=482865238', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); await shopify.rest.SmartCollection.all({ session: session, @@ -84,211 +84,194 @@ describe('SmartCollection resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001348, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:18:29-04:00", "body_html": null, "published_at": "2022-10-03T13:18:29-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001348"}, {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}]})); + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001324, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:44:05-05:00", "body_html": null, "published_at": "2023-01-03T12:44:05-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001324"}, {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); await shopify.rest.SmartCollection.all({ session: session, - ids: "482865238,1063001348", + ids: "482865238,1063001324", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/smart_collections.json', - query: 'ids=482865238%2C1063001348', + query: 'ids=482865238%2C1063001324', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001332, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:16:20-04:00", "body_html": null, "published_at": "2022-10-03T13:16:20-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001332"}})); + queueMockResponse(JSON.stringify({"count": 1})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - await smart_collection.save({}); + await shopify.rest.SmartCollection.count({ + session: session, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/smart_collections.json', + path: '/admin/api/2022-10/smart_collections/count.json', query: '', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001336, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:17:01-04:00", "body_html": null, "published_at": "2022-10-03T13:16:55-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001336", "image": {"created_at": "2022-10-03T13:16:58-04:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-4mmir0.gif?v=1664817421"}}})); + queueMockResponse(JSON.stringify({"count": 1})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - smart_collection.image = { - "src": "http://example.com/rails_logo.gif", - "alt": "Rails Logo" - }; - await smart_collection.save({}); + await shopify.rest.SmartCollection.count({ + session: session, + product_id: "632910392", + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/smart_collections.json', - query: '', + path: '/admin/api/2022-10/smart_collections/count.json', + query: 'product_id=632910392', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001339, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:17:45-04:00", "body_html": null, "published_at": "2022-10-03T13:17:42-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001339", "image": {"created_at": "2022-10-03T13:17:45-04:00", "alt": "iPod", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1664817465"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 2, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - smart_collection.image = { - "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", - "alt": "iPod" - }; - await smart_collection.save({}); + await shopify.rest.SmartCollection.find({ + session: session, + id: 482865238, + }); expect({ - method: 'POST', + method: 'GET', domain, - path: '/admin/api/2022-10/smart_collections.json', + path: '/admin/api/2022-10/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", "alt": "iPod"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001346, "handle": "ipods-1", "title": "IPods", "updated_at": "2022-10-03T13:18:22-04:00", "body_html": null, "published_at": "2022-10-03T13:18:22-04:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001346"}})); + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": null, "updated_at": "2023-01-03T12:43:43-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "IPods"; - smart_collection.rules = [ - { - "column": "title", - "relation": "starts_with", - "condition": "iPod" - } - ]; + smart_collection.id = 482865238; + smart_collection.published = false; await smart_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/smart_collections.json', + path: '/admin/api/2022-10/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"title": "IPods", "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}]} } + data: { "smart_collection": {"published": false} } }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001347, "handle": "macbooks", "title": "Macbooks", "updated_at": "2022-10-03T13:18:27-04:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001347"}})); + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": "2023-01-03T12:43:23-05:00", "updated_at": "2023-01-03T12:43:23-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.title = "Macbooks"; - smart_collection.rules = [ - { - "column": "vendor", - "relation": "equals", - "condition": "Apple" - } - ]; - smart_collection.published = false; + smart_collection.id = 482865238; + smart_collection.published = true; await smart_collection.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/smart_collections.json', + path: '/admin/api/2022-10/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published": false} } + data: { "smart_collection": {"published": true} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

The best selling ipod ever

", "handle": "smart-ipods", "updated_at": "2023-01-03T12:44:13-05:00", "id": 482865238, "sort_order": "manual", "title": "Smart iPods", "disjunctive": false, "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"}})); - await shopify.rest.SmartCollection.count({ - session: session, - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = ""; + smart_collection.updated_at = "2023-01-03T12:44:12-05:00"; + smart_collection.title = "Smart iPods"; + smart_collection.handle = "smart-ipods"; + smart_collection.body_html = "

The best selling ipod ever

"; + smart_collection.published_at = "2008-02-01T19:00:00-05:00"; + smart_collection.sort_order = "manual"; + smart_collection.template_suffix = null; + smart_collection.disjunctive = false; + smart_collection.rules = [ + { + "column": "type", + "relation": "equals", + "condition": "Cult Products" + } + ]; + smart_collection.published_scope = "web"; + smart_collection.admin_graphql_api_id = "gid://shopify/Collection/482865238"; + await smart_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-10/smart_collections/count.json', + path: '/admin/api/2022-10/smart_collections/482865238.json', query: '', headers, - data: undefined + data: { "smart_collection": {"image": "", "updated_at": "2023-01-03T12:44:12-05:00", "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"count": 1})); + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2023-01-03T12:44:35-05:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:44:35-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672767875"}}})); - await shopify.rest.SmartCollection.count({ - session: session, - product_id: "632910392", - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQ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EDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; + await smart_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, - path: '/admin/api/2022-10/smart_collections/count.json', - query: 'product_id=632910392', + path: '/admin/api/2022-10/smart_collections/482865238.json', + query: '', headers, - data: undefined + data: { "smart_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd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RAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_12', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 2, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2023-01-03T12:43:34-05:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"alt": "Rails logo", "created_at": "2023-01-03T12:43:32-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-iapzkx.gif?v=1672767814"}}})); - await shopify.rest.SmartCollection.find({ - session: session, - id: 482865238, - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "alt": "Rails logo" + }; + await smart_collection.save({}); expect({ - method: 'GET', + method: 'PUT', domain, path: '/admin/api/2022-10/smart_collections/482865238.json', query: '', headers, - data: undefined + data: { "smart_collection": {"image": {"alt": "Rails logo"}} } }).toMatchMadeHttpRequest(); }); it('test_13', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": "2022-10-03T13:15:44-04:00", "updated_at": "2022-10-03T13:15:45-04:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

5000 songs in your pocket

", "title": "Smart iPods", "handle": "smart-ipods", "id": 482865238, "updated_at": "2023-01-03T12:44:20-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); smart_collection.id = 482865238; - smart_collection.published = true; + smart_collection.body_html = "

5000 songs in your pocket

"; await smart_collection.save({}); expect({ @@ -297,137 +280,154 @@ describe('SmartCollection resource', () => { path: '/admin/api/2022-10/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"published": true} } + data: { "smart_collection": {"body_html": "

5000 songs in your pocket

"} } }).toMatchMadeHttpRequest(); }); it('test_14', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2022-10-03T13:15:58-04:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"alt": "Rails logo", "created_at": "2022-10-03T13:15:53-04:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20221003-23488-m6oibt.gif?v=1664817358"}}})); + queueMockResponse(JSON.stringify({})); - const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.image = { - "alt": "Rails logo" - }; - await smart_collection.save({}); + await shopify.rest.SmartCollection.delete({ + session: session, + id: 482865238, + }); expect({ - method: 'PUT', + method: 'DELETE', domain, path: '/admin/api/2022-10/smart_collections/482865238.json', query: '', headers, - data: { "smart_collection": {"image": {"alt": "Rails logo"}} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_15', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2022-10-03T13:16:15-04:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:16:15-04:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1664817375"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001315, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:20-05:00", "body_html": null, "published_at": "2023-01-03T12:43:20-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001315", "image": {"created_at": "2023-01-03T12:43:20-05:00", "alt": "iPod", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672767800"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple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ICRAEAOw==\n", + "alt": "iPod" }; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/smart_collections/482865238.json', + path: '/admin/api/2022-10/smart_collections.json', query: '', headers, - data: { "smart_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZRPLIgMZUeJ+jKvrAlK6A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va7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", "alt": "iPod"}} } }).toMatchMadeHttpRequest(); }); it('test_16', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

5000 songs in your pocket

", "title": "Smart iPods", "handle": "smart-ipods", "id": 482865238, "updated_at": "2022-10-03T13:16:36-04:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001314, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:18-05:00", "body_html": null, "published_at": "2023-01-03T12:43:18-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001314", "image": {"created_at": "2023-01-03T12:43:18-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-xezjfo.gif?v=1672767798"}}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.body_html = "

5000 songs in your pocket

"; + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + smart_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/smart_collections/482865238.json', + path: '/admin/api/2022-10/smart_collections.json', query: '', headers, - data: { "smart_collection": {"body_html": "

5000 songs in your pocket

"} } + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } }).toMatchMadeHttpRequest(); }); it('test_17', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

The best selling ipod ever

", "handle": "smart-ipods", "updated_at": "2022-10-03T13:17:09-04:00", "id": 482865238, "sort_order": "manual", "title": "Smart iPods", "disjunctive": false, "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001313, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:16-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001313"}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.image = ""; - smart_collection.updated_at = "2022-10-03T13:17:08-04:00"; - smart_collection.title = "Smart iPods"; - smart_collection.handle = "smart-ipods"; - smart_collection.body_html = "

The best selling ipod ever

"; - smart_collection.published_at = "2008-02-01T19:00:00-05:00"; - smart_collection.sort_order = "manual"; - smart_collection.template_suffix = null; - smart_collection.disjunctive = false; + smart_collection.title = "Macbooks"; smart_collection.rules = [ { - "column": "type", + "column": "vendor", "relation": "equals", - "condition": "Cult Products" + "condition": "Apple" } ]; - smart_collection.published_scope = "web"; - smart_collection.admin_graphql_api_id = "gid://shopify/Collection/482865238"; + smart_collection.published = false; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/smart_collections/482865238.json', + path: '/admin/api/2022-10/smart_collections.json', query: '', headers, - data: { "smart_collection": {"image": "", "updated_at": "2022-10-03T13:17:08-04:00", "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"} } + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published": false} } }).toMatchMadeHttpRequest(); }); it('test_18', async () => { - queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": null, "updated_at": "2022-10-03T13:17:23-04:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2022-10-03T13:07:13-04:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1664816833"}}})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001326, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T12:44:09-05:00", "body_html": null, "published_at": "2023-01-03T12:44:09-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001326"}})); const smart_collection = new shopify.rest.SmartCollection({session: session}); - smart_collection.id = 482865238; - smart_collection.published = false; + smart_collection.title = "IPods"; + smart_collection.rules = [ + { + "column": "title", + "relation": "starts_with", + "condition": "iPod" + } + ]; await smart_collection.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/smart_collections/482865238.json', + path: '/admin/api/2022-10/smart_collections.json', query: '', headers, - data: { "smart_collection": {"published": false} } + data: { "smart_collection": {"title": "IPods", "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}]} } }).toMatchMadeHttpRequest(); }); it('test_19', async () => { - queueMockResponse(JSON.stringify({})); + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001329, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:44:38-05:00", "body_html": null, "published_at": "2023-01-03T12:44:38-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001329"}})); - await shopify.rest.SmartCollection.delete({ - session: session, - id: 482865238, - }); + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + await smart_collection.save({}); expect({ - method: 'DELETE', + method: 'POST', domain, - path: '/admin/api/2022-10/smart_collections/482865238.json', + path: '/admin/api/2022-10/smart_collections.json', query: '', headers, - data: undefined + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}]} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2022-10/storefront_access_token.test.ts b/rest/admin/__tests__/2022-10/storefront_access_token.test.ts index 312e48564..64e24fbd9 100644 --- a/rest/admin/__tests__/2022-10/storefront_access_token.test.ts +++ b/rest/admin/__tests__/2022-10/storefront_access_token.test.ts @@ -31,7 +31,7 @@ describe('StorefrontAccessToken resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"storefront_access_token": {"access_token": "45ca0032e77093b648d94244e45fab27", "access_scope": "unauthenticated_read_product_listings", "created_at": "2022-10-03T13:03:45-04:00", "id": 1003303990, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/1003303990", "title": "Test"}})); + queueMockResponse(JSON.stringify({"storefront_access_token": {"access_token": "b3ababb5c68d0062d5619d853abf6efa", "access_scope": "unauthenticated_read_product_listings", "created_at": "2023-01-03T12:44:44-05:00", "id": 1003303990, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/1003303990", "title": "Test"}})); const storefront_access_token = new shopify.rest.StorefrontAccessToken({session: session}); storefront_access_token.title = "Test"; @@ -48,7 +48,7 @@ describe('StorefrontAccessToken resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"storefront_access_tokens": [{"access_token": "378d95641257a4ab3feff967ee234f4d", "access_scope": "unauthenticated_read_product_listings", "created_at": "2022-10-03T12:44:45-04:00", "id": 755357713, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/755357713", "title": "API Client Extension"}]})); + queueMockResponse(JSON.stringify({"storefront_access_tokens": [{"access_token": "378d95641257a4ab3feff967ee234f4d", "access_scope": "unauthenticated_read_product_listings", "created_at": "2023-01-03T12:21:36-05:00", "id": 755357713, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/755357713", "title": "API Client Extension"}]})); await shopify.rest.StorefrontAccessToken.all({ session: session, diff --git a/rest/admin/__tests__/2022-10/tender_transaction.test.ts b/rest/admin/__tests__/2022-10/tender_transaction.test.ts index 4d9589baa..6de20586d 100644 --- a/rest/admin/__tests__/2022-10/tender_transaction.test.ts +++ b/rest/admin/__tests__/2022-10/tender_transaction.test.ts @@ -31,107 +31,107 @@ describe('TenderTransaction resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222834, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222852, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222851, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - since_id: "1011222833", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/tender_transactions.json', - query: 'since_id=1011222833', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222835, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222858, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - processed_at_max: "2005-08-06 10:22:51 -0400", + since_id: "1011222857", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/tender_transactions.json', - query: 'processed_at_max=2005-08-06+10%3A22%3A51+-0400', + query: 'since_id=1011222857', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222837, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222855, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222856, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - processed_at_max: "2005-08-05 10:22:51 -0400", + order: "processed_at ASC", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/tender_transactions.json', - query: 'processed_at_max=2005-08-05+10%3A22%3A51+-0400', + query: 'order=processed_at+ASC', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222844, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222843, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222842, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, + processed_at_min: "2005-08-06 10:22:51 -0400", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/tender_transactions.json', - query: '', + query: 'processed_at_min=2005-08-06+10%3A22%3A51+-0400', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222848, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222853, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - processed_at_min: "2005-08-06 10:22:51 -0400", + processed_at_max: "2005-08-06 10:22:51 -0400", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/tender_transactions.json', - query: 'processed_at_min=2005-08-06+10%3A22%3A51+-0400', + query: 'processed_at_max=2005-08-06+10%3A22%3A51+-0400', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222849, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222850, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222843, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); await shopify.rest.TenderTransaction.all({ session: session, - order: "processed_at ASC", + processed_at_max: "2005-08-05 10:22:51 -0400", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/tender_transactions.json', - query: 'order=processed_at+ASC', + query: 'processed_at_max=2005-08-05+10%3A22%3A51+-0400', headers, data: undefined }).toMatchMadeHttpRequest(); diff --git a/rest/admin/__tests__/2022-10/theme.test.ts b/rest/admin/__tests__/2022-10/theme.test.ts index ba02b91be..461e22c54 100644 --- a/rest/admin/__tests__/2022-10/theme.test.ts +++ b/rest/admin/__tests__/2022-10/theme.test.ts @@ -31,7 +31,7 @@ describe('Theme resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"themes": [{"id": 828155753, "name": "Comfort", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}, {"id": 976877075, "name": "Preview of Parallax", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "demo", "theme_store_id": 688, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/976877075"}, {"id": 752253240, "name": "Sandbox", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}]})); + queueMockResponse(JSON.stringify({"themes": [{"id": 828155753, "name": "Comfort", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}, {"id": 976877075, "name": "Preview of Parallax", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "demo", "theme_store_id": 688, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/976877075"}, {"id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}]})); await shopify.rest.Theme.all({ session: session, @@ -48,7 +48,7 @@ describe('Theme resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"theme": {"id": 1049083723, "name": "Lemongrass", "created_at": "2022-10-03T13:05:00-04:00", "updated_at": "2022-10-03T13:05:00-04:00", "role": "unpublished", "theme_store_id": null, "previewable": false, "processing": true, "admin_graphql_api_id": "gid://shopify/Theme/1049083723"}})); + queueMockResponse(JSON.stringify({"theme": {"id": 1049083723, "name": "Lemongrass", "created_at": "2023-01-03T12:25:57-05:00", "updated_at": "2023-01-03T12:25:57-05:00", "role": "unpublished", "theme_store_id": null, "previewable": false, "processing": true, "admin_graphql_api_id": "gid://shopify/Theme/1049083723"}})); const theme = new shopify.rest.Theme({session: session}); theme.name = "Lemongrass"; @@ -67,7 +67,7 @@ describe('Theme resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"theme": {"id": 828155753, "name": "Comfort", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}})); + queueMockResponse(JSON.stringify({"theme": {"id": 828155753, "name": "Comfort", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}})); await shopify.rest.Theme.find({ session: session, @@ -85,11 +85,11 @@ describe('Theme resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"theme": {"name": "Experimental", "role": "unpublished", "id": 752253240, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:04:50-04:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + queueMockResponse(JSON.stringify({"theme": {"role": "main", "id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:51-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); const theme = new shopify.rest.Theme({session: session}); theme.id = 752253240; - theme.name = "Experimental"; + theme.role = "main"; await theme.save({}); expect({ @@ -98,16 +98,16 @@ describe('Theme resource', () => { path: '/admin/api/2022-10/themes/752253240.json', query: '', headers, - data: { "theme": {"name": "Experimental"} } + data: { "theme": {"role": "main"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"theme": {"role": "main", "id": 752253240, "name": "Sandbox", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T13:04:59-04:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + queueMockResponse(JSON.stringify({"theme": {"name": "Experimental", "role": "unpublished", "id": 752253240, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:26:01-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); const theme = new shopify.rest.Theme({session: session}); theme.id = 752253240; - theme.role = "main"; + theme.name = "Experimental"; await theme.save({}); expect({ @@ -116,12 +116,12 @@ describe('Theme resource', () => { path: '/admin/api/2022-10/themes/752253240.json', query: '', headers, - data: { "theme": {"role": "main"} } + data: { "theme": {"name": "Experimental"} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"id": 752253240, "name": "Sandbox", "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"})); + queueMockResponse(JSON.stringify({"id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"})); await shopify.rest.Theme.delete({ session: session, diff --git a/rest/admin/__tests__/2022-10/transaction.test.ts b/rest/admin/__tests__/2022-10/transaction.test.ts index ec9d2e964..7402df585 100644 --- a/rest/admin/__tests__/2022-10/transaction.test.ts +++ b/rest/admin/__tests__/2022-10/transaction.test.ts @@ -31,7 +31,7 @@ describe('Transaction resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "c901414060.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}, {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}, {"id": 801038806, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T10:22:51-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2005-08-05T10:22:51-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "250.94", "currency": "USD", "payment_id": "c901414060.2", "admin_graphql_api_id": "gid://shopify/OrderTransaction/801038806"}]})); + queueMockResponse(JSON.stringify({"transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}, {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "#1001.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}, {"id": 801038806, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T10:22:51-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2005-08-05T10:22:51-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "250.94", "currency": "USD", "payment_id": "#1001.2", "admin_graphql_api_id": "gid://shopify/OrderTransaction/801038806"}]})); await shopify.rest.Transaction.all({ session: session, @@ -49,7 +49,7 @@ describe('Transaction resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"transactions": [{"id": 1068278464, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:03-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:03-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278464"}]})); + queueMockResponse(JSON.stringify({"transactions": [{"id": 1068278485, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:26-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:26-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278485"}]})); await shopify.rest.Transaction.all({ session: session, @@ -68,7 +68,7 @@ describe('Transaction resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278467, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:19-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:19-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278467"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278488, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:33-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:33-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278488"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; @@ -89,7 +89,7 @@ describe('Transaction resource', () => { }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278463, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:00-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:00-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278463"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278486, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:29-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:29-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278486"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; @@ -108,7 +108,7 @@ describe('Transaction resource', () => { }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278465, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:07-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:07-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278465"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278484, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:24-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:24-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278484"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; @@ -130,7 +130,7 @@ describe('Transaction resource', () => { }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"transaction": {"id": 1068278466, "order_id": 450789469, "kind": "void", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2022-11-09T09:35:11-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2022-11-09T09:35:11-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "0.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278466"}})); + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278487, "order_id": 450789469, "kind": "void", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:31-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:31-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "0.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278487"}})); const transaction = new shopify.rest.Transaction({session: session}); transaction.order_id = 450789469; diff --git a/rest/admin/__tests__/2022-10/usage_charge.test.ts b/rest/admin/__tests__/2022-10/usage_charge.test.ts index 60f52eac2..169e76213 100644 --- a/rest/admin/__tests__/2022-10/usage_charge.test.ts +++ b/rest/admin/__tests__/2022-10/usage_charge.test.ts @@ -31,7 +31,7 @@ describe('UsageCharge resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618208, "description": "Super Mega Plan 1000 emails", "price": "1.00", "created_at": "2022-10-03T12:53:15-04:00", "billing_on": null, "balance_used": 11.0, "balance_remaining": 89.0, "risk_level": 0}})); + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618209, "description": "Super Mega Plan 1000 emails", "price": "1.00", "created_at": "2023-01-03T12:42:12-05:00", "billing_on": null, "balance_used": 11.0, "balance_remaining": 89.0, "risk_level": 0}})); const usage_charge = new shopify.rest.UsageCharge({session: session}); usage_charge.recurring_application_charge_id = 455696195; @@ -50,7 +50,7 @@ describe('UsageCharge resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"usage_charges": [{"id": 1034618206, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2022-10-03T12:53:13-04:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}]})); + queueMockResponse(JSON.stringify({"usage_charges": [{"id": 1034618206, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2023-01-03T12:42:08-05:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}]})); await shopify.rest.UsageCharge.all({ session: session, @@ -68,18 +68,18 @@ describe('UsageCharge resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618210, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2022-10-03T12:53:16-04:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}})); + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618207, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2023-01-03T12:42:10-05:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}})); await shopify.rest.UsageCharge.find({ session: session, recurring_application_charge_id: 455696195, - id: 1034618210, + id: 1034618207, }); expect({ method: 'GET', domain, - path: '/admin/api/2022-10/recurring_application_charges/455696195/usage_charges/1034618210.json', + path: '/admin/api/2022-10/recurring_application_charges/455696195/usage_charges/1034618207.json', query: '', headers, data: undefined diff --git a/rest/admin/__tests__/2022-10/user.test.ts b/rest/admin/__tests__/2022-10/user.test.ts index e807c68af..273111b41 100644 --- a/rest/admin/__tests__/2022-10/user.test.ts +++ b/rest/admin/__tests__/2022-10/user.test.ts @@ -31,7 +31,7 @@ describe('User resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"users": [{"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}, {"id": 930143300, "first_name": "John", "email": "j.limited@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Limited", "account_owner": false, "receive_announcements": 1, "bio": null, "permissions": [], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/930143300", "tfa_enabled?": false}]})); + queueMockResponse(JSON.stringify({"users": [{"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}, {"id": 930143300, "first_name": "John", "email": "j.limited@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Limited", "account_owner": false, "receive_announcements": 1, "bio": null, "permissions": [], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/930143300", "tfa_enabled?": false}]})); await shopify.rest.User.all({ session: session, @@ -48,7 +48,7 @@ describe('User resource', () => { }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); await shopify.rest.User.find({ session: session, @@ -66,7 +66,7 @@ describe('User resource', () => { }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); await shopify.rest.User.current({ session: session, diff --git a/rest/admin/__tests__/2022-10/variant.test.ts b/rest/admin/__tests__/2022-10/variant.test.ts index 8fb5b4b0d..629211397 100644 --- a/rest/admin/__tests__/2022-10/variant.test.ts +++ b/rest/admin/__tests__/2022-10/variant.test.ts @@ -31,220 +31,220 @@ describe('Variant resource', () => { session.accessToken = 'this_is_a_test_token'; it('test_1', async () => { - queueMockResponse(JSON.stringify({"variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); await shopify.rest.Variant.all({ session: session, product_id: 632910392, - since_id: "49148385", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products/632910392/variants.json', - query: 'since_id=49148385', + query: '', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_2', async () => { - queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + queueMockResponse(JSON.stringify({"variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); await shopify.rest.Variant.all({ session: session, product_id: 632910392, - presentment_currencies: "USD,CAD", + since_id: "49148385", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products/632910392/variants.json', - query: 'presentment_currencies=USD%2CCAD', + query: 'since_id=49148385', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_3', async () => { - queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); await shopify.rest.Variant.all({ session: session, product_id: 632910392, + presentment_currencies: "USD,CAD", }); expect({ method: 'GET', domain, path: '/admin/api/2022-10/products/632910392/variants.json', - query: '', + query: 'presentment_currencies=USD%2CCAD', headers, data: undefined }).toMatchMadeHttpRequest(); }); it('test_4', async () => { - queueMockResponse(JSON.stringify({"count": 4})); + queueMockResponse(JSON.stringify({"variant": {"id": 1070325020, "product_id": 632910392, "title": "Yellow", "price": "1.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Yellow", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:18-05:00", "updated_at": "2023-01-03T12:25:18-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325020, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "1.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325020"}})); - await shopify.rest.Variant.count({ - session: session, - product_id: 632910392, - }); + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Yellow"; + variant.price = "1.00"; + await variant.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/products/632910392/variants/count.json', + path: '/admin/api/2022-10/products/632910392/variants.json', query: '', headers, - data: undefined + data: { "variant": {"option1": "Yellow", "price": "1.00"} } }).toMatchMadeHttpRequest(); }); it('test_5', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:44:45-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "tax_code": "DA040000", "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 1070325023, "product_id": 632910392, "title": "Blue", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Blue", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:36-05:00", "updated_at": "2023-01-03T12:25:36-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325023, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325023"}})); - await shopify.rest.Variant.find({ - session: session, - id: 808950810, - }); + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Blue"; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await variant.save({}); expect({ - method: 'GET', + method: 'POST', domain, - path: '/admin/api/2022-10/variants/808950810.json', + path: '/admin/api/2022-10/products/632910392/variants.json', query: '', headers, - data: undefined + data: { "variant": {"option1": "Blue", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_6', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:21-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 1070325022, "product_id": 632910392, "title": "Purple", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Purple", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:32-05:00", "updated_at": "2023-01-03T12:25:32-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": 850703190, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325022, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325022"}})); const variant = new shopify.rest.Variant({session: session}); - variant.id = 808950810; - variant.image_id = 562641783; + variant.product_id = 632910392; + variant.image_id = 850703190; + variant.option1 = "Purple"; await variant.save({}); expect({ - method: 'PUT', + method: 'POST', domain, - path: '/admin/api/2022-10/variants/808950810.json', + path: '/admin/api/2022-10/products/632910392/variants.json', query: '', headers, - data: { "variant": {"image_id": 562641783} } + data: { "variant": {"image_id": 850703190, "option1": "Purple"} } }).toMatchMadeHttpRequest(); }); it('test_7', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:38-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"count": 4})); - const variant = new shopify.rest.Variant({session: session}); - variant.id = 808950810; - variant.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; - await variant.save({}); + await shopify.rest.Variant.count({ + session: session, + product_id: 632910392, + }); expect({ - method: 'PUT', + method: 'GET', domain, - path: '/admin/api/2022-10/variants/808950810.json', + path: '/admin/api/2022-10/products/632910392/variants/count.json', query: '', headers, - data: { "variant": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_8', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Not Pink", "price": "99.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Not Pink", "option2": null, "option3": null, "created_at": "2022-10-03T12:44:45-04:00", "updated_at": "2022-10-03T12:50:49-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "99.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "tax_code": "DA040000", "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); - const variant = new shopify.rest.Variant({session: session}); - variant.id = 808950810; - variant.option1 = "Not Pink"; - variant.price = "99.00"; - await variant.save({}); + await shopify.rest.Variant.find({ + session: session, + id: 808950810, + }); expect({ - method: 'PUT', + method: 'GET', domain, path: '/admin/api/2022-10/variants/808950810.json', query: '', headers, - data: { "variant": {"option1": "Not Pink", "price": "99.00"} } + data: undefined }).toMatchMadeHttpRequest(); }); it('test_9', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 1070325019, "product_id": 632910392, "title": "Purple", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Purple", "option2": null, "option3": null, "created_at": "2022-10-03T12:50:00-04:00", "updated_at": "2022-10-03T12:50:00-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": 850703190, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325019, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325019"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:13-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); const variant = new shopify.rest.Variant({session: session}); - variant.product_id = 632910392; - variant.image_id = 850703190; - variant.option1 = "Purple"; + variant.id = 808950810; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; await variant.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products/632910392/variants.json', + path: '/admin/api/2022-10/variants/808950810.json', query: '', headers, - data: { "variant": {"image_id": 850703190, "option1": "Purple"} } + data: { "variant": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } }).toMatchMadeHttpRequest(); }); it('test_10', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 1070325020, "product_id": 632910392, "title": "Yellow", "price": "1.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Yellow", "option2": null, "option3": null, "created_at": "2022-10-03T12:50:03-04:00", "updated_at": "2022-10-03T12:50:03-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325020, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "1.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325020"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:26-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); const variant = new shopify.rest.Variant({session: session}); - variant.product_id = 632910392; - variant.option1 = "Yellow"; - variant.price = "1.00"; + variant.id = 808950810; + variant.image_id = 562641783; await variant.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products/632910392/variants.json', + path: '/admin/api/2022-10/variants/808950810.json', query: '', headers, - data: { "variant": {"option1": "Yellow", "price": "1.00"} } + data: { "variant": {"image_id": 562641783} } }).toMatchMadeHttpRequest(); }); it('test_11', async () => { - queueMockResponse(JSON.stringify({"variant": {"id": 1070325024, "product_id": 632910392, "title": "Blue", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Blue", "option2": null, "option3": null, "created_at": "2022-10-03T12:50:35-04:00", "updated_at": "2022-10-03T12:50:35-04:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325024, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325024"}})); + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Not Pink", "price": "99.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Not Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:43-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "99.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); const variant = new shopify.rest.Variant({session: session}); - variant.product_id = 632910392; - variant.option1 = "Blue"; - variant.metafields = [ - { - "key": "new", - "value": "newvalue", - "type": "single_line_text_field", - "namespace": "global" - } - ]; + variant.id = 808950810; + variant.option1 = "Not Pink"; + variant.price = "99.00"; await variant.save({}); expect({ - method: 'POST', + method: 'PUT', domain, - path: '/admin/api/2022-10/products/632910392/variants.json', + path: '/admin/api/2022-10/variants/808950810.json', query: '', headers, - data: { "variant": {"option1": "Blue", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + data: { "variant": {"option1": "Not Pink", "price": "99.00"} } }).toMatchMadeHttpRequest(); }); diff --git a/rest/admin/__tests__/2023-01/abandoned_checkout.test.ts b/rest/admin/__tests__/2023-01/abandoned_checkout.test.ts new file mode 100644 index 000000000..b506d0fa6 --- /dev/null +++ b/rest/admin/__tests__/2023-01/abandoned_checkout.test.ts @@ -0,0 +1,157 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('AbandonedCheckout resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + created_at_max: "2013-10-12T07:05:27-02:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts.json', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + status: "closed", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts.json', + query: 'status=closed', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + limit: "1", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts.json', + query: 'limit=1', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + created_at_max: "2013-10-12T07:05:27-02:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts.json', + query: 'created_at_max=2013-10-12T07%3A05%3A27-02%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"checkouts": [{"id": 450789469, "token": "2a1ace52255252df566af0faaedfbfa7", "cart_token": "68778783ad298f1c80c3bafcddeea02f", "email": "bob.norman@mail.example.com", "gateway": null, "buyer_accepts_marketing": false, "created_at": "2012-10-12T07:05:27-04:00", "updated_at": "2012-10-12T07:05:27-04:00", "landing_site": null, "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "referring_site": null, "shipping_lines": [{"title": "Free Shipping", "price": "0.00", "code": "Free Shipping", "source": "shopify", "applied_discounts": [], "id": "5da41c1738454765"}], "taxes_included": false, "total_weight": 400, "currency": "USD", "completed_at": null, "closed_at": null, "user_id": null, "location_id": null, "source_identifier": null, "source_url": null, "device_id": null, "phone": null, "customer_locale": "en", "line_items": [{"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "28a7cdfa0b96243e", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Red", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 49148385, "variant_title": "Red", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}, {"applied_discounts": [], "discount_allocations": [{"id": null, "amount": "19.90", "description": null, "created_at": null, "application_type": "discount_code"}], "key": "5e12f3305d99c598", "destination_location_id": null, "fulfillment_service": "manual", "gift_card": false, "grams": 200, "origin_location_id": null, "presentment_title": "IPod Nano - 8GB", "presentment_variant_title": "Pink", "product_id": 632910392, "properties": null, "quantity": 1, "requires_shipping": true, "sku": "IPOD2008PINK", "tax_lines": [], "taxable": true, "title": "IPod Nano - 8GB", "variant_id": 808950810, "variant_title": "Pink", "variant_price": null, "vendor": "Apple", "user_id": null, "unit_price_measurement": null, "rank": null, "compare_at_price": null, "line_price": "199.00", "price": "199.00"}], "name": "#450789469", "source": null, "abandoned_checkout_url": "https://checkout.local/548380009/checkouts/2a1ace52255252df566af0faaedfbfa7/recover", "discount_codes": [{"code": "TENOFF", "amount": "39.80", "type": "percentage"}], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "channel_liable": null}], "source_name": "web", "presentment_currency": "USD", "buyer_accepts_sms_marketing": false, "sms_marketing_phone": null, "total_discounts": "39.80", "total_line_items_price": "398.00", "total_price": "379.69", "total_tax": "21.49", "subtotal_price": "358.20", "total_duties": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}]})); + + await shopify.rest.AbandonedCheckout.checkouts({ + session: session, + status: "closed", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts.json', + query: 'status=closed', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/access_scope.test.ts b/rest/admin/__tests__/2023-01/access_scope.test.ts new file mode 100644 index 000000000..9e51acfc4 --- /dev/null +++ b/rest/admin/__tests__/2023-01/access_scope.test.ts @@ -0,0 +1,50 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('AccessScope resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"access_scopes": [{"handle": "read_products"}, {"handle": "write_orders"}, {"handle": "read_orders"}]})); + + await shopify.rest.AccessScope.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/oauth/access_scopes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/apple_pay_certificate.test.ts b/rest/admin/__tests__/2023-01/apple_pay_certificate.test.ts new file mode 100644 index 000000000..84496e8e4 --- /dev/null +++ b/rest/admin/__tests__/2023-01/apple_pay_certificate.test.ts @@ -0,0 +1,124 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('ApplePayCertificate resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938276, "status": "issuing", "merchant_id": null}})); + + const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); + + await apple_pay_certificate.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/apple_pay_certificates.json', + query: '', + headers, + data: { "apple_pay_certificate": {} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938274, "status": "csr", "merchant_id": null}})); + + await shopify.rest.ApplePayCertificate.find({ + session: session, + id: 1068938274, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/apple_pay_certificates/1068938274.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"apple_pay_certificate": {"id": 1068938275, "status": "completed", "merchant_id": "merchant.something"}})); + + const apple_pay_certificate = new shopify.rest.ApplePayCertificate({session: session}); + apple_pay_certificate.id = 1068938275; + apple_pay_certificate.status = "completed"; + apple_pay_certificate.merchant_id = "merchant.something"; + apple_pay_certificate.encoded_signed_certificate = "MIIEZzCCBA6gAwIBAgIIWGMideLkDJAwCgYIKoZIzj0EAwIwgYAxNDAyBgNV\nBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0g\nRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMw\nEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNDEyMDgyMTMy\nMDBaFw0xNzAxMDYyMTMyMDBaMIGZMSowKAYKCZImiZPyLGQBAQwabWVyY2hh\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dDRERFODU1REREOTI5NTE4RjVGMDdBQUM4NzdDMzRCQjM3\nODFCQTg2MzkyNjIwCgYIKoZIzj0EAwIDRwAwRAIgZ/oNx0gCc/PM4pYhOWL2\nCecFQrIgzHr/fZd8qcy3Be8CIEQCaAPpmvQrXEX0hFexoYMHtOHY9dgN2D8L\nNKpVyn3t\n"; + await apple_pay_certificate.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/apple_pay_certificates/1068938275.json', + query: '', + headers, + data: { "apple_pay_certificate": {"status": "completed", "merchant_id": "merchant.something", "encoded_signed_certificate": "MIIEZzCCBA6gAwIBAgIIWGMideLkDJAwCgYIKoZIzj0EAwIwgYAxNDAyBgNV\nBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0g\nRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMw\nEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNDEyMDgyMTMy\nMDBaFw0xNzAxMDYyMTMyMDBaMIGZMSowKAYKCZImiZPyLGQBAQwabWVyY2hh\nbnQuY29tLm5vcm1vcmUuamFzb24xMDAuBgNVBAMMJ01lcmNoYW50IElEOiBt\nZXJjaGFudC5jb20ubm9ybW9yZS5qYXNvbjETMBEGA1UECwwKNVVZMzJOTE5O\nOTEXMBUGA1UECgwOSm9zaHVhIFRlc3NpZXIxCzAJBgNVBAYTAkNBMFkwEwYH\nKoZIzj0CAQYIKoZIzj0DAQcDQgAEAxDDCvzG6MnsZSJOtbr0hr3MRq+4HzTZ\nx8J4FD34E3kU5CallEnZLBmnzfqmjP8644SO28LLJxvWBnrg7lHFtaOCAlUw\nggJRMEcGCCsGAQUFBwEBBDswOTA3BggrBgEFBQcwAYYraHR0cDovL29jc3Au\nYXBwbGUuY29tL29jc3AwNC1hcHBsZXd3ZHJjYTIwMTAdBgNVHQ4EFgQUkPsO\nKEKvhL/takKomy5GWXtCd8wwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBSE\ntoTMOoZichZZlOgao71I3zrfCzCCAR0GA1UdIASCARQwggEQMIIBDAYJKoZI\nhvdjZAUBMIH+MIHDBggrBgEFBQcCAjCBtgyBs1JlbGlhbmNlIG9uIHRoaXMg\nY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0YW5jZSBv\nZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBjb25k\naXRpb25zIG9mIHVzZSwgY2VydGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZp\nY2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMDYGCCsGAQUFBwIBFipodHRw\nOi8vd3d3LmFwcGxlLmNvbS9jZXJ0aWZpY2F0ZWF1dGhvcml0eS8wNgYDVR0f\nBC8wLTAroCmgJ4YlaHR0cDovL2NybC5hcHBsZS5jb20vYXBwbGV3d2RyY2Ey\nLmNybDAOBgNVHQ8BAf8EBAMCAygwTwYJKoZIhvdjZAYgBEIMQDM0NTBBMjhB\nOTlGRjIyRkI5OTdDRERFODU1REREOTI5NTE4RjVGMDdBQUM4NzdDMzRCQjM3\nODFCQTg2MzkyNjIwCgYIKoZIzj0EAwIDRwAwRAIgZ/oNx0gCc/PM4pYhOWL2\nCecFQrIgzHr/fZd8qcy3Be8CIEQCaAPpmvQrXEX0hFexoYMHtOHY9dgN2D8L\nNKpVyn3t\n"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.ApplePayCertificate.delete({ + session: session, + id: 1068938277, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/apple_pay_certificates/1068938277.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"csr": {"key": "YXBwbGUtcGF5LWNzcg==\n"}})); + + await shopify.rest.ApplePayCertificate.csr({ + session: session, + id: 1068938278, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/apple_pay_certificates/1068938278/csr.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/application_charge.test.ts b/rest/admin/__tests__/2023-01/application_charge.test.ts new file mode 100644 index 000000000..5720f449e --- /dev/null +++ b/rest/admin/__tests__/2023-01/application_charge.test.ts @@ -0,0 +1,125 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('ApplicationCharge resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262349, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": true, "created_at": "2023-01-03T13:03:09-05:00", "updated_at": "2023-01-03T13:03:09-05:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262349", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262349/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA0xojw6EmF1dG9fYWN0aXZhdGVU--ea73480c6bd64f4002e70c5f128c1623aaa7991e"}})); + + const application_charge = new shopify.rest.ApplicationCharge({session: session}); + application_charge.name = "Super Duper Expensive action"; + application_charge.price = 100.0; + application_charge.return_url = "http://super-duper.shopifyapps.com"; + application_charge.test = true; + await application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/application_charges.json', + query: '', + headers, + data: { "application_charge": {"name": "Super Duper Expensive action", "price": 100.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"application_charge": {"id": 1017262351, "name": "Super Duper Expensive action", "api_client_id": 755357713, "price": "100.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "test": null, "created_at": "2023-01-03T13:03:15-05:00", "updated_at": "2023-01-03T13:03:15-05:00", "charge_type": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1017262351", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1017262351/ApplicationCharge/confirm_application_charge?signature=BAh7BzoHaWRpBA8xojw6EmF1dG9fYWN0aXZhdGVU--9dad4a7611bec2f70cd0db8cc9157e15360188f0"}})); + + const application_charge = new shopify.rest.ApplicationCharge({session: session}); + application_charge.name = "Super Duper Expensive action"; + application_charge.price = 100.0; + application_charge.return_url = "http://super-duper.shopifyapps.com"; + await application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/application_charges.json', + query: '', + headers, + data: { "application_charge": {"name": "Super Duper Expensive action", "price": 100.0, "return_url": "http://super-duper.shopifyapps.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"application_charges": [{"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}, {"id": 556467234, "name": "Green theme", "api_client_id": 755357713, "price": "120.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "theme", "decorated_return_url": "http://google.com?charge_id=556467234"}, {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}]})); + + await shopify.rest.ApplicationCharge.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/application_charges.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"application_charges": [{"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}, {"id": 1017262346, "name": "Create me a logo", "api_client_id": 755357713, "price": "123.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": "brokered_service", "decorated_return_url": "http://google.com?charge_id=1017262346"}]})); + + await shopify.rest.ApplicationCharge.all({ + session: session, + since_id: "556467234", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/application_charges.json', + query: 'since_id=556467234', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"application_charge": {"id": 675931192, "name": "iPod Cleaning", "api_client_id": 755357713, "price": "5.00", "status": "accepted", "return_url": "http://google.com", "test": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "charge_type": null, "decorated_return_url": "http://google.com?charge_id=675931192"}})); + + await shopify.rest.ApplicationCharge.find({ + session: session, + id: 675931192, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/application_charges/675931192.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/application_credit.test.ts b/rest/admin/__tests__/2023-01/application_credit.test.ts new file mode 100644 index 000000000..fe0b5ba8e --- /dev/null +++ b/rest/admin/__tests__/2023-01/application_credit.test.ts @@ -0,0 +1,105 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('ApplicationCredit resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636125, "amount": "5.00", "description": "application credit for refund", "test": null}})); + + const application_credit = new shopify.rest.ApplicationCredit({session: session}); + application_credit.description = "application credit for refund"; + application_credit.amount = 5.0; + await application_credit.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/application_credits.json', + query: '', + headers, + data: { "application_credit": {"description": "application credit for refund", "amount": 5.0} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"application_credit": {"id": 1031636129, "amount": "5.00", "description": "application credit for refund", "test": true}})); + + const application_credit = new shopify.rest.ApplicationCredit({session: session}); + application_credit.description = "application credit for refund"; + application_credit.amount = 5.0; + application_credit.test = true; + await application_credit.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/application_credits.json', + query: '', + headers, + data: { "application_credit": {"description": "application credit for refund", "amount": 5.0, "test": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"application_credits": [{"id": 140583599, "amount": "5.00", "description": "credit for application refund", "test": null}]})); + + await shopify.rest.ApplicationCredit.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/application_credits.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"application_credit": {"id": 140583599, "amount": "5.00", "description": "credit for application refund", "test": null}})); + + await shopify.rest.ApplicationCredit.find({ + session: session, + id: 140583599, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/application_credits/140583599.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/article.test.ts b/rest/admin/__tests__/2023-01/article.test.ts new file mode 100644 index 000000000..16c264d14 --- /dev/null +++ b/rest/admin/__tests__/2023-01/article.test.ts @@ -0,0 +1,500 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Article resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"articles": [{"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}]})); + + await shopify.rest.Article.all({ + session: session, + blog_id: 241253187, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"articles": [{"id": 294160202, "title": "Just us bots here", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "beep boop", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "just-us-bots-here", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/294160202"}, {"id": 989034056, "title": "Some crazy article I'm coming up with", "created_at": "2008-12-31T19:00:00-05:00", "body_html": "I have no idea what to write about, but it's going to rock!", "blog_id": 241253187, "author": "John", "user_id": null, "published_at": null, "updated_at": "2009-01-31T19:00:00-05:00", "summary_html": null, "template_suffix": null, "handle": "some-crazy-article-im-coming-up-with", "tags": "Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/989034056"}, {"id": 1051293780, "title": "Welcome to the world of tomorrow!", "created_at": "2013-11-06T19:00:00-05:00", "body_html": "Good news, everybody!", "blog_id": 241253187, "author": "dennis", "user_id": null, "published_at": null, "updated_at": "2023-01-03T12:21:36-05:00", "summary_html": null, "template_suffix": null, "handle": "welcome-to-the-world-of-tomorrow", "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293780"}]})); + + await shopify.rest.Article.all({ + session: session, + blog_id: 241253187, + since_id: "134645308", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles.json', + query: 'since_id=134645308', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"article": {"id": 1051293785, "title": "My new Article title", "created_at": "2023-01-03T12:47:34-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:34-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293785"}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"article": {"id": 1051293781, "title": "My new Article title", "created_at": "2023-01-03T12:47:18-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:18-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293781", "image": {"created_at": "2023-01-03T12:47:18-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768038"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + }; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"article": {"id": 1051293786, "title": "My new Article title", "created_at": "2023-01-03T12:47:51-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:47:52-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293786"}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"article": {"id": 1051293788, "title": "My new Article title", "created_at": "2023-01-03T12:48:03-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": "2011-03-24T11:45:47-04:00", "updated_at": "2023-01-03T12:48:04-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293788", "image": {"created_at": "2023-01-03T12:48:03-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20230103-54493-87k83g.gif?v=1672768084"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails logo" + }; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"article": {"id": 1051293784, "title": "My new Article title", "created_at": "2023-01-03T12:47:30-05:00", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "blog_id": 241253187, "author": "John Smith", "user_id": 548380009, "published_at": null, "updated_at": "2023-01-03T12:47:30-05:00", "summary_html": null, "template_suffix": null, "handle": "my-new-article-title", "tags": "Has Been Tagged, This Post", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/1051293784"}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.title = "My new Article title"; + article.author = "John Smith"; + article.tags = "This Post, Has Been Tagged"; + article.body_html = "

I like articles

\n

Yea, I like posting them through REST.

"; + article.published = false; + await article.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles.json', + query: '', + headers, + data: { "article": {"title": "My new Article title", "author": "John Smith", "tags": "This Post, Has Been Tagged", "body_html": "

I like articles

\n

Yea, I like posting them through REST.

", "published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"count": 4})); + + await shopify.rest.Article.count({ + session: session, + blog_id: 241253187, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"article": {"id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "blog_id": 241253187, "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); + + await shopify.rest.Article.find({ + session: session, + blog_id: 241253187, + id: 134645308, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "updated_at": "2023-01-03T12:48:00-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": null, "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2023-01-03T12:48:14-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.published = false; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "published_at": "2023-01-03T12:47:11-05:00", "title": "get on the train now", "handle": "get-on-the-train-now", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": 548380009, "updated_at": "2023-01-03T12:47:11-05:00", "summary_html": null, "template_suffix": null, "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.published = true; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "updated_at": "2023-01-03T12:47:43-05:00", "id": 134645308, "title": "get on the train now", "created_at": "2008-07-31T20:00:00-04:00", "body_html": "

Do you have an IPod yet?

", "author": "Dennis", "user_id": 548380009, "published_at": "2008-07-31T20:00:00-04:00", "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Announcing", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308"}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.image = ""; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"image": ""} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "updated_at": "2023-01-03T12:48:33-05:00", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "summary_html": null, "template_suffix": null, "handle": "get-on-the-train-now", "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:48:33-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672768113"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJr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HXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n" + }; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM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ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "user_id": null, "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "updated_at": "2023-01-03T12:47:47-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "iMac", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/imac.jpg?v=1672766496"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"article": {"blog_id": 241253187, "author": "Your name", "body_html": "

Look, I can even update through a web service.

", "published_at": "2011-03-24T11:45:47-04:00", "title": "My new Title", "handle": "get-on-the-train-now", "id": 134645308, "created_at": "2008-07-31T20:00:00-04:00", "user_id": null, "updated_at": "2023-01-03T12:48:40-05:00", "summary_html": null, "template_suffix": null, "tags": "Tags, Updated, Will Be", "admin_graphql_api_id": "gid://shopify/OnlineStoreArticle/134645308", "image": {"created_at": "2023-01-03T12:48:40-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/articles/rails_logo20230103-54493-qvpb1u.gif?v=1672768120"}}})); + + const article = new shopify.rest.Article({session: session}); + article.blog_id = 241253187; + article.id = 134645308; + article.title = "My new Title"; + article.author = "Your name"; + article.tags = "Tags, Will Be, Updated"; + article.body_html = "

Look, I can even update through a web service.

"; + article.published_at = "Thu Mar 24 15:45:47 UTC 2011"; + article.image = { + "alt": "Rails logo" + }; + await article.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: { "article": {"title": "My new Title", "author": "Your name", "tags": "Tags, Will Be, Updated", "body_html": "

Look, I can even update through a web service.

", "published_at": "Thu Mar 24 15:45:47 UTC 2011", "image": {"alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Article.delete({ + session: session, + blog_id: 241253187, + id: 134645308, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/134645308.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"authors": ["dennis", "John", "Rob", "Dennis"]})); + + await shopify.rest.Article.authors({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/articles/authors.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + + await shopify.rest.Article.tags({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/articles/tags.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + + await shopify.rest.Article.tags({ + session: session, + limit: "1", + popular: "1", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/articles/tags.json', + query: 'limit=1&popular=1', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({"tags": ["Announcing", "Mystery"]})); + + await shopify.rest.Article.tags({ + session: session, + blog_id: 241253187, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/tags.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + queueMockResponse(JSON.stringify({"tags": ["Announcing"]})); + + await shopify.rest.Article.tags({ + session: session, + blog_id: 241253187, + limit: "1", + popular: "1", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/241253187/articles/tags.json', + query: 'limit=1&popular=1', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/asset.test.ts b/rest/admin/__tests__/2023-01/asset.test.ts new file mode 100644 index 000000000..f520ba191 --- /dev/null +++ b/rest/admin/__tests__/2023-01/asset.test.ts @@ -0,0 +1,165 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Asset resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"assets": [{"key": "layout/theme.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 3252, "checksum": null, "theme_id": 828155753}, {"key": "assets/sidebar-devider.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/sidebar-devider.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1016, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-body-pink.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body-pink.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1562, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-content.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-content.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 134, "checksum": null, "theme_id": 828155753}, {"key": "sections/header_section.liquid", "public_url": null, "created_at": "2017-04-28T10:30:00-04:00", "updated_at": "2017-04-28T10:30:00-04:00", "content_type": "application/x-liquid", "size": 998, "checksum": null, "theme_id": 828155753}, {"key": "assets/shop.css.liquid", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/shop.css.liquid?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 14675, "checksum": null, "theme_id": 828155753}, {"key": "assets/shop.js", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/shop.js?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/javascript", "size": 348, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-main.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-main.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 297, "checksum": null, "theme_id": 828155753}, {"key": "sections/content_section.liquid", "public_url": null, "created_at": "2016-02-11T14:31:50-05:00", "updated_at": "2016-02-11T14:31:50-05:00", "content_type": "application/x-liquid", "size": 997, "checksum": null, "theme_id": 828155753}, {"key": "templates/page.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 147, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-body-green.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body-green.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1542, "checksum": null, "theme_id": 828155753}, {"key": "assets/shop.css", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/shop.css?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "text/css", "size": 14058, "checksum": null, "theme_id": 828155753}, {"key": "config/settings_schema.json", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/json", "size": 4570, "checksum": null, "theme_id": 828155753}, {"key": "sections/product_section.liquid", "public_url": null, "created_at": "2016-02-14T16:31:41-05:00", "updated_at": "2016-02-14T16:31:41-05:00", "content_type": "application/x-liquid", "size": 2440, "checksum": null, "theme_id": 828155753}, {"key": "templates/blog.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 786, "checksum": null, "theme_id": 828155753}, {"key": "templates/article.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 2486, "checksum": null, "theme_id": 828155753}, {"key": "templates/product.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 2796, "checksum": null, "theme_id": 828155753}, {"key": "sections/footer_section.liquid", "public_url": null, "created_at": "2017-04-28T10:30:00-04:00", "updated_at": "2017-04-28T10:30:00-04:00", "content_type": "application/x-liquid", "size": 999, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-footer.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-footer.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1434, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-sidebar.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-sidebar.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 124, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-body-orange.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body-orange.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1548, "checksum": null, "theme_id": 828155753}, {"key": "templates/collection.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 946, "checksum": null, "theme_id": 828155753}, {"key": "assets/sidebar-menu.jpg", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/sidebar-menu.jpg?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/jpeg", "size": 1609, "checksum": null, "theme_id": 828155753}, {"key": "templates/cart.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 2047, "checksum": null, "theme_id": 828155753}, {"key": "config/settings_data.json", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/json", "size": 4570, "checksum": null, "theme_id": 828155753}, {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 1068, "checksum": null, "theme_id": 828155753}, {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1278963110", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "image/gif", "size": 1571, "checksum": null, "theme_id": 828155753}]})); + + await shopify.rest.Asset.all({ + session: session, + theme_id: 828155753, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/themes/828155753/assets.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2023-01-03T12:39:59-05:00", "content_type": "application/x-liquid", "size": 110, "checksum": "cd71db2e14df976c8aa44b44c8dae77b", "theme_id": 828155753}})); + + const asset = new shopify.rest.Asset({session: session}); + asset.theme_id = 828155753; + asset.key = "templates/index.liquid"; + asset.value = "

We are busy updating the store for you and will be back within the hour.

"; + await asset.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/themes/828155753/assets.json', + query: '', + headers, + data: { "asset": {"key": "templates/index.liquid", "value": "

We are busy updating the store for you and will be back within the hour.

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"asset": {"key": "assets/empty.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/empty.gif?v=1672767606", "created_at": "2023-01-03T12:40:06-05:00", "updated_at": "2023-01-03T12:40:06-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + + const asset = new shopify.rest.Asset({session: session}); + asset.theme_id = 828155753; + asset.key = "assets/empty.gif"; + asset.attachment = "R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==\n"; + await asset.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/themes/828155753/assets.json', + query: '', + headers, + data: { "asset": {"key": "assets/empty.gif", "attachment": "R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==\n"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"asset": {"key": "assets/bg-body.gif", "public_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/t/1/assets/bg-body.gif?v=1672767597", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2023-01-03T12:39:57-05:00", "content_type": "image/gif", "size": 43, "checksum": "45cf913e5d9d3c9b2058033056d3dd23", "theme_id": 828155753}})); + + const asset = new shopify.rest.Asset({session: session}); + asset.theme_id = 828155753; + asset.key = "assets/bg-body.gif"; + asset.src = "http://example.com/new_bg.gif"; + await asset.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/themes/828155753/assets.json', + query: '', + headers, + data: { "asset": {"key": "assets/bg-body.gif", "src": "http://example.com/new_bg.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"asset": {"key": "layout/alternate.liquid", "public_url": null, "created_at": "2023-01-03T12:40:04-05:00", "updated_at": "2023-01-03T12:40:04-05:00", "content_type": "application/x-liquid", "size": 3049, "checksum": "1879a06996941b2ff1ff485a1fe60a97", "theme_id": 828155753}})); + + const asset = new shopify.rest.Asset({session: session}); + asset.theme_id = 828155753; + asset.key = "layout/alternate.liquid"; + asset.source_key = "layout/theme.liquid"; + await asset.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/themes/828155753/assets.json', + query: '', + headers, + data: { "asset": {"key": "layout/alternate.liquid", "source_key": "layout/theme.liquid"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"asset": {"key": "templates/index.liquid", "public_url": null, "value": "\n

Featured Products

\n\n {% tablerow product in collections.frontpage.products cols:3 %}\n {{ product.featured_image | product_img_url: 'small' | img_tag }}\n

{{product.title}}

\n
    \n
  • {{product.price_min | money}}
  • \n
\n {% endtablerow %}\n
\n\n\n{{ content_for_index }}\n\n
\n {% assign article = pages.frontpage %}\n
\n {% if article.content != \"\" %}\n

{{ article.title }}

\n
\n {{ article.content }}\n
\n {% else %}\n
\n In Admin > Blogs & Pages, create a page with the handle frontpage and it will show up here.\n
\n {{ \"Learn more about handles\" | link_to \"http://wiki.shopify.com/Handle\" }}\n
\n {% endif %}\n
\n
\n", "created_at": "2010-07-12T15:31:50-04:00", "updated_at": "2010-07-12T15:31:50-04:00", "content_type": "application/x-liquid", "size": 1068, "checksum": null, "theme_id": 828155753}})); + + await shopify.rest.Asset.all({ + session: session, + theme_id: 828155753, + asset: {"key": "templates/index.liquid"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/themes/828155753/assets.json', + query: 'asset%5Bkey%5D=templates%2Findex.liquid', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"message": "assets/bg-body.gif was successfully deleted"})); + + await shopify.rest.Asset.delete({ + session: session, + theme_id: 828155753, + asset: {"key": "assets/bg-body.gif"}, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/themes/828155753/assets.json', + query: 'asset%5Bkey%5D=assets%2Fbg-body.gif', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/assigned_fulfillment_order.test.ts b/rest/admin/__tests__/2023-01/assigned_fulfillment_order.test.ts new file mode 100644 index 000000000..9f89ade1b --- /dev/null +++ b/rest/admin/__tests__/2023-01/assigned_fulfillment_order.test.ts @@ -0,0 +1,52 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('AssignedFulfillmentOrder resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000830, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000821, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737568, "shop_id": 548380009, "fulfillment_order_id": 1046000830, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}}]})); + + await shopify.rest.AssignedFulfillmentOrder.all({ + session: session, + assignment_status: "cancellation_requested", + location_ids: ["24826418"], + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/assigned_fulfillment_orders.json', + query: 'assignment_status=cancellation_requested&location_ids%5B%5D=24826418', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/balance.test.ts b/rest/admin/__tests__/2023-01/balance.test.ts new file mode 100644 index 000000000..4a2656a92 --- /dev/null +++ b/rest/admin/__tests__/2023-01/balance.test.ts @@ -0,0 +1,50 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Balance resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"balance": [{"amount": "53.99", "currency": "USD"}]})); + + await shopify.rest.Balance.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shopify_payments/balance.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/blog.test.ts b/rest/admin/__tests__/2023-01/blog.test.ts new file mode 100644 index 000000000..b14d1b7ca --- /dev/null +++ b/rest/admin/__tests__/2023-01/blog.test.ts @@ -0,0 +1,245 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Blog resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}]})); + + await shopify.rest.Blog.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"blogs": [{"id": 382285388, "handle": "banana-blog", "title": "A Gnu Blog", "updated_at": "2006-02-02T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/382285388"}, {"id": 1008414253, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:27-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:27-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414253"}]})); + + await shopify.rest.Blog.all({ + session: session, + since_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs.json', + query: 'since_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"blog": {"id": 1008414251, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:18-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:18-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414251"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.title = "Apple main blog"; + await blog.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/blogs.json', + query: '', + headers, + data: { "blog": {"title": "Apple main blog"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"blog": {"id": 1008414254, "handle": "apple-main-blog", "title": "Apple main blog", "updated_at": "2023-01-03T12:46:35-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:46:34-05:00", "template_suffix": null, "tags": "", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/1008414254"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.title = "Apple main blog"; + blog.metafields = [ + { + "key": "sponsor", + "value": "Shopify", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await blog.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/blogs.json', + query: '', + headers, + data: { "blog": {"title": "Apple main blog", "metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Blog.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "handle": "apple-blog", "title": "Mah Blog", "updated_at": "2006-02-01T19:00:00-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + + await shopify.rest.Blog.find({ + session: session, + id: 241253187, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/241253187.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"blog": {"id": 241253187, "title": "Mah Blog"}})); + + await shopify.rest.Blog.find({ + session: session, + id: 241253187, + fields: "id,title", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/241253187.json', + query: 'fields=id%2Ctitle', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"blog": {"title": "Mah Blog", "handle": "apple-blog", "id": 241253187, "updated_at": "2023-01-03T12:45:58-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.id = 241253187; + blog.metafields = [ + { + "key": "sponsor", + "value": "Shopify", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await blog.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187.json', + query: '', + headers, + data: { "blog": {"metafields": [{"key": "sponsor", "value": "Shopify", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "apple-blog", "id": 241253187, "updated_at": "2023-01-03T12:46:23-05:00", "commentable": "no", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.id = 241253187; + blog.title = "IPod Updates"; + await blog.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187.json', + query: '', + headers, + data: { "blog": {"title": "IPod Updates"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate", "id": 241253187, "updated_at": "2023-01-03T12:46:11-05:00", "feedburner": null, "feedburner_location": null, "created_at": "2023-01-03T12:21:36-05:00", "template_suffix": null, "tags": "Announcing, Mystery", "admin_graphql_api_id": "gid://shopify/OnlineStoreBlog/241253187"}})); + + const blog = new shopify.rest.Blog({session: session}); + blog.id = 241253187; + blog.title = "IPod Updates"; + blog.handle = "ipod-updates"; + blog.commentable = "moderate"; + await blog.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/241253187.json', + query: '', + headers, + data: { "blog": {"title": "IPod Updates", "handle": "ipod-updates", "commentable": "moderate"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Blog.delete({ + session: session, + id: 241253187, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/blogs/241253187.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/cancellation_request.test.ts b/rest/admin/__tests__/2023-01/cancellation_request.test.ts new file mode 100644 index 000000000..c4e5e30a1 --- /dev/null +++ b/rest/admin/__tests__/2023-01/cancellation_request.test.ts @@ -0,0 +1,89 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('CancellationRequest resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000808, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_requested", "status": "in_progress", "supported_actions": ["cancel_fulfillment_order", "create_fulfillment"], "destination": {"id": 1046000800, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737539, "shop_id": 548380009, "fulfillment_order_id": 1046000808, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + + const cancellation_request = new shopify.rest.CancellationRequest({session: session}); + cancellation_request.fulfillment_order_id = 1046000808; + cancellation_request.message = "The customer changed his mind."; + await cancellation_request.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000808/cancellation_request.json', + query: '', + headers, + data: { "cancellation_request": {"message": "The customer changed his mind."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000806, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_accepted", "status": "cancelled", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000798, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737537, "shop_id": 548380009, "fulfillment_order_id": 1046000806, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + + const cancellation_request = new shopify.rest.CancellationRequest({session: session}); + cancellation_request.fulfillment_order_id = 1046000806; + await cancellation_request.accept({ + body: {"cancellation_request": {"message": "We had not started any processing yet."}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000806/cancellation_request/accept.json', + query: '', + headers, + data: { "cancellation_request": {"message": "We had not started any processing yet."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000807, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "cancellation_rejected", "status": "in_progress", "supported_actions": [], "destination": {"id": 1046000799, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737538, "shop_id": 548380009, "fulfillment_order_id": 1046000807, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + + const cancellation_request = new shopify.rest.CancellationRequest({session: session}); + cancellation_request.fulfillment_order_id = 1046000807; + await cancellation_request.reject({ + body: {"cancellation_request": {"message": "We have already send the shipment out."}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000807/cancellation_request/reject.json', + query: '', + headers, + data: { "cancellation_request": {"message": "We have already send the shipment out."} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/carrier_service.test.ts b/rest/admin/__tests__/2023-01/carrier_service.test.ts new file mode 100644 index 000000000..51943968e --- /dev/null +++ b/rest/admin/__tests__/2023-01/carrier_service.test.ts @@ -0,0 +1,124 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('CarrierService resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894957, "name": "Shipping Rate Provider", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894957", "format": "json", "callback_url": "http://shipping.example.com/"}})); + + const carrier_service = new shopify.rest.CarrierService({session: session}); + carrier_service.name = "Shipping Rate Provider"; + carrier_service.callback_url = "http://shipping.example.com"; + carrier_service.service_discovery = true; + await carrier_service.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/carrier_services.json', + query: '', + headers, + data: { "carrier_service": {"name": "Shipping Rate Provider", "callback_url": "http://shipping.example.com", "service_discovery": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"carrier_services": [{"id": 1036894958, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894958", "format": "json", "callback_url": "http://example.com/"}, {"id": 260046840, "name": "ups_shipping", "active": true, "service_discovery": true, "carrier_service_type": "legacy", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/260046840"}]})); + + await shopify.rest.CarrierService.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/carrier_services.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"carrier_service": {"active": false, "id": 1036894955, "name": "Some new name", "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894955", "format": "json", "callback_url": "http://example.com/"}})); + + const carrier_service = new shopify.rest.CarrierService({session: session}); + carrier_service.id = 1036894955; + carrier_service.name = "Some new name"; + carrier_service.active = false; + await carrier_service.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/carrier_services/1036894955.json', + query: '', + headers, + data: { "carrier_service": {"name": "Some new name", "active": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"carrier_service": {"id": 1036894954, "name": "Purolator", "active": true, "service_discovery": true, "carrier_service_type": "api", "admin_graphql_api_id": "gid://shopify/DeliveryCarrierService/1036894954", "format": "json", "callback_url": "http://example.com/"}})); + + await shopify.rest.CarrierService.find({ + session: session, + id: 1036894954, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/carrier_services/1036894954.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.CarrierService.delete({ + session: session, + id: 1036894959, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/carrier_services/1036894959.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/checkout.test.ts b/rest/admin/__tests__/2023-01/checkout.test.ts new file mode 100644 index 000000000..75746e2e1 --- /dev/null +++ b/rest/admin/__tests__/2023-01/checkout.test.ts @@ -0,0 +1,245 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Checkout resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2023-01-03T12:41:32-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": null, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": null, "legal_notice_url": null, "location_id": null, "name": "#1066348317", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "995.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "995.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "c3b86d7cdfaf5a4d1bf89efbbe88789e", "total_price": "995.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "995.00", "updated_at": "2023-01-03T12:41:32-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/c3b86d7cdfaf5a4d1bf89efbbe88789e", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "e8a51fbe23cff8fcad2766f024a761d6", "key": "e8a51fbe23cff8fcad2766f024a761d6", "product_id": 632910392, "variant_id": 39072856, "sku": "IPOD2008GREEN", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Green", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "995.00", "properties": {}, "quantity": 5, "grams": 567, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.line_items = [ + { + "variant_id": 39072856, + "quantity": 5 + } + ]; + await checkout.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/checkouts.json', + query: '', + headers, + data: { "checkout": {"line_items": [{"variant_id": 39072856, "quantity": 5}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2023-01-03T12:41:50-05:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339479, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "me@example.com", "legal_notice_url": null, "location_id": null, "name": "#1066348318", "note": "", "note_attributes": {}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "8a8043ef00104a4738ba3a235cd2441b", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2023-01-03T12:41:50-05:00", "user_id": null, "web_url": "https://jsmith.myshopify.com/548380009/checkouts/8a8043ef00104a4738ba3a235cd2441b", "total_duties": null, "total_additional_fees": null, "line_items": [], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": null, "credit_card": null, "billing_address": null, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.email = "me@example.com"; + await checkout.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/checkouts.json', + query: '', + headers, + data: { "checkout": {"email": "me@example.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#86568385", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "0.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": false, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "0.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "b490a9220cd14d7344024f4874f640a6", "total_price": "0.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "0.00", "updated_at": "2023-01-03T12:41:10-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/b490a9220cd14d7344024f4874f640a6", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": 49148385, "key": 49148385, "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": false, "gift_card": false, "price": "0.00", "compare_at_price": null, "line_price": "0.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.token = "b490a9220cd14d7344024f4874f640a6"; + await checkout.complete({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/checkouts/b490a9220cd14d7344024f4874f640a6/complete.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"checkout": {"completed_at": "2005-07-31T11:57:11-04:00", "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#901414060", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": 450789469, "order_status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you", "order": {"id": 450789469, "name": "#1001", "status_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c/thank_you"}, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + await shopify.rest.Checkout.find({ + session: session, + token: "bd5a8aa1ecd019dd3520ff791ee3a24c", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/bd5a8aa1ecd019dd3520ff791ee3a24c.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + await shopify.rest.Checkout.find({ + session: session, + token: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + await shopify.rest.Checkout.find({ + session: session, + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:41:57-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; + checkout.shipping_line = { + "handle": "shopify-Free%20Shipping-0.00" + }; + await checkout.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', + query: '', + headers, + data: { "checkout": {"shipping_line": {"handle": "shopify-Free%20Shipping-0.00"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 1073339478, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "john.smith@example.com", "legal_notice_url": null, "location_id": null, "name": "#862052962", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "exuw7apwoycchjuwtiqg8nytfhphr62a", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:41:43-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": null, "shipping_rate": null, "shipping_address": {"id": 550558813, "first_name": "John", "last_name": "Smith", "phone": "(123)456-7890", "company": null, "address1": "126 York St.", "address2": "", "city": "Los Angeles", "province": "California", "province_code": "CA", "country": "United States", "country_code": "US", "zip": "90002"}, "credit_card": null, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}})); + + const checkout = new shopify.rest.Checkout({session: session}); + checkout.token = "exuw7apwoycchjuwtiqg8nytfhphr62a"; + checkout.email = "john.smith@example.com"; + checkout.shipping_address = { + "first_name": "John", + "last_name": "Smith", + "address1": "126 York St.", + "city": "Los Angeles", + "province_code": "CA", + "country_code": "US", + "phone": "(123)456-7890", + "zip": "90002" + }; + await checkout.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a.json', + query: '', + headers, + data: { "checkout": {"email": "john.smith@example.com", "shipping_address": {"first_name": "John", "last_name": "Smith", "address1": "126 York St.", "city": "Los Angeles", "province_code": "CA", "country_code": "US", "phone": "(123)456-7890", "zip": "90002"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"shipping_rates": [{"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "checkout": {"total_tax": "0.00", "total_price": "398.00", "subtotal_price": "398.00"}, "phone_required": false, "delivery_range": null, "estimated_time_in_transit": null, "handle": "shopify-Free%20Shipping-0.00"}]})); + + await shopify.rest.Checkout.shipping_rates({ + session: session, + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"shipping_rates": []})); + + await shopify.rest.Checkout.shipping_rates({ + session: session, + token: "exuw7apwoycchjuwtiqg8nytfhphr62a", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/exuw7apwoycchjuwtiqg8nytfhphr62a/shipping_rates.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"shipping_rates": []})); + + await shopify.rest.Checkout.shipping_rates({ + session: session, + token: "zs9ru89kuqcdagk8bz4r9hnxt22wwd42", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/zs9ru89kuqcdagk8bz4r9hnxt22wwd42/shipping_rates.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/collect.test.ts b/rest/admin/__tests__/2023-01/collect.test.ts new file mode 100644 index 000000000..4612127d0 --- /dev/null +++ b/rest/admin/__tests__/2023-01/collect.test.ts @@ -0,0 +1,193 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Collect resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"collect": {"id": 1071559576, "collection_id": 841564295, "product_id": 921728736, "created_at": "2023-01-03T12:45:21-05:00", "updated_at": "2023-01-03T12:45:21-05:00", "position": 2, "sort_value": "0000000002"}})); + + const collect = new shopify.rest.Collect({session: session}); + collect.product_id = 921728736; + collect.collection_id = 841564295; + await collect.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/collects.json', + query: '', + headers, + data: { "collect": {"product_id": 921728736, "collection_id": 841564295} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 800915878, "collection_id": 482865238, "product_id": 921728736, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); + + await shopify.rest.Collect.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collects.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"collects": [{"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 1071559574, "collection_id": 841564295, "product_id": 921728736, "created_at": "2023-01-03T12:45:12-05:00", "updated_at": "2023-01-03T12:45:12-05:00", "position": 2, "sort_value": "0000000002"}]})); + + await shopify.rest.Collect.all({ + session: session, + collection_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collects.json', + query: 'collection_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"collects": [{"id": 358268117, "collection_id": 482865238, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}, {"id": 773559378, "collection_id": 395646240, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}]})); + + await shopify.rest.Collect.all({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collects.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Collect.delete({ + session: session, + id: 455204334, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/collects/455204334.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"collect": {"id": 455204334, "collection_id": 841564295, "product_id": 632910392, "created_at": null, "updated_at": null, "position": 1, "sort_value": "0000000001"}})); + + await shopify.rest.Collect.find({ + session: session, + id: 455204334, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collects/455204334.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Collect.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collects/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Collect.count({ + session: session, + collection_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collects/count.json', + query: 'collection_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Collect.count({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collects/count.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/collection.test.ts b/rest/admin/__tests__/2023-01/collection.test.ts new file mode 100644 index 000000000..d686cfcae --- /dev/null +++ b/rest/admin/__tests__/2023-01/collection.test.ts @@ -0,0 +1,69 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Collection resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "collection_type": "custom", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); + + await shopify.rest.Collection.find({ + session: session, + id: 841564295, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collections/841564295.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:21:36-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:21:36-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); + + await shopify.rest.Collection.products({ + session: session, + id: 841564295, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collections/841564295/products.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/collection_listing.test.ts b/rest/admin/__tests__/2023-01/collection_listing.test.ts new file mode 100644 index 000000000..dba8581b9 --- /dev/null +++ b/rest/admin/__tests__/2023-01/collection_listing.test.ts @@ -0,0 +1,121 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('CollectionListing resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"collection_listings": [{"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 841564295, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "IPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 395646240, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever. Again

", "default_product_image": {"id": 850703190, "created_at": "2023-01-03T12:56:35-05:00", "position": 1, "updated_at": "2023-01-03T12:56:35-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "width": 123, "height": 456}, "handle": "ipods_two", "image": null, "title": "IPods Two", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}, {"collection_id": 691652237, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

No ipods here

", "default_product_image": null, "handle": "non-ipods", "image": null, "title": "Non Ipods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}]})); + + await shopify.rest.CollectionListing.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collection_listings.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"product_ids": [632910392]})); + + await shopify.rest.CollectionListing.product_ids({ + session: session, + collection_id: 841564295, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collection_listings/841564295/product_ids.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + + await shopify.rest.CollectionListing.find({ + session: session, + collection_id: 482865238, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collection_listings/482865238.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"collection_listing": {"collection_id": 482865238, "updated_at": "2023-01-03T12:56:35-05:00", "body_html": "

The best selling ipod ever

", "default_product_image": null, "handle": "smart-ipods", "image": {"created_at": "2023-01-03T12:56:35-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}, "title": "Smart iPods", "sort_order": "manual", "published_at": "2017-08-31T20:00:00-04:00"}})); + + const collection_listing = new shopify.rest.CollectionListing({session: session}); + collection_listing.collection_id = 482865238; + await collection_listing.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/collection_listings/482865238.json', + query: '', + headers, + data: { "collection_listing": {} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.CollectionListing.delete({ + session: session, + collection_id: 482865238, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/collection_listings/482865238.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/comment.test.ts b/rest/admin/__tests__/2023-01/comment.test.ts new file mode 100644 index 000000000..a9a8970ca --- /dev/null +++ b/rest/admin/__tests__/2023-01/comment.test.ts @@ -0,0 +1,305 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Comment resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + + await shopify.rest.Comment.all({ + session: session, + since_id: "118373535", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/comments.json', + query: 'since_id=118373535', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + + await shopify.rest.Comment.all({ + session: session, + article_id: "134645308", + blog_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/comments.json', + query: 'article_id=134645308&blog_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + + await shopify.rest.Comment.all({ + session: session, + blog_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/comments.json', + query: 'blog_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"comments": [{"id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "unapproved", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}, {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}]})); + + await shopify.rest.Comment.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/comments.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Comment.count({ + session: session, + article_id: "134645308", + blog_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/comments/count.json', + query: 'article_id=134645308&blog_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Comment.count({ + session: session, + blog_id: "241253187", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/comments/count.json', + query: 'blog_id=241253187', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Comment.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/comments/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"comment": {"id": 118373535, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1", "published_at": null}})); + + await shopify.rest.Comment.find({ + session: session, + id: 118373535, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/comments/118373535.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"comment": {"author": "Your new name", "body": "You can even update through a web service.", "email": "your@updated-email.com", "published_at": "2023-01-03T12:06:05-05:00", "id": 118373535, "body_html": "

You can even update through a web service.

", "status": "published", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:06-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"}})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 118373535; + comment.body = "You can even update through a web service."; + comment.author = "Your new name"; + comment.email = "your@updated-email.com"; + comment.published_at = "2023-01-03T17:06:05.929Z"; + await comment.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/comments/118373535.json', + query: '', + headers, + data: { "comment": {"body": "You can even update through a web service.", "author": "Your new name", "email": "your@updated-email.com", "published_at": "2023-01-03T17:06:05.929Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"comment": {"id": 757536352, "body": "I like comments\nAnd I like posting them *RESTfully*.", "body_html": "

I like comments
\nAnd I like posting them RESTfully.

", "author": "Your name", "email": "your@email.com", "status": "pending", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:06:09-05:00", "updated_at": "2023-01-03T12:06:09-05:00", "ip": "107.20.160.121", "user_agent": null, "published_at": null}})); + + const comment = new shopify.rest.Comment({session: session}); + comment.body = "I like comments\nAnd I like posting them *RESTfully*."; + comment.author = "Your name"; + comment.email = "your@email.com"; + comment.ip = "107.20.160.121"; + comment.blog_id = 241253187; + comment.article_id = 134645308; + await comment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/comments.json', + query: '', + headers, + data: { "comment": {"body": "I like comments\nAnd I like posting them *RESTfully*.", "author": "Your name", "email": "your@email.com", "ip": "107.20.160.121", "blog_id": 241253187, "article_id": 134645308} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"published_at": null, "status": "spam", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:59-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.spam({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/comments/653537639/spam.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:06:19-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:19-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.not_spam({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/comments/653537639/not_spam.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:06:30-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:30-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.approve({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/comments/653537639/approve.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({"published_at": null, "status": "removed", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:12-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.remove({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/comments/653537639/remove.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"published_at": "2023-01-03T12:05:56-05:00", "status": "published", "id": 653537639, "body": "Hi author, I really _like_ what you're doing there.", "body_html": "

Hi author, I really like what you're doing there.

", "author": "Soleone", "email": "soleone@example.net", "article_id": 134645308, "blog_id": 241253187, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:56-05:00", "ip": "127.0.0.1", "user_agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"})); + + const comment = new shopify.rest.Comment({session: session}); + comment.id = 653537639; + await comment.restore({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/comments/653537639/restore.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/country.test.ts b/rest/admin/__tests__/2023-01/country.test.ts new file mode 100644 index 000000000..4b5dde024 --- /dev/null +++ b/rest/admin/__tests__/2023-01/country.test.ts @@ -0,0 +1,174 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Country resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"countries": [{"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}, {"id": 359115488, "name": "Colombia", "code": "CO", "tax_name": "VAT", "tax": 0.15, "provinces": []}, {"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}]})); + + await shopify.rest.Country.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/countries.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"countries": [{"id": 817138619, "name": "United States", "code": "US", "tax_name": "Federal Tax", "tax": 0.0, "provinces": [{"id": 952629862, "country_id": 817138619, "name": "California", "code": "CA", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.05, "tax_percentage": 5.0}, {"id": 222234158, "country_id": 817138619, "name": "Kentucky", "code": "KY", "tax_name": null, "tax_type": null, "shipping_zone_id": 1039932365, "tax": 0.06, "tax_percentage": 6.0}, {"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 696485510, "country_id": 817138619, "name": "Minnesota", "code": "MN", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.065, "tax_percentage": 6.5}, {"id": 753050225, "country_id": 817138619, "name": "New Jersey", "code": "NJ", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.06, "tax_percentage": 6.0}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.04, "tax_percentage": 4.0}, {"id": 915134533, "country_id": 817138619, "name": "Pennsylvania", "code": "PA", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.05, "tax_percentage": 5.0}, {"id": 591478044, "country_id": 817138619, "name": "Rhode Island", "code": "RI", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}]}, {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}]})); + + await shopify.rest.Country.all({ + session: session, + since_id: "359115488", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/countries.json', + query: 'since_id=359115488', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 1070231511, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/countries.json', + query: '', + headers, + data: { "country": {"code": "FR"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 1070231510, "name": "France", "code": "FR", "tax_name": "TVA", "tax": 0.2, "provinces": []}})); + + const country = new shopify.rest.Country({session: session}); + country.code = "FR"; + country.tax = 0.2; + await country.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/countries.json', + query: '', + headers, + data: { "country": {"code": "FR", "tax": 0.2} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Country.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/countries/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); + + await shopify.rest.Country.find({ + session: session, + id: 879921427, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/countries/879921427.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"country": {"id": 879921427, "name": "Canada", "code": "CA", "tax_name": "GST", "tax": 0.05, "provinces": [{"country_id": 879921427, "tax_name": "Tax", "id": 205434194, "name": "Alberta", "code": "AB", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 170405627, "name": "British Columbia", "code": "BC", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 342345110, "name": "Manitoba", "code": "MB", "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 92264567, "name": "New Brunswick", "code": "NB", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 243284171, "name": "Newfoundland", "code": "NL", "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 439598329, "name": "Northwest Territories", "code": "NT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 448070559, "name": "Nova Scotia", "code": "NS", "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 670206421, "name": "Nunavut", "code": "NU", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 702530425, "name": "Ontario", "code": "ON", "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 570891722, "name": "Prince Edward Island", "code": "PE", "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 473391800, "name": "Saskatchewan", "code": "SK", "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"country_id": 879921427, "tax_name": "Tax", "id": 1005264686, "name": "Yukon", "code": "YT", "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]}})); + + const country = new shopify.rest.Country({session: session}); + country.id = 879921427; + country.tax = 0.05; + await country.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/countries/879921427.json', + query: '', + headers, + data: { "country": {"tax": 0.05} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Country.delete({ + session: session, + id: 879921427, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/countries/879921427.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/currency.test.ts b/rest/admin/__tests__/2023-01/currency.test.ts new file mode 100644 index 000000000..8b6369df7 --- /dev/null +++ b/rest/admin/__tests__/2023-01/currency.test.ts @@ -0,0 +1,50 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Currency resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"currencies": [{"currency": "CAD", "rate_updated_at": "2018-01-23T19:01:01-05:00", "enabled": true}, {"currency": "EUR", "rate_updated_at": "2018-01-23T19:01:01-05:00", "enabled": true}, {"currency": "JPY", "rate_updated_at": "2018-01-23T19:01:01-05:00", "enabled": true}]})); + + await shopify.rest.Currency.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/currencies.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/custom_collection.test.ts b/rest/admin/__tests__/2023-01/custom_collection.test.ts new file mode 100644 index 000000000..c1971c494 --- /dev/null +++ b/rest/admin/__tests__/2023-01/custom_collection.test.ts @@ -0,0 +1,452 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('CustomCollection resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + + await shopify.rest.CustomCollection.all({ + session: session, + ids: "395646240,691652237,841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/custom_collections.json', + query: 'ids=395646240%2C691652237%2C841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}, {"id": 691652237, "handle": "non-ipods", "title": "Non Ipods", "updated_at": "2013-02-01T19:00:00-05:00", "body_html": "

No ipods here

", "published_at": "2013-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/691652237"}]})); + + await shopify.rest.CustomCollection.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/custom_collections.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 1063001346, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:05:21-05:00", "body_html": null, "published_at": "2023-01-03T13:05:21-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001346"}]})); + + await shopify.rest.CustomCollection.all({ + session: session, + since_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/custom_collections.json', + query: 'since_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"custom_collections": [{"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}, {"id": 395646240, "handle": "ipods_two", "title": "IPods Two", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever. Again

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/395646240"}]})); + + await shopify.rest.CustomCollection.all({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/custom_collections.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.CustomCollection.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/custom_collections/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.CustomCollection.count({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/custom_collections/count.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"id": 841564295, "handle": "ipods", "title": "IPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 1, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); + + await shopify.rest.CustomCollection.find({ + session: session, + id: 841564295, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2023-01-03T13:03:58-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.collects = [ + { + "product_id": 921728736, + "position": 1 + }, + { + "id": 455204334, + "position": 2 + } + ]; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"collects": [{"product_id": 921728736, "position": 1}, {"id": 455204334, "position": 2}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "updated_at": "2023-01-03T13:04:15-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": null, "updated_at": "2023-01-03T13:05:26-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = false; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "id": 841564295, "published_at": "2023-01-03T13:05:05-05:00", "updated_at": "2023-01-03T13:05:05-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.published = true; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

The best selling ipod ever

", "handle": "ipods", "updated_at": "2023-01-03T13:04:49-05:00", "id": 841564295, "sort_order": "manual", "title": "IPods", "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.image = ""; + custom_collection.updated_at = "2023-01-03T13:04:48-05:00"; + custom_collection.title = "IPods"; + custom_collection.handle = "ipods"; + custom_collection.body_html = "

The best selling ipod ever

"; + custom_collection.published_at = "2008-02-01T19:00:00-05:00"; + custom_collection.sort_order = "manual"; + custom_collection.template_suffix = null; + custom_collection.published_scope = "web"; + custom_collection.admin_graphql_api_id = "gid://shopify/Collection/841564295"; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"image": "", "updated_at": "2023-01-03T13:04:48-05:00", "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2023-01-03T13:05:34-05:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T13:05:34-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672769134"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbR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ftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novH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l0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"updated_at": "2023-01-03T13:04:34-05:00", "id": 841564295, "title": "IPods", "handle": "ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"alt": "Rails logo", "created_at": "2023-01-03T13:04:32-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-s0af8s.gif?v=1672769074"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.image = { + "alt": "Rails logo" + }; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"image": {"alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"body_html": "

5000 songs in your pocket

", "title": "IPods", "handle": "ipods", "id": 841564295, "updated_at": "2023-01-03T13:04:37-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/841564295", "image": {"created_at": "2023-01-03T12:56:35-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672768595"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.id = 841564295; + custom_collection.body_html = "

5000 songs in your pocket

"; + await custom_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: { "custom_collection": {"body_html": "

5000 songs in your pocket

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.CustomCollection.delete({ + session: session, + id: 841564295, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/custom_collections/841564295.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001333, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T13:04:13-05:00", "body_html": null, "published_at": "2023-01-03T13:04:13-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001333"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "IPods"; + custom_collection.collects = [ + { + "product_id": 921728736 + } + ]; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "IPods", "collects": [{"product_id": 921728736}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001341, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:53-05:00", "body_html": null, "published_at": "2023-01-03T13:04:53-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001341"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "Macbooks"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001342, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:58-05:00", "body_html": null, "published_at": "2023-01-03T13:04:58-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001342"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + custom_collection.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "Macbooks", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001339, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:40-05:00", "body_html": null, "published_at": "2023-01-03T13:04:39-05:00", "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001339", "image": {"created_at": "2023-01-03T13:04:39-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-c6wrde.gif?v=1672769080"}}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + custom_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "Macbooks", "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({"custom_collection": {"id": 1063001337, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T13:04:24-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001337"}})); + + const custom_collection = new shopify.rest.CustomCollection({session: session}); + custom_collection.title = "Macbooks"; + custom_collection.published = false; + await custom_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/custom_collections.json', + query: '', + headers, + data: { "custom_collection": {"title": "Macbooks", "published": false} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/customer.test.ts b/rest/admin/__tests__/2023-01/customer.test.ts new file mode 100644 index 000000000..d7ad103f4 --- /dev/null +++ b/rest/admin/__tests__/2023-01/customer.test.ts @@ -0,0 +1,640 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Customer resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339469, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:43-05:00", "updated_at": "2023-01-03T12:19:43-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317299, "customer_id": 1073339469, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:19:43-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339469", "default_address": {"id": 1053317299, "customer_id": 1073339469, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:30-05:00", "updated_at": "2023-01-03T12:19:30-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.all({ + session: session, + ids: "207119551,1073339469", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers.json', + query: 'ids=207119551%2C1073339469', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339458, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:08:39-05:00", "updated_at": "2023-01-03T12:08:39-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:39-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/1073339458", "default_address": {"id": 1053317288, "customer_id": 1073339458, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}]})); + + await shopify.rest.Customer.all({ + session: session, + since_id: "207119551", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers.json', + query: 'since_id=207119551', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:12:39-05:00", "updated_at": "2023-01-03T12:12:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.all({ + session: session, + updated_at_min: "2023-01-02 17:12:54", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers.json', + query: 'updated_at_min=2023-01-02+17%3A12%3A54', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:09-05:00", "updated_at": "2023-01-03T12:15:09-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "tags": ""}]})); + + await shopify.rest.Customer.all({ + session: session, + fields: "id,email,tags", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers.json', + query: 'fields=id%2Cemail%2Ctags', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:13:43-05:00", "updated_at": "2023-01-03T12:13:43-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.search({ + session: session, + query: "email:bob.norman@mail.example.com", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/search.json', + query: 'query=email%3Abob.norman%40mail.example.com', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman"}]})); + + await shopify.rest.Customer.search({ + session: session, + fields: "id, email, first_name, last_name", + query: "last_name:Norman", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/search.json', + query: 'fields=id%2C+email%2C+first_name%2C+last_name&query=last_name%3ANorman', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339466, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "tags": "New Customer"}]})); + + await shopify.rest.Customer.search({ + session: session, + fields: "id, email, first_name, last_name, tags", + query: "customer_tag:New Customer", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/search.json', + query: 'fields=id%2C+email%2C+first_name%2C+last_name%2C+tags&query=customer_tag%3ANew+Customer', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:07:03-05:00", "updated_at": "2023-01-03T12:07:03-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.search({ + session: session, + query: "first_name:Bob country:United States", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/search.json', + query: 'query=first_name%3ABob+country%3AUnited+States', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:16:11-05:00", "updated_at": "2023-01-03T12:16:11-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.Customer.search({ + session: session, + query: "email:*@mail.example.com", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/search.json', + query: 'query=email%3A%2A%40mail.example.com', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 1073339460, "email": "isabella.garcia@example.com", "first_name": "Isabella", "last_name": "Garcia", "verified_email": true}, {"id": 207119551, "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "verified_email": true}]})); + + await shopify.rest.Customer.search({ + session: session, + fields: "id, email, first_name, last_name, verified_email", + query: "verified_email:true", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/search.json', + query: 'fields=id%2C+email%2C+first_name%2C+last_name%2C+verified_email&query=verified_email%3Atrue', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:39-05:00", "updated_at": "2023-01-03T12:15:39-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:15:39-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + await shopify.rest.Customer.find({ + session: session, + id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/207119551.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2023-01-03T12:18:42-05:00", "updated_at": "2023-01-03T12:18:59-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:18:42-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + customer.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await customer.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customers/207119551.json', + query: '', + headers, + data: { "customer": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2023-01-03T12:07:21-05:00", "updated_at": "2023-01-03T12:07:37-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2022-12-31T12:07:36-05:00", "marketing_opt_in_level": "confirmed_opt_in", "tax_exemptions": [], "email_marketing_consent": {"state": "subscribed", "opt_in_level": "confirmed_opt_in", "consent_updated_at": "2022-12-31T12:07:36-05:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:07:21-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + customer.accepts_marketing = true; + customer.accepts_marketing_updated_at = "2022-12-31T12:07:36-05:00"; + customer.marketing_opt_in_level = "confirmed_opt_in"; + await customer.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customers/207119551.json', + query: '', + headers, + data: { "customer": {"accepts_marketing": true, "accepts_marketing_updated_at": "2022-12-31T12:07:36-05:00", "marketing_opt_in_level": "confirmed_opt_in"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"customer": {"email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "id": 207119551, "accepts_marketing": false, "created_at": "2023-01-03T12:07:37-05:00", "updated_at": "2023-01-03T12:07:53-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "New Customer, Repeat Customer", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:07:37-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + customer.tags = "New Customer, Repeat Customer"; + await customer.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customers/207119551.json', + query: '', + headers, + data: { "customer": {"tags": "New Customer, Repeat Customer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"customer": {"id": 207119551, "email": "changed@email.address.com", "updated_at": "2023-01-03T12:08:55-05:00", "note": "Customer is a great guy", "first_name": "Bob", "last_name": "Norman", "accepts_marketing": false, "created_at": "2023-01-03T12:08:41-05:00", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:55-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:08:41-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + customer.email = "changed@email.address.com"; + customer.note = "Customer is a great guy"; + await customer.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customers/207119551.json', + query: '', + headers, + data: { "customer": {"email": "changed@email.address.com", "note": "Customer is a great guy"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Customer.delete({ + session: session, + id: 207119551, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/customers/207119551.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"customer": {"id": 1073339456, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:08:09-05:00", "updated_at": "2023-01-03T12:08:10-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "enabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317286, "customer_id": 1073339456, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:08:10-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339456", "default_address": {"id": 1053317286, "customer_id": 1073339456, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.first_name = "Steve"; + customer.last_name = "Lastnameson"; + customer.email = "steve.lastnameson@example.com"; + customer.phone = "+15142546011"; + customer.verified_email = true; + customer.addresses = [ + { + "address1": "123 Oak St", + "city": "Ottawa", + "province": "ON", + "phone": "555-1212", + "zip": "123 ABC", + "last_name": "Lastnameson", + "first_name": "Mother", + "country": "CA" + } + ]; + customer.password = "newpass"; + customer.password_confirmation = "newpass"; + customer.send_email_welcome = false; + await customer.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customers.json', + query: '', + headers, + data: { "customer": {"first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "+15142546011", "verified_email": true, "addresses": [{"address1": "123 Oak St", "city": "Ottawa", "province": "ON", "phone": "555-1212", "zip": "123 ABC", "last_name": "Lastnameson", "first_name": "Mother", "country": "CA"}], "password": "newpass", "password_confirmation": "newpass", "send_email_welcome": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"customer": {"id": 1073339468, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:19:30-05:00", "updated_at": "2023-01-03T12:19:30-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317298, "customer_id": 1073339468, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:19:30-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339468", "default_address": {"id": 1053317298, "customer_id": 1073339468, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.first_name = "Steve"; + customer.last_name = "Lastnameson"; + customer.email = "steve.lastnameson@example.com"; + customer.phone = "+15142546011"; + customer.verified_email = true; + customer.addresses = [ + { + "address1": "123 Oak St", + "city": "Ottawa", + "province": "ON", + "phone": "555-1212", + "zip": "123 ABC", + "last_name": "Lastnameson", + "first_name": "Mother", + "country": "CA" + } + ]; + customer.send_email_invite = true; + await customer.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customers.json', + query: '', + headers, + data: { "customer": {"first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "+15142546011", "verified_email": true, "addresses": [{"address1": "123 Oak St", "city": "Ottawa", "province": "ON", "phone": "555-1212", "zip": "123 ABC", "last_name": "Lastnameson", "first_name": "Mother", "country": "CA"}], "send_email_invite": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({"customer": {"id": 1073339465, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:16:40-05:00", "updated_at": "2023-01-03T12:16:40-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317295, "customer_id": 1073339465, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:16:40-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339465", "default_address": {"id": 1053317295, "customer_id": 1073339465, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.first_name = "Steve"; + customer.last_name = "Lastnameson"; + customer.email = "steve.lastnameson@example.com"; + customer.phone = "+15142546011"; + customer.verified_email = true; + customer.addresses = [ + { + "address1": "123 Oak St", + "city": "Ottawa", + "province": "ON", + "phone": "555-1212", + "zip": "123 ABC", + "last_name": "Lastnameson", + "first_name": "Mother", + "country": "CA" + } + ]; + customer.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await customer.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customers.json', + query: '', + headers, + data: { "customer": {"first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "+15142546011", "verified_email": true, "addresses": [{"address1": "123 Oak St", "city": "Ottawa", "province": "ON", "phone": "555-1212", "zip": "123 ABC", "last_name": "Lastnameson", "first_name": "Mother", "country": "CA"}], "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({"customer": {"id": 1073339464, "email": "steve.lastnameson@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:15:39-05:00", "updated_at": "2023-01-03T12:15:39-05:00", "first_name": "Steve", "last_name": "Lastnameson", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": "+15142546011", "addresses": [{"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}], "accepts_marketing_updated_at": "2023-01-03T12:15:39-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null, "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/1073339464", "default_address": {"id": 1053317294, "customer_id": 1073339464, "first_name": "Mother", "last_name": "Lastnameson", "company": null, "address1": "123 Oak St", "address2": null, "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "123 ABC", "phone": "555-1212", "name": "Mother Lastnameson", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.first_name = "Steve"; + customer.last_name = "Lastnameson"; + customer.email = "steve.lastnameson@example.com"; + customer.phone = "+15142546011"; + customer.verified_email = true; + customer.addresses = [ + { + "address1": "123 Oak St", + "city": "Ottawa", + "province": "ON", + "phone": "555-1212", + "zip": "123 ABC", + "last_name": "Lastnameson", + "first_name": "Mother", + "country": "CA" + } + ]; + await customer.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customers.json', + query: '', + headers, + data: { "customer": {"first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "+15142546011", "verified_email": true, "addresses": [{"address1": "123 Oak St", "city": "Ottawa", "province": "ON", "phone": "555-1212", "zip": "123 ABC", "last_name": "Lastnameson", "first_name": "Mother", "country": "CA"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + queueMockResponse(JSON.stringify({"account_activation_url": "https://jsmith.myshopify.com/account/activate/207119551/75ed95bcf5876b0bac5bb06e1244ccea-1672766051"})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + await customer.account_activation_url({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customers/207119551/account_activation_url.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + queueMockResponse(JSON.stringify({"customer_invite": {"to": "new_test_email@shopify.com", "from": "j.limited@example.com", "subject": "Welcome to my new shop", "custom_message": "My awesome new store", "bcc": ["j.limited@example.com"]}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + await customer.send_invite({ + body: {"customer_invite": {"to": "new_test_email@shopify.com", "from": "j.limited@example.com", "bcc": ["j.limited@example.com"], "subject": "Welcome to my new shop", "custom_message": "My awesome new store"}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customers/207119551/send_invite.json', + query: '', + headers, + data: {"customer_invite": {"to": "new_test_email@shopify.com", "from": "j.limited@example.com", "bcc": ["j.limited@example.com"], "subject": "Welcome to my new shop", "custom_message": "My awesome new store"}} + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + queueMockResponse(JSON.stringify({"customer_invite": {"to": "bob.norman@mail.example.com", "from": "j.smith@example.com", "subject": "Customer account activation", "custom_message": "", "bcc": []}})); + + const customer = new shopify.rest.Customer({session: session}); + customer.id = 207119551; + await customer.send_invite({ + body: {"customer_invite": {}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customers/207119551/send_invite.json', + query: '', + headers, + data: {"customer_invite": {}} + }).toMatchMadeHttpRequest(); + }); + + it('test_25', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Customer.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_26', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Customer.count({ + session: session, + updated_at_min: "2023-01-02 17:10:34", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/count.json', + query: 'updated_at_min=2023-01-02+17%3A10%3A34', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_27', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Customer.count({ + session: session, + created_at_min: "2023-01-02 17:21:35", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/count.json', + query: 'created_at_min=2023-01-02+17%3A21%3A35', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_28', async () => { + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:17:39-05:00", "updated_at": "2023-01-03T12:17:39-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:17:39-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:17:39-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:17:39-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:17:39-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:17:39-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Customer.orders({ + session: session, + id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/207119551/orders.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_29', async () => { + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:13:09-05:00", "updated_at": "2023-01-03T12:13:09-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:13:09-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:13:09-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:13:09-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:13:09-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:13:09-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Customer.orders({ + session: session, + id: 207119551, + status: "any", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/207119551/orders.json', + query: 'status=any', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/customer_address.test.ts b/rest/admin/__tests__/2023-01/customer_address.test.ts new file mode 100644 index 000000000..b65632f83 --- /dev/null +++ b/rest/admin/__tests__/2023-01/customer_address.test.ts @@ -0,0 +1,216 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('CustomerAddress resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}]})); + + await shopify.rest.CustomerAddress.all({ + session: session, + customer_id: 207119551, + limit: "1", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/207119551/addresses.json', + query: 'limit=1', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}]})); + + await shopify.rest.CustomerAddress.all({ + session: session, + customer_id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/207119551/addresses.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"customer_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + + await shopify.rest.CustomerAddress.find({ + session: session, + customer_id: 207119551, + id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/207119551/addresses/207119551.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"customer_address": {"customer_id": 207119551, "zip": "90210", "country": "United States", "province": "Kentucky", "city": "Louisville", "address1": "Chestnut Street 92", "address2": "", "first_name": null, "last_name": null, "company": null, "phone": "555-625-1199", "id": 207119551, "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + customer_address.id = 207119551; + customer_address.zip = "90210"; + await customer_address.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customers/207119551/addresses/207119551.json', + query: '', + headers, + data: { "address": {"zip": "90210"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"customer_address": {"customer_id": 207119551, "address1": "Apartment 23", "address2": "Chestnut Street 92", "country": "United States", "province": "Kentucky", "zip": "40202", "city": "Louisville", "first_name": null, "last_name": null, "company": null, "phone": "555-625-1199", "id": 207119551, "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + customer_address.id = 207119551; + customer_address.address1 = "Apartment 23"; + customer_address.address2 = "Chestnut Street 92"; + await customer_address.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customers/207119551/addresses/207119551.json', + query: '', + headers, + data: { "address": {"address1": "Apartment 23", "address2": "Chestnut Street 92"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.CustomerAddress.delete({ + session: session, + customer_id: 207119551, + id: 1053317306, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/customers/207119551/addresses/1053317306.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317303, "customer_id": 207119551, "first_name": "Samuel", "last_name": "de Champlain", "company": "Fancy Co.", "address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "phone": "819-555-5555", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada", "default": false}})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + customer_address.address1 = "1 Rue des Carrieres"; + customer_address.address2 = "Suite 1234"; + customer_address.city = "Montreal"; + customer_address.company = "Fancy Co."; + customer_address.first_name = "Samuel"; + customer_address.last_name = "de Champlain"; + customer_address.phone = "819-555-5555"; + customer_address.province = "Quebec"; + customer_address.country = "Canada"; + customer_address.zip = "G1R 4P5"; + customer_address.name = "Samuel de Champlain"; + customer_address.province_code = "QC"; + customer_address.country_code = "CA"; + customer_address.country_name = "Canada"; + await customer_address.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customers/207119551/addresses.json', + query: '', + headers, + data: { "address": {"address1": "1 Rue des Carrieres", "address2": "Suite 1234", "city": "Montreal", "company": "Fancy Co.", "first_name": "Samuel", "last_name": "de Champlain", "phone": "819-555-5555", "province": "Quebec", "country": "Canada", "zip": "G1R 4P5", "name": "Samuel de Champlain", "province_code": "QC", "country_code": "CA", "country_name": "Canada"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + await customer_address.set({ + address_ids: ["1053317305"], + operation: "destroy", + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customers/207119551/addresses/set.json', + query: 'address_ids%5B%5D=1053317305&operation=destroy', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"customer_address": {"id": 1053317304, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}})); + + const customer_address = new shopify.rest.CustomerAddress({session: session}); + customer_address.customer_id = 207119551; + customer_address.id = 1053317304; + await customer_address.default({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customers/207119551/addresses/1053317304/default.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/customer_saved_search.test.ts b/rest/admin/__tests__/2023-01/customer_saved_search.test.ts new file mode 100644 index 000000000..4b01f28c2 --- /dev/null +++ b/rest/admin/__tests__/2023-01/customer_saved_search.test.ts @@ -0,0 +1,211 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('CustomerSavedSearch resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}, {"id": 20610973, "name": "Canadian Snowboarders", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "country:Canada"}, {"id": 669439218, "name": "Premier Customers", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}]})); + + await shopify.rest.CustomerSavedSearch.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customer_saved_searches.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"customer_saved_searches": [{"id": 669439218, "name": "Premier Customers", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "John Smith orders_count:>10 total_spent:>100.00"}, {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}]})); + + await shopify.rest.CustomerSavedSearch.all({ + session: session, + since_id: "20610973", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customer_saved_searches.json', + query: 'since_id=20610973', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136102, "name": "Spent more than $50", "created_at": "2023-01-03T13:07:07-05:00", "updated_at": "2023-01-03T13:07:07-05:00", "query": "total_spent:>50"}})); + + const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); + customer_saved_search.name = "Spent more than $50"; + customer_saved_search.query = "total_spent:>50"; + await customer_saved_search.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customer_saved_searches.json', + query: '', + headers, + data: { "customer_saved_search": {"name": "Spent more than $50", "query": "total_spent:>50"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 1068136103, "name": "Spent more than $50 and after 2013", "created_at": "2023-01-03T13:07:17-05:00", "updated_at": "2023-01-03T13:07:17-05:00", "query": "total_spent:>50 order_date:>=2013-01-01"}})); + + const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); + customer_saved_search.name = "Spent more than $50 and after 2013"; + customer_saved_search.query = "total_spent:>50 order_date:>=2013-01-01"; + await customer_saved_search.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customer_saved_searches.json', + query: '', + headers, + data: { "customer_saved_search": {"name": "Spent more than $50 and after 2013", "query": "total_spent:>50 order_date:>=2013-01-01"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.CustomerSavedSearch.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customer_saved_searches/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.CustomerSavedSearch.count({ + session: session, + since_id: "20610973", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customer_saved_searches/count.json', + query: 'since_id=20610973', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"customer_saved_search": {"id": 789629109, "name": "Accepts Marketing", "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2022-12-27T12:56:35-05:00", "query": "accepts_marketing:1"}})); + + await shopify.rest.CustomerSavedSearch.find({ + session: session, + id: 789629109, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customer_saved_searches/789629109.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"customer_saved_search": {"name": "This Name Has Been Changed", "id": 789629109, "created_at": "2022-12-27T12:56:35-05:00", "updated_at": "2023-01-03T13:06:53-05:00", "query": "accepts_marketing:1"}})); + + const customer_saved_search = new shopify.rest.CustomerSavedSearch({session: session}); + customer_saved_search.id = 789629109; + customer_saved_search.name = "This Name Has Been Changed"; + await customer_saved_search.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customer_saved_searches/789629109.json', + query: '', + headers, + data: { "customer_saved_search": {"name": "This Name Has Been Changed"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.CustomerSavedSearch.delete({ + session: session, + id: 789629109, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/customer_saved_searches/789629109.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"customers": [{"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": true, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:07:04-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "addresses": [{"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}], "accepts_marketing_updated_at": "2023-01-03T13:07:04-05:00", "marketing_opt_in_level": "single_opt_in", "tax_exemptions": [], "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}]})); + + await shopify.rest.CustomerSavedSearch.customers({ + session: session, + id: 789629109, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customer_saved_searches/789629109/customers.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/deprecated_api_call.test.ts b/rest/admin/__tests__/2023-01/deprecated_api_call.test.ts new file mode 100644 index 000000000..0cb5ee842 --- /dev/null +++ b/rest/admin/__tests__/2023-01/deprecated_api_call.test.ts @@ -0,0 +1,50 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('DeprecatedApiCall resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"data_updated_at": "2020-10-13T00:15:30Z", "deprecated_api_calls": [{"api_type": "REST", "description": "The page filter has been removed from multiple endpoints. Use cursor-based pagination instead.", "documentation_url": "https://shopify.dev/api/usage/pagination-rest", "endpoint": "Product", "last_call_at": "2020-06-12T03:46:18Z", "migration_deadline": "2020-07-02T13:00:00Z", "graphql_schema_name": null, "version": "2019-07"}]})); + + await shopify.rest.DeprecatedApiCall.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/deprecated_api_calls.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/discount_code.test.ts b/rest/admin/__tests__/2023-01/discount_code.test.ts new file mode 100644 index 000000000..09d083970 --- /dev/null +++ b/rest/admin/__tests__/2023-01/discount_code.test.ts @@ -0,0 +1,200 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('DiscountCode resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"discount_code": {"id": 1054381139, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:38:34-05:00", "updated_at": "2023-01-03T12:38:34-05:00"}})); + + const discount_code = new shopify.rest.DiscountCode({session: session}); + discount_code.price_rule_id = 507328175; + discount_code.code = "SUMMERSALE10OFF"; + await discount_code.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/price_rules/507328175/discount_codes.json', + query: '', + headers, + data: { "discount_code": {"code": "SUMMERSALE10OFF"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"discount_codes": [{"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}]})); + + await shopify.rest.DiscountCode.all({ + session: session, + price_rule_id: 507328175, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/price_rules/507328175/discount_codes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "WINTERSALE20OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:31-05:00"}})); + + const discount_code = new shopify.rest.DiscountCode({session: session}); + discount_code.price_rule_id = 507328175; + discount_code.id = 507328175; + discount_code.code = "WINTERSALE20OFF"; + await discount_code.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/price_rules/507328175/discount_codes/507328175.json', + query: '', + headers, + data: { "discount_code": {"code": "WINTERSALE20OFF"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"discount_code": {"id": 507328175, "price_rule_id": 507328175, "code": "SUMMERSALE10OFF", "usage_count": 0, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}})); + + await shopify.rest.DiscountCode.find({ + session: session, + price_rule_id: 507328175, + id: 507328175, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/price_rules/507328175/discount_codes/507328175.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.DiscountCode.delete({ + session: session, + price_rule_id: 507328175, + id: 507328175, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/price_rules/507328175/discount_codes/507328175.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.DiscountCode.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/discount_codes/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 989355119, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2023-01-03T12:38:25-05:00", "updated_at": "2023-01-03T12:38:25-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + + const discount_code = new shopify.rest.DiscountCode({session: session}); + discount_code.price_rule_id = 507328175; + await discount_code.batch({ + body: {"discount_codes": [{"code": "SUMMER1"}, {"code": "SUMMER2"}, {"code": "SUMMER3"}]}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/price_rules/507328175/batch.json', + query: '', + headers, + data: {"discount_codes": [{"code": "SUMMER1"}, {"code": "SUMMER2"}, {"code": "SUMMER3"}]} + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"discount_code_creation": {"id": 173232803, "price_rule_id": 507328175, "started_at": null, "completed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "status": "queued", "codes_count": 3, "imported_count": 0, "failed_count": 0, "logs": []}})); + + await shopify.rest.DiscountCode.get_all({ + session: session, + price_rule_id: 507328175, + batch_id: 173232803, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/price_rules/507328175/batch/173232803.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"discount_codes": [{"id": null, "code": "foo", "errors": {}}, {"id": null, "code": "", "errors": {}}, {"id": null, "code": "bar", "errors": {}}]})); + + await shopify.rest.DiscountCode.all({ + session: session, + price_rule_id: 507328175, + batch_id: 173232803, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/price_rules/507328175/batch/173232803/discount_codes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/dispute.test.ts b/rest/admin/__tests__/2023-01/dispute.test.ts new file mode 100644 index 000000000..d05e60840 --- /dev/null +++ b/rest/admin/__tests__/2023-01/dispute.test.ts @@ -0,0 +1,104 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Dispute resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"disputes": [{"id": 1052608616, "order_id": null, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 815713555, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "credit_not_processed", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 782360659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 670893524, "order_id": 625362839, "type": "inquiry", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 598735659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 85190714, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "under_review", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": "2022-10-02T20:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 35982383, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "subscription_canceled", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}]})); + + await shopify.rest.Dispute.all({ + session: session, + initiated_at: "2013-05-03", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shopify_payments/disputes.json', + query: 'initiated_at=2013-05-03', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"disputes": [{"id": 1052608616, "order_id": null, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 815713555, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "credit_not_processed", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 782360659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 670893524, "order_id": 625362839, "type": "inquiry", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 598735659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 85190714, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "under_review", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": "2022-10-02T20:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 35982383, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "subscription_canceled", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}]})); + + await shopify.rest.Dispute.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shopify_payments/disputes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"disputes": [{"id": 1052608616, "order_id": null, "type": "chargeback", "amount": "100.00", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}, {"id": 782360659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "won", "evidence_due_by": "2013-07-03T19:00:00-04:00", "evidence_sent_on": "2013-07-04T07:00:00-04:00", "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}]})); + + await shopify.rest.Dispute.all({ + session: session, + status: "won", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shopify_payments/disputes.json', + query: 'status=won', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"dispute": {"id": 598735659, "order_id": 625362839, "type": "chargeback", "amount": "11.50", "currency": "USD", "reason": "fraudulent", "network_reason_code": "4827", "status": "needs_response", "evidence_due_by": "2022-10-15T20:00:00-04:00", "evidence_sent_on": null, "finalized_on": null, "initiated_at": "2013-05-03T20:00:00-04:00"}})); + + await shopify.rest.Dispute.find({ + session: session, + id: 598735659, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shopify_payments/disputes/598735659.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/draft_order.test.ts b/rest/admin/__tests__/2023-01/draft_order.test.ts new file mode 100644 index 000000000..edf74e360 --- /dev/null +++ b/rest/admin/__tests__/2023-01/draft_order.test.ts @@ -0,0 +1,426 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('DraftOrder resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920479, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:43-05:00", "updated_at": "2023-01-03T12:58:43-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630384, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630384"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/b21e68f2f1e19263509b19a8286d2d09", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "30.00", "subtotal_price": "30.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "30.00", "currency_code": "USD"}, "presentment_money": {"amount": "30.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920479", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "title": "Custom Tee", + "price": "20.00", + "quantity": 2 + } + ]; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "fixed_amount", + "value": "10.0", + "amount": "10.00", + "title": "Custom" + }; + draft_order.customer = { + "id": 207119551 + }; + draft_order.use_customer_default_address = true; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.00", "title": "Custom"}, "customer": {"id": 207119551}, "use_customer_default_address": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920478, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:39-05:00", "updated_at": "2023-01-03T12:58:39-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630383, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "2.00", "value_type": "percentage"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630383"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/d3f9ba3d1a9c83f93adf079a7f05d693", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.90"}, {"rate": 0.08, "title": "Tax", "price": "1.44"}], "tags": "", "note_attributes": [], "total_price": "20.34", "subtotal_price": "18.00", "total_tax": "2.34", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "20.34", "currency_code": "USD"}, "presentment_money": {"amount": "20.34", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "18.00", "currency_code": "USD"}, "presentment_money": {"amount": "18.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "2.34", "currency_code": "USD"}, "presentment_money": {"amount": "2.34", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "2.00", "currency_code": "USD"}, "presentment_money": {"amount": "2.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920478"}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "title": "Custom Tee", + "price": "20.00", + "quantity": 1, + "applied_discount": { + "description": "Custom discount", + "value_type": "percentage", + "value": "10.0", + "amount": "2.0", + "title": "Custom" + } + } + ]; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "2.0", "title": "Custom"}}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920477, "note": null, "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:31-05:00", "updated_at": "2023-01-03T12:58:31-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630382, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 2, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630382"}], "shipping_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": null, "address1": "Chestnut Street 92", "phone": "555-625-1199", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": null, "address2": "", "company": null, "latitude": null, "longitude": null, "name": "", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/17d301f9579f7982e4d1f75dd2b3269c", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "40.00", "subtotal_price": "40.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "40.00", "currency_code": "USD"}, "presentment_money": {"amount": "40.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920477", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "title": "Custom Tee", + "price": "20.00", + "quantity": 2 + } + ]; + draft_order.customer = { + "id": 207119551 + }; + draft_order.use_customer_default_address = true; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 2}], "customer": {"id": 207119551}, "use_customer_default_address": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920475, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:23-05:00", "updated_at": "2023-01-03T12:58:23-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630380, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630380"}], "shipping_address": null, "billing_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/5f465084cd7442780b87241fed885a5e", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920475", "customer": {"id": 1073339480, "email": null, "accepts_marketing": false, "created_at": "2023-01-03T12:58:23-05:00", "updated_at": "2023-01-03T12:58:23-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:58:23-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339480", "default_address": {"id": 1053317317, "customer_id": 1073339480, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + draft_order.billing_address = { + "first_name": "Bob", + "last_name": "Norman", + "address1": "123 Main St", + "city": "Anytown", + "province": "ON", + "country": "Canada", + "zip": "A1B2C3", + "phone": "555-555-5555" + }; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "billing_address": {"first_name": "Bob", "last_name": "Norman", "address1": "123 Main St", "city": "Anytown", "province": "ON", "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920476, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:25-05:00", "updated_at": "2023-01-03T12:58:25-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630381, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630381"}], "shipping_address": {"first_name": "Bob", "address1": "123 Main St", "phone": "555-555-5555", "city": "Anytown", "zip": "A1B2C3", "province": "Ontario", "country": "Canada", "last_name": "Norman", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Bob Norman", "country_code": "CA", "province_code": "ON"}, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/a9d2db17815b237bbc13d6ecd39d8f11", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920476", "customer": {"id": 1073339481, "email": null, "accepts_marketing": false, "created_at": "2023-01-03T12:58:25-05:00", "updated_at": "2023-01-03T12:58:25-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 0, "state": "disabled", "total_spent": "0.00", "last_order_id": null, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": null, "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:58:25-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": null, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339481", "default_address": {"id": 1053317318, "customer_id": 1073339481, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "123 Main St", "address2": null, "city": "Anytown", "province": null, "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555", "name": "Bob Norman", "province_code": null, "country_code": "CA", "country_name": "Canada", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + draft_order.shipping_address = { + "first_name": "Bob", + "last_name": "Norman", + "address1": "123 Main St", + "city": "Anytown", + "province": "ON", + "country": "Canada", + "zip": "A1B2C3", + "phone": "555-555-5555" + }; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "shipping_address": {"first_name": "Bob", "last_name": "Norman", "address1": "123 Main St", "city": "Anytown", "province": "ON", "country": "Canada", "zip": "A1B2C3", "phone": "555-555-5555"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920481, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:56-05:00", "updated_at": "2023-01-03T12:58:56-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630386, "variant_id": null, "product_id": null, "title": "Custom Tee", "variant_title": null, "sku": null, "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "10.00", "value_type": "fixed_amount"}, "name": "Custom Tee", "properties": [], "custom": true, "price": "20.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630386"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/46a7191808bee9d2bb0979533fa3b4b4", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "0.50"}, {"rate": 0.08, "title": "Tax", "price": "0.80"}], "tags": "", "note_attributes": [], "total_price": "11.30", "subtotal_price": "10.00", "total_tax": "1.30", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "20.00", "currency_code": "USD"}, "presentment_money": {"amount": "20.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "11.30", "currency_code": "USD"}, "presentment_money": {"amount": "11.30", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "1.30", "currency_code": "USD"}, "presentment_money": {"amount": "1.30", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920481"}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "title": "Custom Tee", + "price": "20.00", + "quantity": 1, + "applied_discount": { + "description": "Custom discount", + "value_type": "fixed_amount", + "value": "10.0", + "amount": "10.0", + "title": "Custom" + } + } + ]; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"title": "Custom Tee", "price": "20.00", "quantity": 1, "applied_discount": {"description": "Custom discount", "value_type": "fixed_amount", "value": "10.0", "amount": "10.0", "title": "Custom"}}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 1069920480, "note": null, "email": null, "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:58:45-05:00", "updated_at": "2023-01-03T12:58:45-05:00", "tax_exempt": false, "completed_at": null, "name": "#D5", "status": "open", "line_items": [{"id": 1066630385, "variant_id": 447654529, "product_id": 921728736, "title": "IPod Touch 8GB", "variant_title": "Black", "sku": "IPOD2009BLACK", "vendor": "Apple", "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "shipwire-app", "grams": 567, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "applied_discount": null, "name": "IPod Touch 8GB - Black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/1066630385"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/42fb27c2a95082c0217255df38363371", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [{"rate": 0.05, "title": "GST", "price": "9.95"}, {"rate": 0.08, "title": "Tax", "price": "15.92"}], "tags": "", "note_attributes": [], "total_price": "224.87", "subtotal_price": "199.00", "total_tax": "25.87", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "224.87", "currency_code": "USD"}, "presentment_money": {"amount": "224.87", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "25.87", "currency_code": "USD"}, "presentment_money": {"amount": "25.87", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/1069920480"}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await draft_order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders.json', + query: '', + headers, + data: { "draft_order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"draft_orders": [{"id": 72885271, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D4", "status": "completed", "line_items": [{"id": 498266019, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 2, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/498266019"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f945c7e2b158dbb69fa642cb8d79171f", "applied_discount": null, "order_id": 450789469, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/72885271", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 622762746, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D1", "status": "open", "line_items": [{"id": 466157049, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/466157049"}, {"id": 605833968, "variant_id": null, "product_id": null, "title": "IPod Nano Engraving", "variant_title": null, "sku": "IPODENGRAVING", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 0, "tax_lines": [], "applied_discount": null, "name": "IPod Nano Engraving", "properties": [], "custom": true, "price": "30.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/605833968"}, {"id": 783764327, "variant_id": 457924702, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "black", "sku": "IPOD2008BLACK", "vendor": null, "quantity": 3, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - black", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/783764327"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461api", "applied_discount": null, "order_id": null, "shipping_line": {"title": "custom shipping", "custom": true, "handle": null, "price": "10.00"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/622762746", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 691042898, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": true, "currency": "USD", "invoice_sent_at": "2016-12-31T19:00:00-05:00", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": "2016-12-31T19:00:00-05:00", "name": "#D4", "status": "completed", "line_items": [{"id": 158115779, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/158115779"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/56dd92fb7adc1a2c38402b1aab15b2f4", "applied_discount": null, "order_id": 450789469, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "409.94", "subtotal_price": "398.00", "total_tax": "11.94", "admin_graphql_api_id": "gid://shopify/DraftOrder/691042898", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}, {"id": 1012750869, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 294997122, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": true, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/294997122"}], "shipping_address": null, "billing_address": null, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/f1df1a91d10a6d7704cf2f0315461noaddressapi", "applied_discount": null, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "", "note_attributes": [], "total_price": "836.00", "subtotal_price": "826.00", "total_tax": "0.00", "admin_graphql_api_id": "gid://shopify/DraftOrder/1012750869"}]})); + + await shopify.rest.DraftOrder.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/draft_orders.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:49-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "Custom discount", "value": "10.0", "title": "Custom", "amount": "19.90", "value_type": "percentage"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "179.10", "subtotal_price": "179.10", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "179.10", "currency_code": "USD"}, "presentment_money": {"amount": "179.10", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "19.90", "currency_code": "USD"}, "presentment_money": {"amount": "19.90", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + draft_order.applied_discount = { + "description": "Custom discount", + "value_type": "percentage", + "value": "10.0", + "amount": "19.90", + "title": "Custom" + }; + await draft_order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/draft_orders/994118539.json', + query: '', + headers, + data: { "draft_order": {"applied_discount": {"description": "Custom discount", "value_type": "percentage", "value": "10.0", "amount": "19.90", "title": "Custom"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "Customer contacted us about a custom engraving on this iPod", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:47-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": null, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "194.00", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + draft_order.note = "Customer contacted us about a custom engraving on this iPod"; + await draft_order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/draft_orders/994118539.json', + query: '', + headers, + data: { "draft_order": {"note": "Customer contacted us about a custom engraving on this iPod"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "tax_exempt": false, "completed_at": null, "name": "#D2", "status": "open", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": null, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + await shopify.rest.DraftOrder.find({ + session: session, + id: 994118539, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/draft_orders/994118539.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.DraftOrder.delete({ + session: session, + id: 994118539, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/draft_orders/994118539.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"count": 5})); + + await shopify.rest.DraftOrder.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/draft_orders/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!", "bcc": ["j.smith@example.com"]}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + await draft_order.send_invoice({ + body: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders/994118539/send_invoice.json', + query: '', + headers, + data: {"draft_order_invoice": {"to": "first@example.com", "from": "j.smith@example.com", "bcc": ["j.smith@example.com"], "subject": "Apple Computer Invoice", "custom_message": "Thank you for ordering!"}} + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"draft_order_invoice": {"to": "bob.norman@mail.example.com", "from": "j.smith@example.com", "subject": "Draft Order #D2", "custom_message": "", "bcc": []}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + await draft_order.send_invoice({ + body: {"draft_order_invoice": {}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders/994118539/send_invoice.json', + query: '', + headers, + data: {"draft_order_invoice": {}} + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:20-05:00", "tax_exempt": false, "completed_at": "2023-01-03T12:58:20-05:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459975, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:20-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 2, "state": "disabled", "total_spent": "405.90", "last_order_id": 1073459975, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1002", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317316, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + await draft_order.complete({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/draft_orders/994118539/complete.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({"draft_order": {"id": 994118539, "note": "rush order", "email": "bob.norman@mail.example.com", "taxes_included": false, "currency": "USD", "invoice_sent_at": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:36-05:00", "tax_exempt": false, "completed_at": "2023-01-03T12:58:36-05:00", "name": "#D2", "status": "completed", "line_items": [{"id": 994118539, "variant_id": 39072856, "product_id": 632910392, "title": "IPod Nano - 8gb", "variant_title": "green", "sku": "IPOD2008GREEN", "vendor": null, "quantity": 1, "requires_shipping": false, "taxable": true, "gift_card": false, "fulfillment_service": "manual", "grams": 567, "tax_lines": [], "applied_discount": null, "name": "IPod Nano - 8gb - green", "properties": [], "custom": false, "price": "199.00", "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f", "applied_discount": {"description": "$5promo", "value": "5.0", "title": null, "amount": "5.00", "value_type": "fixed_amount"}, "order_id": 1073459976, "shipping_line": {"title": "UPS Ground", "custom": false, "handle": "ups-3-12.25", "price": "12.25"}, "tax_lines": [], "tags": "Wholesale", "note_attributes": [], "total_price": "206.25", "subtotal_price": "194.00", "total_tax": "0.00", "presentment_currency": "USD", "total_line_items_price_set": {"shop_money": {"amount": "826.00", "currency_code": "USD"}, "presentment_money": {"amount": "826.00", "currency_code": "USD"}}, "total_price_set": {"shop_money": {"amount": "206.25", "currency_code": "USD"}, "presentment_money": {"amount": "206.25", "currency_code": "USD"}}, "subtotal_price_set": {"shop_money": {"amount": "194.00", "currency_code": "USD"}, "presentment_money": {"amount": "194.00", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_discounts_set": {"shop_money": {"amount": "5.00", "currency_code": "USD"}, "presentment_money": {"amount": "5.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "12.25", "currency_code": "USD"}, "presentment_money": {"amount": "12.25", "currency_code": "USD"}}, "payment_terms": null, "admin_graphql_api_id": "gid://shopify/DraftOrder/994118539", "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:58:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 2, "state": "disabled", "total_spent": "405.90", "last_order_id": 1073459976, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1002", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:56:35-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 1053317319, "customer_id": 207119551, "first_name": "Bob", "last_name": "Norman", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "+1(502)-459-2181", "name": "Bob Norman", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}}})); + + const draft_order = new shopify.rest.DraftOrder({session: session}); + draft_order.id = 994118539; + await draft_order.complete({ + payment_pending: "true", + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/draft_orders/994118539/complete.json', + query: 'payment_pending=true', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/event.test.ts b/rest/admin/__tests__/2023-01/event.test.ts new file mode 100644 index 000000000..81d2b37b3 --- /dev/null +++ b/rest/admin/__tests__/2023-01/event.test.ts @@ -0,0 +1,232 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Event resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"events": [{"id": 164748010, "subject_id": 450789469, "created_at": "2008-01-10T06:00:00-05:00", "subject_type": "Order", "verb": "confirmed", "arguments": ["#1001", "Bob Norman"], "body": null, "message": "Received new order #1001 by Bob Norman.", "author": "Shopify", "description": "Received new order #1001 by Bob Norman.", "path": "/admin/orders/450789469"}, {"id": 365755215, "subject_id": 632910392, "created_at": "2008-01-10T07:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Nano - 8GB"], "body": null, "message": "Product was created: IPod Nano - 8GB.", "author": "Shopify", "description": "Product was created: IPod Nano - 8GB.", "path": "/admin/products/632910392"}, {"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"events": [{"id": 103105390, "subject_id": 450789469, "created_at": "2008-01-10T05:00:00-05:00", "subject_type": "Order", "verb": "authorization_success", "arguments": ["389404469", "210.94", "USD"], "body": null, "message": "A transaction was authorized.", "author": "Shopify", "description": "A transaction was authorized.", "path": "/admin/orders/450789469"}, {"id": 164748010, "subject_id": 450789469, "created_at": "2008-01-10T06:00:00-05:00", "subject_type": "Order", "verb": "confirmed", "arguments": ["#1001", "Bob Norman"], "body": null, "message": "Received new order #1001 by Bob Norman.", "author": "Shopify", "description": "Received new order #1001 by Bob Norman.", "path": "/admin/orders/450789469"}, {"id": 852065041, "subject_id": 450789469, "created_at": "2008-01-10T09:00:00-05:00", "subject_type": "Order", "verb": "placed", "arguments": [], "body": null, "message": "This order was created for Bob Norman from draft order #D4.", "author": "Shopify", "description": "This order was created for Bob Norman from draft order #D4.", "path": "/admin/orders/450789469"}]})); + + await shopify.rest.Event.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"events": [{"id": 164748010, "subject_id": 450789469, "created_at": "2008-01-10T06:00:00-05:00", "subject_type": "Order", "verb": "confirmed", "arguments": ["#1001", "Bob Norman"], "body": null, "message": "Received new order #1001 by Bob Norman.", "author": "Shopify", "description": "Received new order #1001 by Bob Norman.", "path": "/admin/orders/450789469"}, {"id": 365755215, "subject_id": 632910392, "created_at": "2008-01-10T07:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Nano - 8GB"], "body": null, "message": "Product was created: IPod Nano - 8GB.", "author": "Shopify", "description": "Product was created: IPod Nano - 8GB.", "path": "/admin/products/632910392"}, {"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + filter: "Product,Order", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/events.json', + query: 'filter=Product%2COrder', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"events": []})); + + await shopify.rest.Event.all({ + session: session, + filter: "Product", + verb: "destroy", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/events.json', + query: 'filter=Product&verb=destroy', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"events": [{"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + created_at_min: "2008-01-10 12:30:00+00:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/events.json', + query: 'created_at_min=2008-01-10+12%3A30%3A00%2B00%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"events": [{"id": 365755215, "subject_id": 632910392, "created_at": "2008-01-10T07:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Nano - 8GB"], "body": null, "message": "Product was created: IPod Nano - 8GB.", "author": "Shopify", "description": "Product was created: IPod Nano - 8GB.", "path": "/admin/products/632910392"}, {"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + since_id: "164748010", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/events.json', + query: 'since_id=164748010', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"events": [{"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}]})); + + await shopify.rest.Event.all({ + session: session, + product_id: 921728736, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/921728736/events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"events": [{"id": 852065041, "subject_id": 450789469, "created_at": "2008-01-10T09:00:00-05:00", "subject_type": "Order", "verb": "placed", "arguments": [], "body": null, "message": "This order was created for Bob Norman from draft order #D4.", "author": "Shopify", "description": "This order was created for Bob Norman from draft order #D4.", "path": "/admin/orders/450789469"}]})); + + await shopify.rest.Event.all({ + session: session, + order_id: 450789469, + limit: "1", + since_id: "164748010", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/events.json', + query: 'limit=1&since_id=164748010', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"event": {"id": 677313116, "subject_id": 921728736, "created_at": "2008-01-10T08:00:00-05:00", "subject_type": "Product", "verb": "create", "arguments": ["IPod Touch 8GB"], "body": null, "message": "Product was created: IPod Touch 8GB.", "author": "Shopify", "description": "Product was created: IPod Touch 8GB.", "path": "/admin/products/921728736"}})); + + await shopify.rest.Event.find({ + session: session, + id: 677313116, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/events/677313116.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Event.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/events/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Event.count({ + session: session, + created_at_min: "2008-01-10T13:00:00+00:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/events/count.json', + query: 'created_at_min=2008-01-10T13%3A00%3A00%2B00%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/fulfillment.test.ts b/rest/admin/__tests__/2023-01/fulfillment.test.ts new file mode 100644 index 000000000..7e5f87414 --- /dev/null +++ b/rest/admin/__tests__/2023-01/fulfillment.test.ts @@ -0,0 +1,223 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Fulfillment resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 0, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}]})); + + await shopify.rest.Fulfillment.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/fulfillments.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019883, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:29:45-05:00", "service": "shipwire-app", "updated_at": "2023-01-03T12:29:45-05:00", "tracking_company": "TNT", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "shipwire-app", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shipwire-app", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "duties": [], "tax_lines": [{"price": "3.98", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "123456789", "tracking_numbers": ["123456789"], "tracking_url": "https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789", "tracking_urls": ["https://www.tnt.com/express/en_us/site/tracking.html?searchType=con&cons=123456789"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019883"}]})); + + await shopify.rest.Fulfillment.all({ + session: session, + order_id: 450789469, + since_id: "255858046", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/fulfillments.json', + query: 'since_id=255858046', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"fulfillments": [{"id": 1069019874, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "UPS", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823194, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823194", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019874"}]})); + + await shopify.rest.Fulfillment.all({ + session: session, + fulfillment_order_id: 1046000790, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000790/fulfillments.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Fulfillment.count({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/fulfillments/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"fulfillment": {"id": 255858046, "order_id": 450789469, "status": "failure", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:21:36-05:00", "tracking_company": "USPS", "shipment_status": null, "location_id": 655441491, "origin_address": null, "line_items": [{"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}], "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "receipt": {"testcase": true, "authorization": "123456"}, "name": "#1001.0", "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046"}})); + + await shopify.rest.Fulfillment.find({ + session: session, + order_id: 450789469, + id: 255858046, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/fulfillments/255858046.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019869, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:52-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:52-05:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823189, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823189", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019869"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.message = "The package was shipped this morning."; + fulfillment.notify_customer = false; + fulfillment.tracking_info = { + "number": 1562678, + "url": "https://www.my-shipping-company.com", + "company": "my-shipping-company" + }; + fulfillment.line_items_by_fulfillment_order = [ + { + "fulfillment_order_id": 1046000785, + "fulfillment_order_line_items": [ + { + "id": 1058737495, + "quantity": 1 + } + ] + } + ]; + await fulfillment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillments.json', + query: '', + headers, + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000785, "fulfillment_order_line_items": [{"id": 1058737495, "quantity": 1}]}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"fulfillment": {"id": 1069019865, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:28:37-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:37-05:00", "tracking_company": "my-shipping-company", "shipment_status": null, "location_id": 24826418, "line_items": [{"id": 1071823187, "variant_id": 389013007, "title": "Crafty Shoes - Red", "quantity": 1, "sku": "crappy_shoes_red", "variant_title": "Small", "vendor": null, "fulfillment_service": "manual", "product_id": 910489600, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Crafty Shoes - Red - Small", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 0, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823187", "tax_lines": []}], "tracking_number": "1562678", "tracking_numbers": ["1562678"], "tracking_url": "https://www.my-shipping-company.com", "tracking_urls": ["https://www.my-shipping-company.com"], "receipt": {}, "name": "#1001.2", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019865"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.message = "The package was shipped this morning."; + fulfillment.notify_customer = false; + fulfillment.tracking_info = { + "number": 1562678, + "url": "https://www.my-shipping-company.com", + "company": "my-shipping-company" + }; + fulfillment.line_items_by_fulfillment_order = [ + { + "fulfillment_order_id": 1046000780 + } + ]; + await fulfillment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillments.json', + query: '', + headers, + data: { "fulfillment": {"message": "The package was shipped this morning.", "notify_customer": false, "tracking_info": {"number": 1562678, "url": "https://www.my-shipping-company.com", "company": "my-shipping-company"}, "line_items_by_fulfillment_order": [{"fulfillment_order_id": 1046000780}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"fulfillment": {"tracking_company": "my-company", "location_id": 24826418, "id": 1069019871, "order_id": 450789469, "status": "success", "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:57-05:00", "shipment_status": null, "line_items": [{"id": 1071823192, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823192", "tax_lines": []}], "tracking_number": "1111", "tracking_numbers": ["1111"], "tracking_url": "http://www.my-url.com", "tracking_urls": ["http://www.my-url.com"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019871"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.id = 1069019871; + await fulfillment.update_tracking({ + body: {"fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com", "company": "my-company"}}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillments/1069019871/update_tracking.json', + query: '', + headers, + data: { "fulfillment": {"notify_customer": true, "tracking_info": {"number": "1111", "url": "http://www.my-url.com", "company": "my-company"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"fulfillment": {"order_id": 450789469, "status": "cancelled", "location_id": 24826418, "id": 1069019870, "created_at": "2023-01-03T12:21:36-05:00", "service": "manual", "updated_at": "2023-01-03T12:28:54-05:00", "tracking_company": "UPS", "shipment_status": null, "line_items": [{"id": 1071823190, "variant_id": 43729076, "title": "Draft", "quantity": 1, "sku": "draft-151", "variant_title": "151cm", "vendor": null, "fulfillment_service": "manual", "product_id": 108828309, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "Draft - 151cm", "variant_inventory_management": null, "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 0, "price": "10.00", "total_discount": "0.00", "fulfillment_status": "fulfilled", "price_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/1071823190", "tax_lines": []}], "tracking_number": "#\u26201\u2622\n---\n4321\n", "tracking_numbers": ["#\u26201\u2622\n---\n4321\n"], "tracking_url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321", "tracking_urls": ["https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=#\u26201\u2622---4321"], "receipt": {}, "name": "#1001.1", "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019870"}})); + + const fulfillment = new shopify.rest.Fulfillment({session: session}); + fulfillment.id = 1069019870; + await fulfillment.cancel({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillments/1069019870/cancel.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/fulfillment_event.test.ts b/rest/admin/__tests__/2023-01/fulfillment_event.test.ts new file mode 100644 index 000000000..71837f96a --- /dev/null +++ b/rest/admin/__tests__/2023-01/fulfillment_event.test.ts @@ -0,0 +1,111 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('FulfillmentEvent resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"fulfillment_events": [{"id": 944956391, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:58:57-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:58:57-05:00", "updated_at": "2023-01-03T12:58:57-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956391"}]})); + + await shopify.rest.FulfillmentEvent.all({ + session: session, + order_id: 450789469, + fulfillment_id: 255858046, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/fulfillments/255858046/events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956392, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:59:00-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:59:00-05:00", "updated_at": "2023-01-03T12:59:00-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956392"}})); + + const fulfillment_event = new shopify.rest.FulfillmentEvent({session: session}); + fulfillment_event.order_id = 450789469; + fulfillment_event.fulfillment_id = 255858046; + fulfillment_event.status = "in_transit"; + await fulfillment_event.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/fulfillments/255858046/events.json', + query: '', + headers, + data: { "event": {"status": "in_transit"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"fulfillment_event": {"id": 944956393, "fulfillment_id": 255858046, "status": "in_transit", "message": null, "happened_at": "2023-01-03T12:59:00-05:00", "city": null, "province": null, "country": null, "zip": null, "address1": null, "latitude": null, "longitude": null, "shop_id": 548380009, "created_at": "2023-01-03T12:59:00-05:00", "updated_at": "2023-01-03T12:59:00-05:00", "estimated_delivery_at": null, "order_id": 450789469, "admin_graphql_api_id": "gid://shopify/FulfillmentEvent/944956393"}})); + + await shopify.rest.FulfillmentEvent.find({ + session: session, + order_id: 450789469, + fulfillment_id: 255858046, + id: 944956393, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/fulfillments/255858046/events/944956393.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.FulfillmentEvent.delete({ + session: session, + order_id: 450789469, + fulfillment_id: 255858046, + id: 944956394, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/orders/450789469/fulfillments/255858046/events/944956394.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/fulfillment_order.test.ts b/rest/admin/__tests__/2023-01/fulfillment_order.test.ts new file mode 100644 index 000000000..af968dd67 --- /dev/null +++ b/rest/admin/__tests__/2023-01/fulfillment_order.test.ts @@ -0,0 +1,215 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('FulfillmentOrder resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"fulfillment_orders": [{"id": 1046000823, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000815, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737562, "shop_id": 548380009, "fulfillment_order_id": 1046000823, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}]})); + + await shopify.rest.FulfillmentOrder.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/fulfillment_orders.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000825, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000817, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737564, "shop_id": 548380009, "fulfillment_order_id": 1046000825, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + await shopify.rest.FulfillmentOrder.find({ + session: session, + id: 1046000825, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000825.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000815, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000807, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "replacement_fulfillment_order": {"id": 1046000816, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000808, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737555, "shop_id": 548380009, "fulfillment_order_id": 1046000816, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000815; + await fulfillment_order.cancel({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000815/cancel.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000819, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "closed", "status": "incomplete", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000811, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737558, "shop_id": 548380009, "fulfillment_order_id": 1046000819, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000819; + await fulfillment_order.close({ + body: {"fulfillment_order": {"message": "Not enough inventory to complete this work."}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000819/close.json', + query: '', + headers, + data: { "fulfillment_order": {"message": "Not enough inventory to complete this work."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000821, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 487838322, "request_status": "submitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000813, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737560, "shop_id": 548380009, "fulfillment_order_id": 1046000821, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}, "moved_fulfillment_order": {"id": 1046000822, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 655441491, "request_status": "unsubmitted", "status": "open", "supported_actions": ["create_fulfillment", "move"], "destination": {"id": 1046000814, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737561, "shop_id": 548380009, "fulfillment_order_id": 1046000822, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "manual", "assigned_location": {"address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "country_code": "CA", "location_id": 655441491, "name": "50 Rideau Street", "phone": null, "province": "Ontario", "zip": "K1N 9J7"}, "merchant_requests": []}, "remaining_fulfillment_order": null})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000821; + await fulfillment_order.move({ + body: {"fulfillment_order": {"new_location_id": 655441491}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000821/move.json', + query: '', + headers, + data: { "fulfillment_order": {"new_location_id": 655441491} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000828, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000820, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737567, "shop_id": 548380009, "fulfillment_order_id": 1046000828, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000828; + await fulfillment_order.open({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000828/open.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000824, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "scheduled", "supported_actions": ["mark_as_open"], "destination": {"id": 1046000816, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737563, "shop_id": 548380009, "fulfillment_order_id": 1046000824, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfillment_service_handle": "mars-fulfillment", "fulfill_at": "2024-02-03T12:57:00-05:00", "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000824; + await fulfillment_order.reschedule({ + body: {"fulfillment_order": {"new_fulfill_at": "2024-02-03 17:57 UTC"}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000824/reschedule.json', + query: '', + headers, + data: { "fulfillment_order": {"new_fulfill_at": "2024-02-03 17:57 UTC"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000826, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "on_hold", "supported_actions": ["release_hold"], "destination": {"id": 1046000818, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737565, "shop_id": 548380009, "fulfillment_order_id": 1046000826, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [{"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000826; + await fulfillment_order.hold({ + body: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000826/hold.json', + query: '', + headers, + data: {"fulfillment_hold": {"reason": "inventory_out_of_stock", "reason_notes": "Not enough inventory to complete this work."}} + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + + await fulfillment_order.set_fulfillment_orders_deadline({ + body: {"fulfillment_order_ids": [1046000818], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/set_fulfillment_orders_deadline.json', + query: '', + headers, + data: {"fulfillment_order_ids": [1046000818], "fulfillment_deadline": "2021-05-26T10:00:00-04:00"} + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000820, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000812, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "line_items": [{"id": 1058737559, "shop_id": 548380009, "fulfillment_order_id": 1046000820, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "fulfill_at": null, "international_duties": {"incoterm": "DAP"}, "fulfillment_holds": [], "delivery_method": null, "assigned_location": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "merchant_requests": []}})); + + const fulfillment_order = new shopify.rest.FulfillmentOrder({session: session}); + fulfillment_order.id = 1046000820; + await fulfillment_order.release_hold({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000820/release_hold.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/fulfillment_request.test.ts b/rest/admin/__tests__/2023-01/fulfillment_request.test.ts new file mode 100644 index 000000000..8efec16bb --- /dev/null +++ b/rest/admin/__tests__/2023-01/fulfillment_request.test.ts @@ -0,0 +1,117 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('FulfillmentRequest resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000809, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000801, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737541, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:15-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000809, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000801, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737540, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737541, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737542, "shop_id": 548380009, "fulfillment_order_id": 1046000809, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:15-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": null})); + + const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); + fulfillment_request.fulfillment_order_id = 1046000809; + fulfillment_request.message = "Fulfill this ASAP please."; + await fulfillment_request.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000809/fulfillment_request.json', + query: '', + headers, + data: { "fulfillment_request": {"message": "Fulfill this ASAP please."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"original_fulfillment_order": {"id": 1046000812, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "closed", "supported_actions": [], "destination": {"id": 1046000804, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737549, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737550, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737551, "shop_id": 548380009, "fulfillment_order_id": 1046000812, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}, "submitted_fulfillment_order": {"id": 1046000813, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "submitted", "status": "open", "supported_actions": ["cancel_fulfillment_order"], "destination": {"id": 1046000805, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737552, "shop_id": 548380009, "fulfillment_order_id": 1046000813, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737553, "shop_id": 548380009, "fulfillment_order_id": 1046000813, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}], "outgoing_requests": [{"message": "Fulfill this ASAP please.", "request_options": {"notify_customer": false}, "sent_at": "2023-01-03T12:55:27-05:00", "kind": "fulfillment_request"}], "fulfillment_service_handle": "shipwire-app"}, "unsubmitted_fulfillment_order": {"id": 1046000814, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "unsubmitted", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000806, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737554, "shop_id": 548380009, "fulfillment_order_id": 1046000814, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + + const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); + fulfillment_request.fulfillment_order_id = 1046000812; + fulfillment_request.message = "Fulfill this ASAP please."; + fulfillment_request.fulfillment_order_line_items = [ + { + "id": 1058737549, + "quantity": 1 + }, + { + "id": 1058737550, + "quantity": 1 + } + ]; + await fulfillment_request.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000812/fulfillment_request.json', + query: '', + headers, + data: { "fulfillment_request": {"message": "Fulfill this ASAP please.", "fulfillment_order_line_items": [{"id": 1058737549, "quantity": 1}, {"id": 1058737550, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000810, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "accepted", "status": "in_progress", "supported_actions": ["request_cancellation", "create_fulfillment"], "destination": {"id": 1046000802, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737543, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737544, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737545, "shop_id": 548380009, "fulfillment_order_id": 1046000810, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + + const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); + fulfillment_request.fulfillment_order_id = 1046000810; + await fulfillment_request.accept({ + body: {"fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000810/fulfillment_request/accept.json', + query: '', + headers, + data: { "fulfillment_request": {"message": "We will start processing your fulfillment on the next business day."} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"fulfillment_order": {"id": 1046000811, "shop_id": 548380009, "order_id": 450789469, "assigned_location_id": 24826418, "request_status": "rejected", "status": "open", "supported_actions": ["request_fulfillment", "create_fulfillment"], "destination": {"id": 1046000803, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "company": null, "country": "United States", "email": "bob.norman@mail.example.com", "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "province": "Kentucky", "zip": "40202"}, "origin": {"address1": null, "address2": null, "city": null, "country_code": "DE", "location_id": 24826418, "name": "Apple Api Shipwire", "phone": null, "province": null, "zip": null}, "line_items": [{"id": 1058737546, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 466157049, "inventory_item_id": 39072856, "fulfillable_quantity": 1, "variant_id": 39072856}, {"id": 1058737547, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 518995019, "inventory_item_id": 49148385, "fulfillable_quantity": 1, "variant_id": 49148385}, {"id": 1058737548, "shop_id": 548380009, "fulfillment_order_id": 1046000811, "quantity": 1, "line_item_id": 703073504, "inventory_item_id": 457924702, "fulfillable_quantity": 1, "variant_id": 457924702}], "outgoing_requests": [], "fulfillment_service_handle": "shipwire-app"}})); + + const fulfillment_request = new shopify.rest.FulfillmentRequest({session: session}); + fulfillment_request.fulfillment_order_id = 1046000811; + await fulfillment_request.reject({ + body: {"fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737546, "message": "Not enough inventory."}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000811/fulfillment_request/reject.json', + query: '', + headers, + data: { "fulfillment_request": {"message": "Not enough inventory on hand to complete the work.", "reason": "inventory_out_of_stock", "line_items": [{"fulfillment_order_line_item_id": 1058737546, "message": "Not enough inventory."}]} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/fulfillment_service.test.ts b/rest/admin/__tests__/2023-01/fulfillment_service.test.ts new file mode 100644 index 000000000..670b9ed30 --- /dev/null +++ b/rest/admin/__tests__/2023-01/fulfillment_service.test.ts @@ -0,0 +1,146 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('FulfillmentService resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"fulfillment_services": [{"id": 611870435, "name": "Venus Fulfillment", "email": null, "service_name": "Venus Fulfillment", "handle": "venus-fulfillment", "fulfillment_orders_opt_in": false, "include_pending_stock": false, "provider_id": null, "location_id": 611870435, "callback_url": null, "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/611870435"}, {"id": 755357713, "name": "Mars Fulfillment", "email": null, "service_name": "Mars Fulfillment", "handle": "mars-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 24826418, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/755357713"}]})); + + await shopify.rest.FulfillmentService.all({ + session: session, + scope: "all", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/fulfillment_services.json', + query: 'scope=all', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"fulfillment_services": [{"id": 755357713, "name": "Mars Fulfillment", "email": null, "service_name": "Mars Fulfillment", "handle": "mars-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 24826418, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/755357713"}]})); + + await shopify.rest.FulfillmentService.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/fulfillment_services.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 1061774488, "name": "Jupiter Fulfillment", "email": null, "service_name": "Jupiter Fulfillment", "handle": "jupiter-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 1072404543, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/1061774488", "permits_sku_sharing": true}})); + + const fulfillment_service = new shopify.rest.FulfillmentService({session: session}); + fulfillment_service.name = "Jupiter Fulfillment"; + fulfillment_service.callback_url = "http://google.com"; + fulfillment_service.inventory_management = true; + fulfillment_service.tracking_support = true; + fulfillment_service.requires_shipping_method = true; + fulfillment_service.format = "json"; + fulfillment_service.permits_sku_sharing = true; + fulfillment_service.fulfillment_orders_opt_in = true; + await fulfillment_service.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/fulfillment_services.json', + query: '', + headers, + data: { "fulfillment_service": {"name": "Jupiter Fulfillment", "callback_url": "http://google.com", "inventory_management": true, "tracking_support": true, "requires_shipping_method": true, "format": "json", "permits_sku_sharing": true, "fulfillment_orders_opt_in": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 755357713, "name": "Mars Fulfillment", "email": null, "service_name": "Mars Fulfillment", "handle": "mars-fulfillment", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 24826418, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/755357713"}})); + + await shopify.rest.FulfillmentService.find({ + session: session, + id: 755357713, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/fulfillment_services/755357713.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"fulfillment_service": {"id": 755357713, "name": "New Fulfillment Service Name", "email": null, "service_name": "New Fulfillment Service Name", "handle": "new-fulfillment-service-name", "fulfillment_orders_opt_in": true, "include_pending_stock": false, "provider_id": null, "location_id": 24826418, "callback_url": "http://google.com/", "tracking_support": true, "inventory_management": true, "admin_graphql_api_id": "gid://shopify/ApiFulfillmentService/755357713"}})); + + const fulfillment_service = new shopify.rest.FulfillmentService({session: session}); + fulfillment_service.id = 755357713; + fulfillment_service.name = "New Fulfillment Service Name"; + await fulfillment_service.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/fulfillment_services/755357713.json', + query: '', + headers, + data: { "fulfillment_service": {"name": "New Fulfillment Service Name"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.FulfillmentService.delete({ + session: session, + id: 755357713, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/fulfillment_services/755357713.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/gift_card.test.ts b/rest/admin/__tests__/2023-01/gift_card.test.ts new file mode 100644 index 000000000..43d851933 --- /dev/null +++ b/rest/admin/__tests__/2023-01/gift_card.test.ts @@ -0,0 +1,231 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('GiftCard resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 766118925, "balance": "25.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2022-01-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); + + await shopify.rest.GiftCard.all({ + session: session, + status: "enabled", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/gift_cards.json', + query: 'status=enabled', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1035197676, "balance": "100.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}, {"id": 766118925, "balance": "25.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": "2022-01-03", "template_suffix": null, "last_characters": "0e0e", "order_id": null}, {"id": 10274553, "balance": "0.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "50.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0y0y", "order_id": null}]})); + + await shopify.rest.GiftCard.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/gift_cards.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"id": 1035197676, "balance": "100.00", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "0d0d", "order_id": null}})); + + await shopify.rest.GiftCard.find({ + session: session, + id: 1035197676, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"expires_on": "2020-01-01", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:02-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "last_characters": "0d0d", "order_id": null}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.id = 1035197676; + gift_card.expires_on = "2020-01-01"; + await gift_card.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676.json', + query: '', + headers, + data: { "gift_card": {"expires_on": "2020-01-01"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"note": "Updating with a new note", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:10-05:00", "currency": "USD", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.id = 1035197676; + gift_card.note = "Updating with a new note"; + await gift_card.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676.json', + query: '', + headers, + data: { "gift_card": {"note": "Updating with a new note"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.GiftCard.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/gift_cards/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.GiftCard.count({ + session: session, + status: "enabled", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/gift_cards/count.json', + query: 'status=enabled', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936318, "balance": "100.00", "created_at": "2023-01-03T12:30:11-05:00", "updated_at": "2023-01-03T12:30:11-05:00", "currency": "USD", "initial_value": "100.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": "This is a note", "expires_on": null, "template_suffix": "gift_cards.birthday.liquid", "last_characters": "mnop", "order_id": null, "code": "abcdefghijklmnop"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.note = "This is a note"; + gift_card.initial_value = 100.0; + gift_card.code = "ABCD EFGH IJKL MNOP"; + gift_card.template_suffix = "gift_cards.birthday.liquid"; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"note": "This is a note", "initial_value": 100.0, "code": "ABCD EFGH IJKL MNOP", "template_suffix": "gift_cards.birthday.liquid"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"id": 1063936317, "balance": "25.00", "created_at": "2023-01-03T12:30:08-05:00", "updated_at": "2023-01-03T12:30:08-05:00", "currency": "USD", "initial_value": "25.00", "disabled_at": null, "line_item_id": null, "api_client_id": 755357713, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "fc53", "order_id": null, "code": "58he9ffdhhc4fc53"}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.initial_value = 25.0; + await gift_card.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/gift_cards.json', + query: '', + headers, + data: { "gift_card": {"initial_value": 25.0} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"gift_card": {"disabled_at": "2023-01-03T12:30:07-05:00", "template_suffix": null, "initial_value": "100.00", "balance": "100.00", "customer_id": null, "id": 1035197676, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:30:07-05:00", "currency": "USD", "line_item_id": null, "api_client_id": null, "user_id": null, "note": null, "expires_on": null, "last_characters": "0d0d", "order_id": null}})); + + const gift_card = new shopify.rest.GiftCard({session: session}); + gift_card.id = 1035197676; + await gift_card.disable({ + body: {"gift_card": {"id": 1035197676}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676/disable.json', + query: '', + headers, + data: { "gift_card": {"id": 1035197676} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"gift_cards": [{"id": 1063936316, "balance": "10.00", "created_at": "2023-01-03T12:30:02-05:00", "updated_at": "2023-01-03T12:30:02-05:00", "currency": "USD", "initial_value": "10.00", "disabled_at": null, "line_item_id": null, "api_client_id": null, "user_id": null, "customer_id": null, "note": null, "expires_on": null, "template_suffix": null, "last_characters": "mnop", "order_id": null}]})); + + await shopify.rest.GiftCard.search({ + session: session, + query: "last_characters:mnop", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/gift_cards/search.json', + query: 'query=last_characters%3Amnop', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/gift_card_adjustment.test.ts b/rest/admin/__tests__/2023-01/gift_card_adjustment.test.ts new file mode 100644 index 000000000..a2b056271 --- /dev/null +++ b/rest/admin/__tests__/2023-01/gift_card_adjustment.test.ts @@ -0,0 +1,147 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('GiftCardAdjustment resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"adjustments": [{"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}]})); + + await shopify.rest.GiftCardAdjustment.all({ + session: session, + gift_card_id: 1035197676, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273912, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2023-01-03T12:44:55-05:00", "created_at": "2023-01-03T12:44:55-05:00", "updated_at": "2023-01-03T12:44:55-05:00", "note": null, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"}})); + + const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); + gift_card_adjustment.gift_card_id = 1035197676; + gift_card_adjustment.amount = 10.0; + gift_card_adjustment.remote_transaction_ref = "gift_card_app_transaction_193402"; + gift_card_adjustment.remote_transaction_url = "http://example.com/my-gift-card-app/gift_card_adjustments/193402"; + await gift_card_adjustment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: { "adjustment": {"amount": 10.0, "remote_transaction_ref": "gift_card_app_transaction_193402", "remote_transaction_url": "http://example.com/my-gift-card-app/gift_card_adjustments/193402"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273911, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2023-01-03T12:44:54-05:00", "created_at": "2023-01-03T12:44:54-05:00", "updated_at": "2023-01-03T12:44:54-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + + const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); + gift_card_adjustment.gift_card_id = 1035197676; + gift_card_adjustment.amount = 10.0; + gift_card_adjustment.note = "Customer refilled gift card by $10"; + await gift_card_adjustment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: { "adjustment": {"amount": 10.0, "note": "Customer refilled gift card by $10"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273913, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "-20.00", "processed_at": "2023-01-03T12:44:57-05:00", "created_at": "2023-01-03T12:44:57-05:00", "updated_at": "2023-01-03T12:44:57-05:00", "note": "Customer spent $20 via external service", "remote_transaction_ref": null, "remote_transaction_url": null}})); + + const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); + gift_card_adjustment.gift_card_id = 1035197676; + gift_card_adjustment.amount = -20.0; + gift_card_adjustment.note = "Customer spent $20 via external service"; + await gift_card_adjustment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: { "adjustment": {"amount": -20.0, "note": "Customer spent $20 via external service"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273910, "gift_card_id": 1035197676, "api_client_id": 755357713, "user_id": null, "order_transaction_id": null, "number": 1, "amount": "10.00", "processed_at": "2022-07-03T12:44:50-04:00", "created_at": "2023-01-03T12:44:50-05:00", "updated_at": "2023-01-03T12:44:50-05:00", "note": null, "remote_transaction_ref": null, "remote_transaction_url": null}})); + + const gift_card_adjustment = new shopify.rest.GiftCardAdjustment({session: session}); + gift_card_adjustment.gift_card_id = 1035197676; + gift_card_adjustment.amount = 10.0; + gift_card_adjustment.processed_at = "2022-07-03T12:44:50-04:00"; + await gift_card_adjustment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676/adjustments.json', + query: '', + headers, + data: { "adjustment": {"amount": 10.0, "processed_at": "2022-07-03T12:44:50-04:00"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"adjustment": {"id": 1064273908, "gift_card_id": 1035197676, "api_client_id": null, "user_id": null, "order_transaction_id": null, "number": null, "amount": "10.00", "processed_at": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "note": "Customer refilled gift card by $10", "remote_transaction_ref": null, "remote_transaction_url": null}})); + + await shopify.rest.GiftCardAdjustment.find({ + session: session, + gift_card_id: 1035197676, + id: 1064273908, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/gift_cards/1035197676/adjustments/1064273908.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/image.test.ts b/rest/admin/__tests__/2023-01/image.test.ts new file mode 100644 index 000000000..eef3f8a80 --- /dev/null +++ b/rest/admin/__tests__/2023-01/image.test.ts @@ -0,0 +1,321 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Image resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]})); + + await shopify.rest.Image.all({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/images.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"images": [{"id": 1001473900, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:38:59-05:00", "updated_at": "2023-01-03T12:38:59-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767539", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473900"}]})); + + await shopify.rest.Image.all({ + session: session, + product_id: 632910392, + since_id: "850703190", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/images.json', + query: 'since_id=850703190', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"image": {"width": 110, "height": 140, "position": 1, "alt": null, "id": 1001473901, "product_id": 632910392, "created_at": "2023-01-03T12:39:02-05:00", "updated_at": "2023-01-03T12:39:02-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767542", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473901"}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKr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4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"position": 1, "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIu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XAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"image": {"id": 1001473905, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:39:23-05:00", "updated_at": "2023-01-03T12:39:23-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767563", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473905"}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.variant_ids = [ + 808950810, + 457924702 + ]; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9iggMd1TLtbRKUdKXEQFsd4XrZ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7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"variant_ids": [808950810, 457924702], "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL9pTJIjJrM4NPbx8cdyX7M7\nPYYVHu7j4KgoNJAYIKtkV5o9MsOcldicis+RYNutfrhFOZ0hJbqinZ8bI8h5\nUObFuOfItJsfJrJfUOfIqc+PXqQtK8RnSbA4Mcd3Tm0SGbpXQ8aqp7RLNs+s\novHfzpVhV9igg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Xe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"image": {"position": 1, "width": 110, "height": 140, "alt": null, "id": 1001473903, "product_id": 632910392, "created_at": "2023-01-03T12:39:08-05:00", "updated_at": "2023-01-03T12:39:08-05:00", "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767548", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473903"}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.position = 1; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH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eM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"position": 1, "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvW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3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"image": {"id": 1001473904, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:39:10-05:00", "updated_at": "2023-01-03T12:39:10-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-c155h.gif?v=1672767550", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473904"}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.src = "http://example.com/rails_logo.gif"; + await image.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"src": "http://example.com/rails_logo.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"image": {"id": 1001473896, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T12:38:46-05:00", "updated_at": "2023-01-03T12:38:46-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo.gif?v=1672767526", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473896"}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.attachment = "R0lGODlhbgCMAPf/APbr48VySrx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lxygL31hO13tMrW7lwkB0BiUoR3x4EfmrYlCNjAF\nCRAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n"; + image.filename = "rails_logo.gif"; + await image.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/images.json', + query: '', + headers, + data: { "image": {"attachment": "R0lGODlhbgCMAPf/APbr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N+HbjlxygL31hO13tMrW7lwkB0BiUoR3x4EfmrYlCNjAF\nCRAoIWmwQexQqQcyxHe+9eXAfVOQAg7k16v7jQsAHGi2Bv0gUzyQQ05Ga+Cy\n0MBEDsZgN8gQ4QnXt7oJ0QOGOZACDTeEu0aTCwC80EKhDcAHMDGHWATMsuMC\nFsVl/9GnP0Jg0kw24MUv/qUTOGDlCj8WETfGsVx2vI+UzsATIFZUaTIRk3QY\n+ZYlFq0Ce5QJHBXgdU+MRCSwEYlVBCHPQZhyn7vhhD9fWdAc2DKhKXxhRCc6\n0Yi4LOPcl6hGVUFqc4gJLGaxufKO1s2VkrOj63znOkciCKMedZ+n7ARUp1rQ\niLAyIlyNYURcONaInrWs9ci4JyJOaFYawDzP8Q+ZwAICLckbgd08i290eh9V\nCIadQw3qO5Oa1H1GNRlSjeorO2HLruZ2rLudAm+Dm9Gxcx/GXmSIMbnjH5W2\nzy2RbOzM+cENBRAWs0N9b3zXWdp8pra1r61tbXdb4N/2Nv8i5gzeIJd5Gjui\nwT+AzQ9YVGrYnNO0Agm27GBkvNnNzje+921qf/+b1QEfuMDFPe5lk/lspUG3\nWKbQCofLBBBuwNEs3C3aikcrB2TTeM81HgmOd3zf/PZ3yFPNaqSXfODF0EDK\nE9e6liZmCvJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "filename": "rails_logo.gif"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Image.count({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/images/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"count": 0})); + + await shopify.rest.Image.count({ + session: session, + product_id: 632910392, + since_id: "850703190", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/images/count.json', + query: 'since_id=850703190', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + + await shopify.rest.Image.find({ + session: session, + product_id: 632910392, + id: 850703190, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/images/850703190.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:53-05:00", "alt": "new alt tag content", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672767533", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.id = 850703190; + image.position = 2; + image.alt = "new alt tag content"; + await image.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392/images/850703190.json', + query: '', + headers, + data: { "image": {"position": 2, "alt": "new alt tag content"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"image": {"updated_at": "2023-01-03T12:39:13-05:00", "id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672767553", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.id = 850703190; + image.metafields = [ + { + "key": "my_new_metafield", + "value": "my_new_value", + "type": "single_line_text_field", + "namespace": "tags" + } + ]; + await image.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392/images/850703190.json', + query: '', + headers, + data: { "image": {"metafields": [{"key": "my_new_metafield", "value": "my_new_value", "type": "single_line_text_field", "namespace": "tags"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "variant_ids": [457924702, 808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}})); + + const image = new shopify.rest.Image({session: session}); + image.product_id = 632910392; + image.id = 850703190; + image.variant_ids = [ + 808950810, + 457924702 + ]; + await image.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392/images/850703190.json', + query: '', + headers, + data: { "image": {"variant_ids": [808950810, 457924702]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Image.delete({ + session: session, + product_id: 632910392, + id: 850703190, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/products/632910392/images/850703190.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/inventory_item.test.ts b/rest/admin/__tests__/2023-01/inventory_item.test.ts new file mode 100644 index 000000000..e26d6b838 --- /dev/null +++ b/rest/admin/__tests__/2023-01/inventory_item.test.ts @@ -0,0 +1,105 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('InventoryItem resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"inventory_items": [{"id": 39072856, "sku": "IPOD2008GREEN", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/39072856"}, {"id": 457924702, "sku": "IPOD2008BLACK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/457924702"}, {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}]})); + + await shopify.rest.InventoryItem.all({ + session: session, + ids: "808950810,39072856,457924702", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/inventory_items.json', + query: 'ids=808950810%2C39072856%2C457924702', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + + await shopify.rest.InventoryItem.find({ + session: session, + id: 808950810, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/inventory_items/808950810.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "new sku", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:38:07-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + + const inventory_item = new shopify.rest.InventoryItem({session: session}); + inventory_item.id = 808950810; + inventory_item.sku = "new sku"; + await inventory_item.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/inventory_items/808950810.json', + query: '', + headers, + data: { "inventory_item": {"sku": "new sku"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"inventory_item": {"id": 808950810, "sku": "IPOD2008PINK", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "requires_shipping": true, "cost": "25.00", "country_code_of_origin": null, "province_code_of_origin": null, "harmonized_system_code": null, "tracked": true, "country_harmonized_system_codes": [], "admin_graphql_api_id": "gid://shopify/InventoryItem/808950810"}})); + + const inventory_item = new shopify.rest.InventoryItem({session: session}); + inventory_item.id = 808950810; + inventory_item.cost = "25.00"; + await inventory_item.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/inventory_items/808950810.json', + query: '', + headers, + data: { "inventory_item": {"cost": "25.00"} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/inventory_level.test.ts b/rest/admin/__tests__/2023-01/inventory_level.test.ts new file mode 100644 index 000000000..7345b9b90 --- /dev/null +++ b/rest/admin/__tests__/2023-01/inventory_level.test.ts @@ -0,0 +1,164 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('InventoryLevel resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 655441491, "available": 2, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 655441491, "available": 4, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + + await shopify.rest.InventoryLevel.all({ + session: session, + location_ids: "655441491", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/inventory_levels.json', + query: 'location_ids=655441491', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}]})); + + await shopify.rest.InventoryLevel.all({ + session: session, + inventory_item_ids: "808950810", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/inventory_levels.json', + query: 'inventory_item_ids=808950810', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}, {"inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}, {"inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2023-01-03T12:56:35-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]})); + + await shopify.rest.InventoryLevel.all({ + session: session, + inventory_item_ids: "808950810,39072856", + location_ids: "655441491,487838322", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/inventory_levels.json', + query: 'inventory_item_ids=808950810%2C39072856&location_ids=655441491%2C487838322', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 6, "updated_at": "2023-01-03T13:03:33-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + + const inventory_level = new shopify.rest.InventoryLevel({session: session}); + + await inventory_level.adjust({ + body: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/inventory_levels/adjust.json', + query: '', + headers, + data: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5} + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.InventoryLevel.delete({ + session: session, + inventory_item_id: "808950810", + location_id: "655441491", + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/inventory_levels.json', + query: 'inventory_item_id=808950810&location_id=655441491', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 457924702, "location_id": 844681632, "available": 0, "updated_at": "2023-01-03T13:03:42-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702"}})); + + const inventory_level = new shopify.rest.InventoryLevel({session: session}); + + await inventory_level.connect({ + body: {"location_id": 844681632, "inventory_item_id": 457924702}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/inventory_levels/connect.json', + query: '', + headers, + data: {"location_id": 844681632, "inventory_item_id": 457924702} + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"inventory_level": {"inventory_item_id": 808950810, "location_id": 655441491, "available": 42, "updated_at": "2023-01-03T13:03:52-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}})); + + const inventory_level = new shopify.rest.InventoryLevel({session: session}); + + await inventory_level.set({ + body: {"location_id": 655441491, "inventory_item_id": 808950810, "available": 42}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/inventory_levels/set.json', + query: '', + headers, + data: {"location_id": 655441491, "inventory_item_id": 808950810, "available": 42} + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/location.test.ts b/rest/admin/__tests__/2023-01/location.test.ts new file mode 100644 index 000000000..b98e18189 --- /dev/null +++ b/rest/admin/__tests__/2023-01/location.test.ts @@ -0,0 +1,103 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Location resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"locations": [{"id": 655441491, "name": "50 Rideau Street", "address1": "50 Rideau Street", "address2": null, "city": "Ottawa", "zip": "K1N 9J7", "province": "Ontario", "country": "CA", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "CA", "country_name": "Canada", "province_code": "ON", "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/655441491", "localized_country_name": "Canada", "localized_province_name": "Ontario"}, {"id": 24826418, "name": "Apple Api Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/24826418", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 844681632, "name": "Apple Cupertino", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/844681632", "localized_country_name": "United States", "localized_province_name": null}, {"id": 611870435, "name": "Apple Shipwire", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "DE", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "DE", "country_name": "Germany", "province_code": null, "legacy": true, "active": true, "admin_graphql_api_id": "gid://shopify/Location/611870435", "localized_country_name": "Germany", "localized_province_name": null}, {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322", "localized_country_name": "United States", "localized_province_name": null}]})); + + await shopify.rest.Location.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/locations.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"location": {"id": 487838322, "name": "Fifth Avenue AppleStore", "address1": null, "address2": null, "city": null, "zip": null, "province": null, "country": "US", "phone": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "country_code": "US", "country_name": "United States", "province_code": null, "legacy": false, "active": true, "admin_graphql_api_id": "gid://shopify/Location/487838322"}})); + + await shopify.rest.Location.find({ + session: session, + id: 487838322, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/locations/487838322.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"count": 5})); + + await shopify.rest.Location.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/locations/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"inventory_levels": [{"inventory_item_id": 49148385, "location_id": 487838322, "available": 18, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=49148385"}, {"inventory_item_id": 808950810, "location_id": 487838322, "available": 9, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"}, {"inventory_item_id": 457924702, "location_id": 487838322, "available": 36, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=457924702"}, {"inventory_item_id": 39072856, "location_id": 487838322, "available": 27, "updated_at": "2023-01-03T12:21:36-05:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}]})); + + await shopify.rest.Location.inventory_levels({ + session: session, + id: 487838322, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/locations/487838322/inventory_levels.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/locations_for_move.test.ts b/rest/admin/__tests__/2023-01/locations_for_move.test.ts new file mode 100644 index 000000000..31306c99f --- /dev/null +++ b/rest/admin/__tests__/2023-01/locations_for_move.test.ts @@ -0,0 +1,51 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('LocationsForMove resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"locations_for_move": [{"location": {"id": 1072404544, "name": "Alpha Location"}, "message": "Current location.", "movable": false}, {"location": {"id": 1072404545, "name": "Bravo Location"}, "message": "No items are stocked at this location.", "movable": false}]})); + + await shopify.rest.LocationsForMove.all({ + session: session, + fulfillment_order_id: 1046000829, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/fulfillment_orders/1046000829/locations_for_move.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/marketing_event.test.ts b/rest/admin/__tests__/2023-01/marketing_event.test.ts new file mode 100644 index 000000000..fd3861fac --- /dev/null +++ b/rest/admin/__tests__/2023-01/marketing_event.test.ts @@ -0,0 +1,175 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('MarketingEvent resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"marketing_events": [{"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2023-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}]})); + + await shopify.rest.MarketingEvent.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/marketing_events.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"marketing_event": {"id": 1069063883, "event_type": "ad", "remote_id": null, "started_at": "2023-12-14T19:00:00-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": null, "currency": null, "manage_url": null, "preview_url": null, "utm_campaign": "Christmas2023", "utm_source": "facebook", "utm_medium": "cpc", "budget_type": null, "description": null, "marketing_channel": "social", "paid": true, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": 1063897333, "admin_graphql_api_id": "gid://shopify/MarketingEvent/1069063883", "marketed_resources": []}})); + + const marketing_event = new shopify.rest.MarketingEvent({session: session}); + marketing_event.started_at = "2023-12-15"; + marketing_event.utm_campaign = "Christmas2023"; + marketing_event.utm_source = "facebook"; + marketing_event.utm_medium = "cpc"; + marketing_event.event_type = "ad"; + marketing_event.referring_domain = "facebook.com"; + marketing_event.marketing_channel = "social"; + marketing_event.paid = true; + await marketing_event.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/marketing_events.json', + query: '', + headers, + data: { "marketing_event": {"started_at": "2023-12-15", "utm_campaign": "Christmas2023", "utm_source": "facebook", "utm_medium": "cpc", "event_type": "ad", "referring_domain": "facebook.com", "marketing_channel": "social", "paid": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.MarketingEvent.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/marketing_events/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"marketing_event": {"id": 998730532, "event_type": "post", "remote_id": "12345678", "started_at": "2023-01-15T10:56:18-05:00", "ended_at": null, "scheduled_to_end_at": null, "budget": "10.11", "currency": "GBP", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "budget_type": "daily", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + + await shopify.rest.MarketingEvent.find({ + session: session, + id: 998730532, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/marketing_events/998730532.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"marketing_event": {"started_at": "2023-02-01T19:00:00-05:00", "ended_at": "2023-02-02T19:00:00-05:00", "scheduled_to_end_at": "2023-02-03T19:00:00-05:00", "remote_id": "1000:2000", "currency": "CAD", "budget": "11.1", "budget_type": "daily", "id": 998730532, "event_type": "post", "manage_url": null, "preview_url": null, "utm_campaign": "1234567890", "utm_source": "facebook", "utm_medium": "facebook-post", "description": null, "marketing_channel": "social", "paid": false, "referring_domain": "facebook.com", "breadcrumb_id": null, "marketing_activity_id": null, "admin_graphql_api_id": "gid://shopify/MarketingEvent/998730532", "marketed_resources": []}})); + + const marketing_event = new shopify.rest.MarketingEvent({session: session}); + marketing_event.id = 998730532; + marketing_event.remote_id = "1000:2000"; + marketing_event.started_at = "2023-02-02T00:00 +00:00"; + marketing_event.ended_at = "2023-02-03T00:00 +00:00"; + marketing_event.scheduled_to_end_at = "2023-02-04T00:00 +00:00"; + marketing_event.budget = "11.1"; + marketing_event.budget_type = "daily"; + marketing_event.currency = "CAD"; + marketing_event.utm_campaign = "other"; + marketing_event.utm_source = "other"; + marketing_event.utm_medium = "other"; + marketing_event.event_type = "ad"; + marketing_event.referring_domain = "instagram.com"; + await marketing_event.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/marketing_events/998730532.json', + query: '', + headers, + data: { "marketing_event": {"remote_id": "1000:2000", "started_at": "2023-02-02T00:00 +00:00", "ended_at": "2023-02-03T00:00 +00:00", "scheduled_to_end_at": "2023-02-04T00:00 +00:00", "budget": "11.1", "budget_type": "daily", "currency": "CAD", "utm_campaign": "other", "utm_source": "other", "utm_medium": "other", "event_type": "ad", "referring_domain": "instagram.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.MarketingEvent.delete({ + session: session, + id: 998730532, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/marketing_events/998730532.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"engagements": [{"occurred_on": "2023-01-15", "fetched_at": null, "views_count": 0, "impressions_count": null, "clicks_count": 0, "favorites_count": 0, "comments_count": null, "shares_count": null, "ad_spend": "10.0", "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2023-01-16", "fetched_at": null, "views_count": 100, "impressions_count": null, "clicks_count": 50, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}, {"occurred_on": "2023-01-17", "fetched_at": null, "views_count": 200, "impressions_count": null, "clicks_count": 100, "favorites_count": null, "comments_count": null, "shares_count": null, "ad_spend": null, "currency_code": null, "is_cumulative": true, "unsubscribes_count": null, "complaints_count": null, "fails_count": null, "sends_count": null, "unique_views_count": null, "unique_clicks_count": null, "utc_offset": null}]})); + + const marketing_event = new shopify.rest.MarketingEvent({session: session}); + marketing_event.id = 998730532; + await marketing_event.engagements({ + body: {"engagements": [{"occurred_on": "2023-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2023-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2023-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/marketing_events/998730532/engagements.json', + query: '', + headers, + data: {"engagements": [{"occurred_on": "2023-01-15", "views_count": 0, "clicks_count": 0, "favorites_count": 0, "ad_spend": 10.0, "is_cumulative": true}, {"occurred_on": "2023-01-16", "views_count": 100, "clicks_count": 50, "is_cumulative": true}, {"occurred_on": "2023-01-17", "views_count": 200, "clicks_count": 100, "is_cumulative": true}]} + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/metafield.test.ts b/rest/admin/__tests__/2023-01/metafield.test.ts new file mode 100644 index 000000000..e3e549e4e --- /dev/null +++ b/rest/admin/__tests__/2023-01/metafield.test.ts @@ -0,0 +1,1310 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Metafield resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"metafields": []})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "382285388", "owner_resource": "blog"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=382285388&metafield%5Bowner_resource%5D=blog', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"metafields": [{"id": 519046726, "namespace": "notes", "key": "descriptionription", "value": "Collection description", "description": "Custom Collection notes", "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/519046726"}, {"id": 624849518, "namespace": "global", "key": "description_tag", "value": "Some seo description value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/624849518"}, {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}]})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "482865238", "owner_resource": "collection"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=482865238&metafield%5Bowner_resource%5D=collection', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"metafields": [{"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}]})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "207119551", "owner_resource": "customer"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=207119551&metafield%5Bowner_resource%5D=customer', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"metafields": [{"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}]})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "622762746", "owner_resource": "draft_order"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=622762746&metafield%5Bowner_resource%5D=draft_order', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"metafields": [{"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}]})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "131092082", "owner_resource": "page"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=131092082&metafield%5Bowner_resource%5D=page', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"metafields": [{"id": 51714266, "namespace": "my_namespace", "key": "my_key", "value": "Hello", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/51714266"}, {"id": 116539875, "namespace": "descriptors", "key": "subtitle", "value": "The best ipod", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/116539875"}, {"id": 263497237, "namespace": "installments", "key": "disable", "value": true, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/263497237"}, {"id": 273160493, "namespace": "facts", "key": "isbn", "value": "978-0-14-004259-7", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/273160493"}, {"id": 524118066, "namespace": "facts", "key": "ean", "value": "0123456789012", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/524118066"}, {"id": 543636738, "namespace": "reviews", "key": "rating_count", "value": 1, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/543636738"}, {"id": 572384404, "namespace": "reviews", "key": "rating", "value": "{\"value\": \"3.5\", \"scale_min\": \"1.0\", \"scale_max\": \"5.0\"}", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "rating", "admin_graphql_api_id": "gid://shopify/Metafield/572384404"}, {"id": 613330208, "namespace": "shopify_filter", "key": "display", "value": "retina", "description": "This field keeps track of the type of display", "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/613330208"}, {"id": 779326701, "namespace": "facts", "key": "upc", "value": "012345678901", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/779326701"}, {"id": 845366454, "namespace": "translations", "key": "title_fr", "value": "produit", "description": "French product title", "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/845366454"}, {"id": 861799889, "namespace": "my_other_fields", "key": "organic", "value": true, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "boolean", "admin_graphql_api_id": "gid://shopify/Metafield/861799889"}, {"id": 870326793, "namespace": "descriptors", "key": "care_guide", "value": "Wash in cold water", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": null, "admin_graphql_api_id": "gid://shopify/Metafield/870326793"}, {"id": 908250163, "namespace": "my_other_fields", "key": "shipping_policy", "value": "Ships for free in Canada", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "multi_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/908250163"}, {"id": 925288667, "namespace": "my_other_fields", "key": "year_released", "value": 2019, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/925288667"}, {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}, {"id": 1029402048, "namespace": "my_other_fields", "key": "ingredients", "value": "[\"apple\", \"music\", \"u2\"]", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "list.single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1029402048"}]})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "632910392", "owner_resource": "product"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=632910392&metafield%5Bowner_resource%5D=product', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"metafields": [{"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}]})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "850703190", "owner_resource": "product_image"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=850703190&metafield%5Bowner_resource%5D=product_image', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"metafields": []})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "49148385", "owner_resource": "variants"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=49148385&metafield%5Bowner_resource%5D=variants', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"metafields": []})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "674387490", "owner_resource": "article"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=674387490&metafield%5Bowner_resource%5D=article', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"metafields": [{"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}]})); + + await shopify.rest.Metafield.all({ + session: session, + metafield: {"owner_id": "450789469", "owner_resource": "order"}, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'metafield%5Bowner_id%5D=450789469&metafield%5Bowner_resource%5D=order', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"metafields": [{"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}]})); + + await shopify.rest.Metafield.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"metafields": [{"id": 1069229006, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:53:15-05:00", "updated_at": "2023-01-03T12:53:15-05:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069229006"}]})); + + await shopify.rest.Metafield.all({ + session: session, + since_id: "721389482", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields.json', + query: 'since_id=721389482', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228998, "namespace": "my_fields", "key": "sponsor", "value": "Shopify", "description": null, "owner_id": 382285388, "created_at": "2023-01-03T12:52:48-05:00", "updated_at": "2023-01-03T12:52:48-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228998"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.namespace = "my_fields"; + metafield.key = "sponsor"; + metafield.type = "single_line_text_field"; + metafield.value = "Shopify"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/blogs/382285388/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "sponsor", "type": "single_line_text_field", "value": "Shopify"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228972, "namespace": "my_fields", "key": "discount", "value": "25%", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:50:28-05:00", "updated_at": "2023-01-03T12:50:28-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228972"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.namespace = "my_fields"; + metafield.key = "discount"; + metafield.type = "single_line_text_field"; + metafield.value = "25%"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/collections/482865238/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "discount", "type": "single_line_text_field", "value": "25%"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228983, "namespace": "discounts", "key": "special", "value": "yes", "description": null, "owner_id": 207119551, "created_at": "2023-01-03T12:51:01-05:00", "updated_at": "2023-01-03T12:51:01-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228983"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.namespace = "discounts"; + metafield.key = "special"; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/customers/207119551/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "discounts", "key": "special", "value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069229003, "namespace": "my_fields", "key": "purchase_order", "value": "97453", "description": null, "owner_id": 622762746, "created_at": "2023-01-03T12:53:03-05:00", "updated_at": "2023-01-03T12:53:03-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069229003"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "97453"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/draft_orders/622762746/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "97453"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228969, "namespace": "my_fields", "key": "subtitle", "value": "A subtitle for my page", "description": null, "owner_id": 131092082, "created_at": "2023-01-03T12:49:57-05:00", "updated_at": "2023-01-03T12:49:57-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228969"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.namespace = "my_fields"; + metafield.key = "subtitle"; + metafield.type = "single_line_text_field"; + metafield.value = "A subtitle for my page"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/pages/131092082/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "subtitle", "type": "single_line_text_field", "value": "A subtitle for my page"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228994, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:51:54-05:00", "updated_at": "2023-01-03T12:51:54-05:00", "owner_resource": "product", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228994"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.namespace = "inventory"; + metafield.key = "warehouse"; + metafield.value = 25; + metafield.type = "number_integer"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "inventory", "key": "warehouse", "value": 25, "type": "number_integer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228985, "namespace": "translaction", "key": "title_spanish", "value": "botas", "description": null, "owner_id": 850703190, "created_at": "2023-01-03T12:51:06-05:00", "updated_at": "2023-01-03T12:51:06-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228985"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.namespace = "translaction"; + metafield.key = "title_spanish"; + metafield.type = "single_line_text_field"; + metafield.value = "botas"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/product_images/850703190/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "translaction", "key": "title_spanish", "type": "single_line_text_field", "value": "botas"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228995, "namespace": "my_fields", "key": "liner_material", "value": "synthetic leather", "description": null, "owner_id": 49148385, "created_at": "2023-01-03T12:52:21-05:00", "updated_at": "2023-01-03T12:52:21-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228995"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.namespace = "my_fields"; + metafield.key = "liner_material"; + metafield.type = "single_line_text_field"; + metafield.value = "synthetic leather"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/variants/49148385/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "liner_material", "type": "single_line_text_field", "value": "synthetic leather"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228982, "namespace": "my_fields", "key": "category", "value": "outdoors", "description": null, "owner_id": 674387490, "created_at": "2023-01-03T12:50:58-05:00", "updated_at": "2023-01-03T12:50:58-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069228982"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.namespace = "my_fields"; + metafield.key = "category"; + metafield.type = "single_line_text_field"; + metafield.value = "outdoors"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/articles/674387490/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "category", "type": "single_line_text_field", "value": "outdoors"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069229001, "namespace": "my_fields", "key": "purchase_order", "value": "123", "description": null, "owner_id": 450789469, "created_at": "2023-01-03T12:52:57-05:00", "updated_at": "2023-01-03T12:52:57-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1069229001"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.namespace = "my_fields"; + metafield.key = "purchase_order"; + metafield.type = "single_line_text_field"; + metafield.value = "123"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "my_fields", "key": "purchase_order", "type": "single_line_text_field", "value": "123"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1069228973, "namespace": "inventory", "key": "warehouse", "value": 25, "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:50:31-05:00", "updated_at": "2023-01-03T12:50:31-05:00", "owner_resource": "shop", "type": "number_integer", "admin_graphql_api_id": "gid://shopify/Metafield/1069228973"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.namespace = "inventory"; + metafield.key = "warehouse"; + metafield.value = 25; + metafield.type = "number_integer"; + await metafield.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/metafields.json', + query: '', + headers, + data: { "metafield": {"namespace": "inventory", "key": "warehouse", "value": 25, "type": "number_integer"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + queueMockResponse(JSON.stringify({"count": 0})); + + await shopify.rest.Metafield.count({ + session: session, + blog_id: 382285388, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/382285388/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_25', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Metafield.count({ + session: session, + collection_id: 482865238, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collections/482865238/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_26', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + customer_id: 207119551, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/207119551/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_27', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + draft_order_id: 622762746, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/draft_orders/622762746/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_28', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + page_id: 131092082, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/pages/131092082/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_29', async () => { + queueMockResponse(JSON.stringify({"count": 16})); + + await shopify.rest.Metafield.count({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_30', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + product_image_id: 850703190, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/product_images/850703190/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_31', async () => { + queueMockResponse(JSON.stringify({"count": 0})); + + await shopify.rest.Metafield.count({ + session: session, + variant_id: 49148385, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/variants/49148385/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_32', async () => { + queueMockResponse(JSON.stringify({"count": 0})); + + await shopify.rest.Metafield.count({ + session: session, + article_id: 674387490, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/articles/674387490/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_33', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_34', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Metafield.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_35', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 534526895, "namespace": "translation", "key": "title_fr", "value": "Le iPod", "description": "Blog French title translation", "owner_id": 241253187, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + + await shopify.rest.Metafield.find({ + session: session, + blog_id: 382285388, + id: 534526895, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/blogs/382285388/metafields/534526895.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_36', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1010236510, "namespace": "global", "key": "title_tag", "value": "Some seo title value", "description": null, "owner_id": 482865238, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + + await shopify.rest.Metafield.find({ + session: session, + collection_id: 482865238, + id: 1010236510, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/collections/482865238/metafields/1010236510.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_37', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 220591908, "namespace": "discounts", "key": "returning_customer", "value": "no", "description": "Customer deserves discount", "owner_id": 207119551, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + await shopify.rest.Metafield.find({ + session: session, + customer_id: 207119551, + id: 220591908, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_38', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 106172460, "namespace": "notes", "key": "note", "value": "B flat", "description": "This is for notes", "owner_id": 622762746, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + + await shopify.rest.Metafield.find({ + session: session, + draft_order_id: 622762746, + id: 106172460, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/draft_orders/622762746/metafields/106172460.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_39', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 290519330, "namespace": "translation", "key": "title_fr", "value": "Le TOS", "description": "Page French title translation", "owner_id": 131092082, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + + await shopify.rest.Metafield.find({ + session: session, + page_id: 131092082, + id: 290519330, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/pages/131092082/metafields/290519330.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_40', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 1001077698, "namespace": "my_fields", "key": "best_for", "value": "travel", "description": null, "owner_id": 632910392, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + + await shopify.rest.Metafield.find({ + session: session, + product_id: 632910392, + id: 1001077698, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/metafields/1001077698.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_41', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 625663657, "namespace": "translation", "key": "title_fr", "value": "tbn", "description": "French product image title", "owner_id": 850703190, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + + await shopify.rest.Metafield.find({ + session: session, + product_image_id: 850703190, + id: 625663657, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/product_images/850703190/metafields/625663657.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_42', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 323119633, "namespace": "my_fields", "key": "color", "value": "Pink", "description": null, "owner_id": 808950810, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + + await shopify.rest.Metafield.find({ + session: session, + variant_id: 49148385, + id: 323119633, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/variants/49148385/metafields/323119633.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_43', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 838981074, "namespace": "translation", "key": "title_fr", "value": "Le Article", "description": "Article French title translation", "owner_id": 134645308, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + + await shopify.rest.Metafield.find({ + session: session, + article_id: 674387490, + id: 838981074, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/articles/674387490/metafields/838981074.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_44', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 915396079, "namespace": "notes", "key": "buyer", "value": "Notes about this buyer", "description": "This field is for buyer notes", "owner_id": 450789469, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + + await shopify.rest.Metafield.find({ + session: session, + order_id: 450789469, + id: 915396079, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/metafields/915396079.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_45', async () => { + queueMockResponse(JSON.stringify({"metafield": {"id": 721389482, "namespace": "affiliates", "key": "app_key", "value": "app_key", "description": null, "owner_id": 548380009, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "owner_resource": "shop", "type": "string", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + + await shopify.rest.Metafield.find({ + session: session, + id: 721389482, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/metafields/721389482.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_46', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated blog title", "owner_id": 241253187, "namespace": "translation", "key": "title_fr", "id": 534526895, "description": "Blog French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:53:17-05:00", "owner_resource": "blog", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/534526895"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.blog_id = 382285388; + metafield.id = 534526895; + metafield.value = "a translated blog title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/blogs/382285388/metafields/534526895.json', + query: '', + headers, + data: { "metafield": {"value": "a translated blog title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_47', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "seo title", "owner_id": 482865238, "namespace": "global", "key": "title_tag", "id": 1010236510, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:49:17-05:00", "owner_resource": "collection", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1010236510"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.collection_id = 482865238; + metafield.id = 1010236510; + metafield.value = "seo title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/collections/482865238/metafields/1010236510.json', + query: '', + headers, + data: { "metafield": {"value": "seo title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_48', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "yes", "owner_id": 207119551, "namespace": "discounts", "key": "returning_customer", "id": 220591908, "description": "Customer deserves discount", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:50:56-05:00", "owner_resource": "customer", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/220591908"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.customer_id = 207119551; + metafield.id = 220591908; + metafield.value = "yes"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: { "metafield": {"value": "yes", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_49', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "110000", "owner_id": 622762746, "namespace": "notes", "key": "note", "id": 106172460, "description": "This is for notes", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:51:31-05:00", "owner_resource": "draft_order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/106172460"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.draft_order_id = 622762746; + metafield.id = 106172460; + metafield.value = "110000"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/draft_orders/622762746/metafields/106172460.json', + query: '', + headers, + data: { "metafield": {"value": "110000", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_50', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "An updated translation", "owner_id": 131092082, "namespace": "translation", "key": "title_fr", "id": 290519330, "description": "Page French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:39-05:00", "owner_resource": "page", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/290519330"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.page_id = 131092082; + metafield.id = 290519330; + metafield.value = "An updated translation"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/pages/131092082/metafields/290519330.json', + query: '', + headers, + data: { "metafield": {"value": "An updated translation", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_51', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "having fun", "owner_id": 632910392, "namespace": "my_fields", "key": "best_for", "id": 1001077698, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:51:25-05:00", "owner_resource": "product", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/1001077698"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_id = 632910392; + metafield.id = 1001077698; + metafield.value = "having fun"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392/metafields/1001077698.json', + query: '', + headers, + data: { "metafield": {"value": "having fun", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_52', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "translated description", "owner_id": 850703190, "namespace": "translation", "key": "title_fr", "id": 625663657, "description": "French product image title", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:31-05:00", "owner_resource": "product_image", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/625663657"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.product_image_id = 850703190; + metafield.id = 625663657; + metafield.value = "translated description"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/product_images/850703190/metafields/625663657.json', + query: '', + headers, + data: { "metafield": {"value": "translated description", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_53', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "Red", "owner_id": 808950810, "namespace": "my_fields", "key": "color", "id": 323119633, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:53:00-05:00", "owner_resource": "variant", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/323119633"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.variant_id = 49148385; + metafield.id = 323119633; + metafield.value = "Red"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/variants/49148385/metafields/323119633.json', + query: '', + headers, + data: { "metafield": {"value": "Red", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_54', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "something new", "owner_id": 548380009, "namespace": "affiliates", "key": "app_key", "id": 721389482, "description": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:52:02-05:00", "owner_resource": "shop", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/721389482"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.id = 721389482; + metafield.value = "something new"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/metafields/721389482.json', + query: '', + headers, + data: { "metafield": {"value": "something new", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_55', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "a translated title", "owner_id": 134645308, "namespace": "translation", "key": "title_fr", "id": 838981074, "description": "Article French title translation", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:50:36-05:00", "owner_resource": "article", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/838981074"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.article_id = 674387490; + metafield.id = 838981074; + metafield.value = "a translated title"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/articles/674387490/metafields/838981074.json', + query: '', + headers, + data: { "metafield": {"value": "a translated title", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_56', async () => { + queueMockResponse(JSON.stringify({"metafield": {"value": "Provided a discount code", "owner_id": 450789469, "namespace": "notes", "key": "buyer", "id": 915396079, "description": "This field is for buyer notes", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:49:41-05:00", "owner_resource": "order", "type": "single_line_text_field", "admin_graphql_api_id": "gid://shopify/Metafield/915396079"}})); + + const metafield = new shopify.rest.Metafield({session: session}); + metafield.order_id = 450789469; + metafield.id = 915396079; + metafield.value = "Provided a discount code"; + metafield.type = "single_line_text_field"; + await metafield.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469/metafields/915396079.json', + query: '', + headers, + data: { "metafield": {"value": "Provided a discount code", "type": "single_line_text_field"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_57', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + blog_id: 382285388, + id: 534526895, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/blogs/382285388/metafields/534526895.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_58', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + collection_id: 482865238, + id: 1010236510, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/collections/482865238/metafields/1010236510.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_59', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + customer_id: 207119551, + id: 220591908, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/customers/207119551/metafields/220591908.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_60', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + draft_order_id: 622762746, + id: 106172460, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/draft_orders/622762746/metafields/106172460.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_61', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + page_id: 131092082, + id: 290519330, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/pages/131092082/metafields/290519330.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_62', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + product_id: 632910392, + id: 1001077698, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/products/632910392/metafields/1001077698.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_63', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + product_image_id: 850703190, + id: 625663657, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/product_images/850703190/metafields/625663657.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_64', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + variant_id: 49148385, + id: 323119633, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/variants/49148385/metafields/323119633.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_65', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + article_id: 674387490, + id: 838981074, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/articles/674387490/metafields/838981074.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_66', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + order_id: 450789469, + id: 915396079, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/orders/450789469/metafields/915396079.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_67', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Metafield.delete({ + session: session, + id: 721389482, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/metafields/721389482.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/mobile_platform_application.test.ts b/rest/admin/__tests__/2023-01/mobile_platform_application.test.ts new file mode 100644 index 000000000..65ce631b1 --- /dev/null +++ b/rest/admin/__tests__/2023-01/mobile_platform_application.test.ts @@ -0,0 +1,182 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('MobilePlatformApplication resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"mobile_platform_applications": [{"id": 1066175996, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:47-05:00", "updated_at": "2023-01-03T12:42:47-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}, {"id": 1066175997, "application_id": "com.example", "platform": "android", "created_at": "2023-01-03T12:42:47-05:00", "updated_at": "2023-01-03T12:42:47-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}]})); + + await shopify.rest.MobilePlatformApplication.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/mobile_platform_applications.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176002, "application_id": "com.example", "platform": "android", "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:42:58-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null}})); + + const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); + mobile_platform_application.platform = "android"; + mobile_platform_application.application_id = "com.example"; + mobile_platform_application.sha256_cert_fingerprints = [ + "14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5" + ]; + mobile_platform_application.enabled_universal_or_app_links = true; + await mobile_platform_application.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/mobile_platform_applications.json', + query: '', + headers, + data: { "mobile_platform_application": {"platform": "android", "application_id": "com.example", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066176000, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:54-05:00", "updated_at": "2023-01-03T12:42:54-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); + + const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); + mobile_platform_application.platform = "ios"; + mobile_platform_application.application_id = "X1Y2.ca.domain.app"; + mobile_platform_application.enabled_universal_or_app_links = true; + mobile_platform_application.enabled_shared_webcredentials = true; + await mobile_platform_application.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/mobile_platform_applications.json', + query: '', + headers, + data: { "mobile_platform_application": {"platform": "ios", "application_id": "X1Y2.ca.domain.app", "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"mobile_platform_application": {"id": 1066175998, "application_id": "X1Y2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:49-05:00", "updated_at": "2023-01-03T12:42:49-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null}})); + + await shopify.rest.MobilePlatformApplication.find({ + session: session, + id: 1066175998, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/mobile_platform_applications/1066175998.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "id": 1066175999, "created_at": "2023-01-03T12:42:50-05:00", "updated_at": "2023-01-03T12:42:52-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); + + const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); + mobile_platform_application.id = 1066175999; + mobile_platform_application.application_id = "com.example.news.app"; + mobile_platform_application.platform = "android"; + mobile_platform_application.created_at = "2023-01-03T12:42:50-05:00"; + mobile_platform_application.updated_at = "2023-01-03T12:42:50-05:00"; + mobile_platform_application.sha256_cert_fingerprints = [ + "14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5" + ]; + mobile_platform_application.enabled_universal_or_app_links = true; + mobile_platform_application.enabled_shared_webcredentials = false; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; + await mobile_platform_application.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/mobile_platform_applications/1066175999.json', + query: '', + headers, + data: { "mobile_platform_application": {"application_id": "com.example.news.app", "platform": "android", "created_at": "2023-01-03T12:42:50-05:00", "updated_at": "2023-01-03T12:42:50-05:00", "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": false, "enabled_app_clips": false, "app_clip_application_id": null} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "id": 1066176003, "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:43:00-05:00", "enabled_app_clips": false, "app_clip_application_id": null}})); + + const mobile_platform_application = new shopify.rest.MobilePlatformApplication({session: session}); + mobile_platform_application.id = 1066176003; + mobile_platform_application.application_id = "A1B2.ca.domain.app"; + mobile_platform_application.platform = "ios"; + mobile_platform_application.created_at = "2023-01-03T12:42:58-05:00"; + mobile_platform_application.updated_at = "2023-01-03T12:42:58-05:00"; + mobile_platform_application.sha256_cert_fingerprints = []; + mobile_platform_application.enabled_universal_or_app_links = true; + mobile_platform_application.enabled_shared_webcredentials = true; + mobile_platform_application.enabled_app_clips = false; + mobile_platform_application.app_clip_application_id = null; + await mobile_platform_application.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/mobile_platform_applications/1066176003.json', + query: '', + headers, + data: { "mobile_platform_application": {"application_id": "A1B2.ca.domain.app", "platform": "ios", "created_at": "2023-01-03T12:42:58-05:00", "updated_at": "2023-01-03T12:42:58-05:00", "sha256_cert_fingerprints": [], "enabled_universal_or_app_links": true, "enabled_shared_webcredentials": true, "enabled_app_clips": false, "app_clip_application_id": null} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.MobilePlatformApplication.delete({ + session: session, + id: 1066176001, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/mobile_platform_applications/1066176001.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/order.test.ts b/rest/admin/__tests__/2023-01/order.test.ts new file mode 100644 index 000000000..b382b3a56 --- /dev/null +++ b/rest/admin/__tests__/2023-01/order.test.ts @@ -0,0 +1,830 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Order resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Order.all({ + session: session, + status: "any", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders.json', + query: 'status=any', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Order.all({ + session: session, + since_id: "123", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders.json', + query: 'since_id=123', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "created_at": "2008-01-10T11:00:00-05:00", "name": "#1001", "total_price": "598.94"}]})); + + await shopify.rest.Order.all({ + session: session, + fields: "created_at,id,name,total-price", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders.json', + query: 'fields=created_at%2Cid%2Cname%2Ctotal-price', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Order.all({ + session: session, + updated_at_min: "2005-07-31T15:57:11-04:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders.json', + query: 'updated_at_min=2005-07-31T15%3A57%3A11-04%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"orders": [{"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "financial_status": "authorized", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:50-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}]})); + + await shopify.rest.Order.all({ + session: session, + financial_status: "authorized", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders.json', + query: 'financial_status=authorized', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"orders": [{"id": 1073459972, "admin_graphql_api_id": "gid://shopify/Order/1073459972", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:28:16-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/3598b8ae8cac731d0e7996f0d2d09e1d/authenticate?key=966f252275757105ae9b631628c76c1a", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:28:16-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "3598b8ae8cac731d0e7996f0d2d09e1d", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_price_usd": "199.00", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:16-05:00", "user_id": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823184, "admin_graphql_api_id": "gid://shopify/LineItem/1071823184", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "refunds": [], "shipping_lines": []}]})); + + await shopify.rest.Order.all({ + session: session, + ids: "1073459972", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders.json', + query: 'ids=1073459972', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "name": "#1001", "total_price": "598.94", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}]}})); + + await shopify.rest.Order.find({ + session: session, + id: 450789469, + fields: "id,line_items,name,total_price", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: 'fields=id%2Cline_items%2Cname%2Ctotal_price', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + await shopify.rest.Order.find({ + session: session, + id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Order.count({ + session: session, + status: "any", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/count.json', + query: 'status=any', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Order.count({ + session: session, + financial_status: "authorized", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/count.json', + query: 'financial_status=authorized', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": "2023-01-03T12:26:44-05:00", "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:44-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.close({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/close.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:29-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.open({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/open.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2008-01-10T11:00:00-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "payment_id": "#1001.3", "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.cancel({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/cancel.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "bogus", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:21-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361462, "admin_graphql_api_id": "gid://shopify/Refund/929361462", "created_at": "2023-01-03T12:27:21-05:00", "note": null, "order_id": 450789469, "processed_at": "2023-01-03T12:27:21-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [], "transactions": [{"id": 1068278471, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278471", "amount": "10.00", "authorization": null, "created_at": "2023-01-03T12:27:21-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278470, "payment_id": "c901414060.3", "processed_at": "2023-01-03T12:27:21-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}], "refund_line_items": [{"id": 1058498307, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498308, "line_item_id": 518995019, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 1058498309, "line_item_id": 703073504, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.cancel({ + body: {"amount": "10.00", "currency": "USD"}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/cancel.json', + query: '', + headers, + data: {"amount": "10.00", "currency": "USD"} + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "587.00", "current_subtotal_price_set": {"shop_money": {"amount": "587.00", "currency_code": "USD"}, "presentment_money": {"amount": "587.00", "currency_code": "USD"}}, "current_total_discounts": "10.00", "current_total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "598.94", "current_total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "current_total_tax": "11.94", "current_total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": null, "gateway": "gift_card", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "merchant_of_record_app_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus", "gift_card"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": true, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "598.94", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:49-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "origin_address": {}, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "payment_terms": null, "refunds": [{"id": 929361463, "admin_graphql_api_id": "gid://shopify/Refund/929361463", "created_at": "2023-01-03T12:27:49-05:00", "note": "Customer made a mistake", "order_id": 450789469, "processed_at": "2023-01-03T12:27:49-05:00", "restock": false, "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": null, "order_adjustments": [{"id": 1030976842, "amount": "89.64", "amount_set": {"shop_money": {"amount": "89.64", "currency_code": "USD"}, "presentment_money": {"amount": "89.64", "currency_code": "USD"}}, "kind": "refund_discrepancy", "order_id": 450789469, "reason": "Refund discrepancy", "refund_id": 929361463, "tax_amount": "0.00", "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}], "transactions": [{"id": 1068278477, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278477", "amount": "10.00", "authorization": null, "created_at": "2023-01-03T12:27:48-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 450789469, "parent_id": 1068278475, "payment_id": "c901414060.4", "processed_at": "2023-01-03T12:27:48-05:00", "receipt": {}, "source_name": "755357713", "status": "success", "test": true, "user_id": null}, {"id": 1068278478, "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278478", "amount": "100.00", "authorization": null, "created_at": "2023-01-03T12:27:49-05:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "gift_card", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 1068278476, "payment_id": "c901414060.5", "processed_at": "2023-01-03T12:27:49-05:00", "receipt": {"gift_card_id": 1035197676, "gift_card_last_characters": "0d0d"}, "source_name": "755357713", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 1058498310, "line_item_id": 466157049, "location_id": null, "quantity": 1, "restock_type": "no_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": [], "additional_fees": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}, "notice": "Order has been canceled"})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + await order.cancel({ + body: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278475, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278476, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/cancel.json', + query: '', + headers, + data: {"refund": {"note": "Customer made a mistake", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 466157049, "quantity": 1, "restock_type": "cancel", "location_id": 24826418}], "transactions": [{"parent_id": 1068278475, "amount": "10.00", "kind": "refund", "gateway": "bogus"}, {"parent_id": 1068278476, "amount": "100.00", "kind": "refund", "gateway": "gift_card"}]}} + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 1073459962, "admin_graphql_api_id": "gid://shopify/Order/1073459962", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:26:04-05:00", "currency": "EUR", "current_subtotal_price": "224.97", "current_subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "current_total_duties_set": null, "current_total_price": "238.47", "current_total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "current_total_tax": "13.50", "current_total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/319b6019f95405472f9713cef70a99a8/authenticate?key=e81d0103ae0eb50bf94365dca29df99f", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "EUR", "processed_at": "2023-01-03T12:26:04-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "224.97", "subtotal_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "tags": "", "tax_lines": [{"price": "13.50", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "319b6019f95405472f9713cef70a99a8", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_line_items_price": "224.97", "total_line_items_price_set": {"shop_money": {"amount": "224.97", "currency_code": "EUR"}, "presentment_money": {"amount": "224.97", "currency_code": "EUR"}}, "total_outstanding": "0.00", "total_price": "238.47", "total_price_set": {"shop_money": {"amount": "238.47", "currency_code": "EUR"}, "presentment_money": {"amount": "238.47", "currency_code": "EUR"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "total_tax": "13.50", "total_tax_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:04-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823172, "admin_graphql_api_id": "gid://shopify/LineItem/1071823172", "fulfillable_quantity": 3, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1300, "name": "Big Brown Bear Boots", "price": "74.99", "price_set": {"shop_money": {"amount": "74.99", "currency_code": "EUR"}, "presentment_money": {"amount": "74.99", "currency_code": "EUR"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 3, "requires_shipping": true, "sku": null, "taxable": true, "title": "Big Brown Bear Boots", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "EUR"}, "presentment_money": {"amount": "0.00", "currency_code": "EUR"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "13.50", "price_set": {"shop_money": {"amount": "13.50", "currency_code": "EUR"}, "presentment_money": {"amount": "13.50", "currency_code": "EUR"}}, "rate": 0.06, "title": "State tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "title": "Big Brown Bear Boots", + "price": 74.99, + "grams": "1300", + "quantity": 3, + "tax_lines": [ + { + "price": 13.5, + "rate": 0.06, + "title": "State tax" + } + ] + } + ]; + order.transactions = [ + { + "kind": "sale", + "status": "success", + "amount": 238.47 + } + ]; + order.total_tax = 13.5; + order.currency = "EUR"; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"title": "Big Brown Bear Boots", "price": 74.99, "grams": "1300", "quantity": 3, "tax_lines": [{"price": 13.5, "rate": 0.06, "title": "State tax"}]}], "transactions": [{"kind": "sale", "status": "success", "amount": 238.47}], "total_tax": 13.5, "currency": "EUR"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 1073459968, "admin_graphql_api_id": "gid://shopify/Order/1073459968", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2023-01-03T12:27:26-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "partially_paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/668a72716da908e6a2e789db29dbedd6/authenticate?key=c0faefec830fe2bad8902a643f111263", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:26-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "668a72716da908e6a2e789db29dbedd6", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "149.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:26-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339475, "email": "paul.norman@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:26-05:00", "updated_at": "2023-01-03T12:27:26-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:26-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339475", "default_address": {"id": 1053317307, "customer_id": 1073339475, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823178, "admin_graphql_api_id": "gid://shopify/LineItem/1071823178", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + order.customer = { + "first_name": "Paul", + "last_name": "Norman", + "email": "paul.norman@example.com" + }; + order.billing_address = { + "first_name": "John", + "last_name": "Smith", + "address1": "123 Fake Street", + "phone": "555-555-5555", + "city": "Fakecity", + "province": "Ontario", + "country": "Canada", + "zip": "K2P 1L4" + }; + order.shipping_address = { + "first_name": "Jane", + "last_name": "Smith", + "address1": "123 Fake Street", + "phone": "777-777-7777", + "city": "Fakecity", + "province": "Ontario", + "country": "Canada", + "zip": "K2P 1L4" + }; + order.email = "jane@example.com"; + order.transactions = [ + { + "kind": "authorization", + "status": "success", + "amount": 50.0 + } + ]; + order.financial_status = "partially_paid"; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "customer": {"first_name": "Paul", "last_name": "Norman", "email": "paul.norman@example.com"}, "billing_address": {"first_name": "John", "last_name": "Smith", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4"}, "shipping_address": {"first_name": "Jane", "last_name": "Smith", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4"}, "email": "jane@example.com", "transactions": [{"kind": "authorization", "status": "success", "amount": 50.0}], "financial_status": "partially_paid"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 1073459965, "admin_graphql_api_id": "gid://shopify/Order/1073459965", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2023-01-03T12:26:32-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "pending", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/c7b936bf26ad5a982dcfa44a5685c79d/authenticate?key=94ef0aea48ebaa2a5c5ca9e24d1e6636", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:26:32-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "c7b936bf26ad5a982dcfa44a5685c79d", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:32-05:00", "user_id": null, "billing_address": null, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:26:33-05:00", "first_name": "Bob", "last_name": "Norman", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": null, "consent_updated_at": "2004-06-13T11:57:11-04:00"}, "sms_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2023-01-03T12:21:36-05:00", "consent_collected_from": "OTHER"}, "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823175, "admin_graphql_api_id": "gid://shopify/LineItem/1071823175", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + order.customer = { + "id": 207119551 + }; + order.financial_status = "pending"; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "customer": {"id": 207119551}, "financial_status": "pending"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 1073459973, "admin_graphql_api_id": "gid://shopify/Order/1073459973", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:28:24-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/db6850dd9d41e9787662d53205610280/authenticate?key=ef5e08b9b4f5dc44de217e892a73330b", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:28:24-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "db6850dd9d41e9787662d53205610280", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:24-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339477, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:28:24-05:00", "updated_at": "2023-01-03T12:28:24-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:28:24-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339477"}, "discount_applications": [], "fulfillments": [{"id": 1069019863, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019863", "created_at": "2023-01-03T12:28:25-05:00", "location_id": 24826418, "name": "#1002.1", "order_id": 1073459973, "origin_address": {}, "receipt": {}, "service": "shipwire-app", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2023-01-03T12:28:25-05:00", "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823185, "admin_graphql_api_id": "gid://shopify/LineItem/1071823185", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.email = "foo@example.com"; + order.fulfillment_status = "fulfilled"; + order.fulfillments = [ + { + "location_id": 24826418 + } + ]; + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders.json', + query: '', + headers, + data: { "order": {"email": "foo@example.com", "fulfillment_status": "fulfilled", "fulfillments": [{"location_id": 24826418}], "line_items": [{"variant_id": 447654529, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 1073459969, "admin_graphql_api_id": "gid://shopify/Order/1073459969", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:27:30-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/48b0719e537c3c333216675180fc0662/authenticate?key=e072883103b424ca776545c12110edd4", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:30-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "48b0719e537c3c333216675180fc0662", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:30-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823179, "admin_graphql_api_id": "gid://shopify/LineItem/1071823179", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"variant_id": 447654529, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 1073459967, "admin_graphql_api_id": "gid://shopify/Order/1073459967", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:27:09-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/a322d3b3d1add5bb8671897946a69cbe/authenticate?key=338368464f7b33742721bf04547e1c0b", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:09-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "a322d3b3d1add5bb8671897946a69cbe", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:09-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339474, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:09-05:00", "updated_at": "2023-01-03T12:27:10-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:09-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339474"}, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823177, "admin_graphql_api_id": "gid://shopify/LineItem/1071823177", "fulfillable_quantity": 0, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.email = "foo@example.com"; + order.fulfillment_status = "fulfilled"; + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders.json', + query: '', + headers, + data: { "order": {"email": "foo@example.com", "fulfillment_status": "fulfilled", "line_items": [{"variant_id": 447654529, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 1073459964, "admin_graphql_api_id": "gid://shopify/Order/1073459964", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "foo@example.com", "created_at": "2023-01-03T12:26:15-05:00", "currency": "USD", "current_subtotal_price": "199.00", "current_subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.00", "current_total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "foo@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/eecea5ec1db2273b6c5a895c8e13ff58/authenticate?key=a22af164f7a9206bb9254a0724447566", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:26:15-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "199.00", "subtotal_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "eecea5ec1db2273b6c5a895c8e13ff58", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "199.00", "total_price": "199.00", "total_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:15-05:00", "user_id": null, "billing_address": null, "customer": {"id": 1073339473, "email": "foo@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:26:15-05:00", "updated_at": "2023-01-03T12:26:16-05:00", "first_name": null, "last_name": null, "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:26:15-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339473"}, "discount_applications": [], "fulfillments": [{"id": 1069019862, "admin_graphql_api_id": "gid://shopify/Fulfillment/1069019862", "created_at": "2023-01-03T12:26:15-05:00", "location_id": 487838322, "name": "#1002.1", "order_id": 1073459964, "origin_address": {}, "receipt": {}, "service": "manual", "shipment_status": null, "status": "success", "tracking_company": null, "tracking_number": null, "tracking_numbers": [], "tracking_url": null, "tracking_urls": [], "updated_at": "2023-01-03T12:26:15-05:00", "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 1071823174, "admin_graphql_api_id": "gid://shopify/LineItem/1071823174", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 567, "name": "IPod Nano - 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.email = "foo@example.com"; + order.fulfillment_status = "fulfilled"; + order.send_receipt = true; + order.send_fulfillment_receipt = true; + order.line_items = [ + { + "variant_id": 457924702, + "quantity": 1 + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders.json', + query: '', + headers, + data: { "order": {"email": "foo@example.com", "fulfillment_status": "fulfilled", "send_receipt": true, "send_fulfillment_receipt": true, "line_items": [{"variant_id": 457924702, "quantity": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 1073459971, "admin_graphql_api_id": "gid://shopify/Order/1073459971", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": "jane@example.com", "created_at": "2023-01-03T12:27:42-05:00", "currency": "USD", "current_subtotal_price": "181.09", "current_subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_discounts": "17.91", "current_total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "181.09", "current_total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "current_total_tax": "0.00", "current_total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "FAKE30", "amount": "17.91", "type": "percentage"}], "email": "jane@example.com", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1b22331bf230d2f5b192b6c2965aff1/authenticate?key=a77ee802fb9a5928d3e50b38497a0710", "original_total_duties_set": null, "payment_gateway_names": [""], "phone": "+18885551234", "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:42-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "181.09", "subtotal_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "tags": "", "tax_lines": [], "taxes_included": false, "test": false, "token": "b1b22331bf230d2f5b192b6c2965aff1", "total_discounts": "17.91", "total_discounts_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "total_line_items_price": "199.00", "total_line_items_price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_outstanding": "131.09", "total_price": "181.09", "total_price_set": {"shop_money": {"amount": "181.09", "currency_code": "USD"}, "presentment_money": {"amount": "181.09", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "0.00", "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:42-05:00", "user_id": null, "billing_address": {"first_name": "John", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "John Smith", "country_code": "CA", "province_code": "ON"}, "customer": {"id": 1073339476, "email": "jane@example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:27:41-05:00", "updated_at": "2023-01-03T12:27:42-05:00", "first_name": "John", "last_name": "Smith", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "currency": "USD", "phone": null, "accepts_marketing_updated_at": "2023-01-03T12:27:41-05:00", "marketing_opt_in_level": null, "tax_exemptions": [], "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "admin_graphql_api_id": "gid://shopify/Customer/1073339476", "default_address": {"id": 1053317309, "customer_id": 1073339476, "first_name": "Jane", "last_name": "Smith", "company": null, "address1": "123 Fake Street", "address2": null, "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4", "phone": "777-777-7777", "name": "Jane Smith", "province_code": "ON", "country_code": "CA", "country_name": "Canada", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "manual", "value": "9.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "FAKE30", "description": "FAKE30"}], "fulfillments": [], "line_items": [{"id": 1071823183, "admin_graphql_api_id": "gid://shopify/LineItem/1071823183", "fulfillable_quantity": 1, "fulfillment_service": "shipwire-app", "fulfillment_status": null, "gift_card": false, "grams": 567, "name": "IPod Touch 8GB - Black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 921728736, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2009BLACK", "taxable": true, "title": "IPod Touch 8GB", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 447654529, "variant_inventory_management": "shipwire-app", "variant_title": "Black", "vendor": "Apple", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "17.91", "amount_set": {"shop_money": {"amount": "17.91", "currency_code": "USD"}, "presentment_money": {"amount": "17.91", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": {"first_name": "Jane", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "zip": "K2P 1L4", "province": "Ontario", "country": "Canada", "last_name": "Smith", "address2": null, "company": null, "latitude": null, "longitude": null, "name": "Jane Smith", "country_code": "CA", "province_code": "ON"}, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "variant_id": 447654529, + "quantity": 1 + } + ]; + order.email = "jane@example.com"; + order.phone = "18885551234"; + order.billing_address = { + "first_name": "John", + "last_name": "Smith", + "address1": "123 Fake Street", + "phone": "555-555-5555", + "city": "Fakecity", + "province": "Ontario", + "country": "Canada", + "zip": "K2P 1L4" + }; + order.shipping_address = { + "first_name": "Jane", + "last_name": "Smith", + "address1": "123 Fake Street", + "phone": "777-777-7777", + "city": "Fakecity", + "province": "Ontario", + "country": "Canada", + "zip": "K2P 1L4" + }; + order.transactions = [ + { + "kind": "sale", + "status": "success", + "amount": 50.0 + } + ]; + order.financial_status = "paid"; + order.discount_codes = [ + { + "code": "FAKE30", + "amount": "9.00", + "type": "percentage" + } + ]; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"variant_id": 447654529, "quantity": 1}], "email": "jane@example.com", "phone": "18885551234", "billing_address": {"first_name": "John", "last_name": "Smith", "address1": "123 Fake Street", "phone": "555-555-5555", "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4"}, "shipping_address": {"first_name": "Jane", "last_name": "Smith", "address1": "123 Fake Street", "phone": "777-777-7777", "city": "Fakecity", "province": "Ontario", "country": "Canada", "zip": "K2P 1L4"}, "transactions": [{"kind": "sale", "status": "success", "amount": 50.0}], "financial_status": "paid", "discount_codes": [{"code": "FAKE30", "amount": "9.00", "type": "percentage"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 1073459970, "admin_graphql_api_id": "gid://shopify/Order/1073459970", "app_id": 755357713, "browser_ip": null, "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": null, "checkout_token": null, "client_details": null, "closed_at": null, "confirmed": true, "contact_email": null, "created_at": "2023-01-03T12:27:34-05:00", "currency": "USD", "current_subtotal_price": "255.92", "current_subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "current_total_discounts": "0.00", "current_total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "270.37", "current_total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "current_total_tax": "14.45", "current_total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": null, "gateway": "", "landing_site": null, "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1002", "note": null, "note_attributes": [], "number": 2, "order_number": 1002, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/c92054d234b69c849746dd1dd0d1e3c5/authenticate?key=28bd5e97da3a1ed1e62ef43b0349ab20", "original_total_duties_set": null, "payment_gateway_names": [], "phone": null, "presentment_currency": "USD", "processed_at": "2023-01-03T12:27:34-05:00", "processing_method": "", "reference": null, "referring_site": null, "source_identifier": null, "source_name": "755357713", "source_url": null, "subtotal_price": "255.92", "subtotal_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "10.20", "rate": 0.06, "title": "State tax", "price_set": {"shop_money": {"amount": "10.20", "currency_code": "USD"}, "presentment_money": {"amount": "10.20", "currency_code": "USD"}}, "channel_liable": null}, {"price": "4.25", "rate": 0.025, "title": "County tax", "price_set": {"shop_money": {"amount": "4.25", "currency_code": "USD"}, "presentment_money": {"amount": "4.25", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "c92054d234b69c849746dd1dd0d1e3c5", "total_discounts": "0.00", "total_discounts_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_line_items_price": "255.92", "total_line_items_price_set": {"shop_money": {"amount": "255.92", "currency_code": "USD"}, "presentment_money": {"amount": "255.92", "currency_code": "USD"}}, "total_outstanding": "270.37", "total_price": "270.37", "total_price_set": {"shop_money": {"amount": "270.37", "currency_code": "USD"}, "presentment_money": {"amount": "270.37", "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "14.45", "total_tax_set": {"shop_money": {"amount": "14.45", "currency_code": "USD"}, "presentment_money": {"amount": "14.45", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:34-05:00", "user_id": null, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [], "line_items": [{"id": 1071823180, "admin_graphql_api_id": "gid://shopify/LineItem/1071823180", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 1700, "name": "Red Leather Coat", "price": "129.99", "price_set": {"shop_money": {"amount": "129.99", "currency_code": "USD"}, "presentment_money": {"amount": "129.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": true, "title": "Red Leather Coat", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "7.81", "price_set": {"shop_money": {"amount": "7.81", "currency_code": "USD"}, "presentment_money": {"amount": "7.81", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "3.26", "price_set": {"shop_money": {"amount": "3.26", "currency_code": "USD"}, "presentment_money": {"amount": "3.26", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}, {"id": 1071823181, "admin_graphql_api_id": "gid://shopify/LineItem/1071823181", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 750, "name": "Blue Suede Shoes", "price": "85.95", "price_set": {"shop_money": {"amount": "85.95", "currency_code": "USD"}, "presentment_money": {"amount": "85.95", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 1, "requires_shipping": true, "sku": null, "taxable": false, "title": "Blue Suede Shoes", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [], "duties": [], "discount_allocations": []}, {"id": 1071823182, "admin_graphql_api_id": "gid://shopify/LineItem/1071823182", "fulfillable_quantity": 2, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 320, "name": "Raspberry Beret", "price": "19.99", "price_set": {"shop_money": {"amount": "19.99", "currency_code": "USD"}, "presentment_money": {"amount": "19.99", "currency_code": "USD"}}, "product_exists": false, "product_id": null, "properties": [], "quantity": 2, "requires_shipping": true, "sku": null, "taxable": true, "title": "Raspberry Beret", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": null, "variant_inventory_management": null, "variant_title": null, "vendor": null, "tax_lines": [{"channel_liable": null, "price": "2.39", "price_set": {"shop_money": {"amount": "2.39", "currency_code": "USD"}, "presentment_money": {"amount": "2.39", "currency_code": "USD"}}, "rate": 0.06, "title": "State tax"}, {"channel_liable": null, "price": "0.99", "price_set": {"shop_money": {"amount": "0.99", "currency_code": "USD"}, "presentment_money": {"amount": "0.99", "currency_code": "USD"}}, "rate": 0.025, "title": "County tax"}], "duties": [], "discount_allocations": []}], "payment_details": null, "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": []}})); + + const order = new shopify.rest.Order({session: session}); + order.line_items = [ + { + "title": "Red Leather Coat", + "price": 129.99, + "grams": "1700", + "quantity": 1 + }, + { + "title": "Blue Suede Shoes", + "price": 85.95, + "grams": "750", + "quantity": 1, + "taxable": false + }, + { + "title": "Raspberry Beret", + "price": 19.99, + "grams": "320", + "quantity": 2 + } + ]; + order.tax_lines = [ + { + "price": 10.2, + "rate": 0.06, + "title": "State tax" + }, + { + "price": 4.25, + "rate": 0.025, + "title": "County tax" + } + ]; + order.total_tax = 14.45; + await order.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders.json', + query: '', + headers, + data: { "order": {"line_items": [{"title": "Red Leather Coat", "price": 129.99, "grams": "1700", "quantity": 1}, {"title": "Blue Suede Shoes", "price": 85.95, "grams": "750", "quantity": 1, "taxable": false}, {"title": "Raspberry Beret", "price": 19.99, "grams": "320", "quantity": 2}], "tax_lines": [{"price": 10.2, "rate": 0.06, "title": "State tax"}, {"price": 4.25, "rate": 0.025, "title": "County tax"}], "total_tax": 14.45} } + }).toMatchMadeHttpRequest(); + }); + + it('test_25', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:22-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_26', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": "Customer contacted us about a custom engraving on this iPod", "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:57-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.note = "Customer contacted us about a custom engraving on this iPod"; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"note": "Customer contacted us about a custom engraving on this iPod"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_27', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "colour", "value": "red"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:22-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.note_attributes = [ + { + "name": "colour", + "value": "red" + } + ]; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"note_attributes": [{"name": "colour", "value": "red"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_28', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "a-different@email.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "a-different@email.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:53-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.email = "a-different@email.com"; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"email": "a-different@email.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_29', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+15145556677", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:26:07-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.phone = "+15145556677"; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"phone": "+15145556677"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_30', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": true, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:36-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.buyer_accepts_marketing = true; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"buyer_accepts_marketing": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_31', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:27-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.customer = null; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"customer": null} } + }).toMatchMadeHttpRequest(); + }); + + it('test_32', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "External, Inbound, Outbound", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:28:09-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.tags = "External, Inbound, Outbound"; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"tags": "External, Inbound, Outbound"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_33', async () => { + queueMockResponse(JSON.stringify({"order": {"id": 450789469, "admin_graphql_api_id": "gid://shopify/Order/450789469", "app_id": null, "browser_ip": "0.0.0.0", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": "68778783ad298f1c80c3bafcddeea02f", "checkout_id": 901414060, "checkout_token": "bd5a8aa1ecd019dd3520ff791ee3a24c", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "0.0.0.0", "browser_width": null, "session_hash": null, "user_agent": null}, "closed_at": null, "confirmed": true, "contact_email": "bob.norman@mail.example.com", "created_at": "2008-01-10T11:00:00-05:00", "currency": "USD", "current_subtotal_price": "195.67", "current_subtotal_price_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "current_total_discounts": "3.33", "current_total_discounts_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": "199.65", "current_total_price_set": {"shop_money": {"amount": "199.65", "currency_code": "USD"}, "presentment_money": {"amount": "199.65", "currency_code": "USD"}}, "current_total_tax": "3.98", "current_total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "customer_locale": null, "device_id": null, "discount_codes": [{"code": "TENOFF", "amount": "10.00", "type": "fixed_amount"}], "email": "bob.norman@mail.example.com", "estimated_taxes": false, "financial_status": "partially_refunded", "fulfillment_status": null, "gateway": "authorize_net", "landing_site": "http://www.example.com?source=abc", "landing_site_ref": "abc", "location_id": null, "name": "#1001", "note": null, "note_attributes": [{"name": "custom engraving", "value": "Happy Birthday"}, {"name": "colour", "value": "green"}], "number": 1, "order_number": 1001, "order_status_url": "https://jsmith.myshopify.com/548380009/orders/b1946ac92492d2347c6235b4d2611184/authenticate?key=imasecretipod", "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": "+557734881234", "presentment_currency": "USD", "processed_at": "2008-01-10T11:00:00-05:00", "processing_method": "direct", "reference": "fhwdgads", "referring_site": "http://www.otherexample.com", "source_identifier": "fhwdgads", "source_name": "web", "source_url": null, "subtotal_price": "597.00", "subtotal_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "tags": "", "tax_lines": [{"price": "11.94", "rate": 0.06, "title": "State Tax", "price_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "channel_liable": null}], "taxes_included": false, "test": false, "token": "b1946ac92492d2347c6235b4d2611184", "total_discounts": "10.00", "total_discounts_set": {"shop_money": {"amount": "10.00", "currency_code": "USD"}, "presentment_money": {"amount": "10.00", "currency_code": "USD"}}, "total_line_items_price": "597.00", "total_line_items_price_set": {"shop_money": {"amount": "597.00", "currency_code": "USD"}, "presentment_money": {"amount": "597.00", "currency_code": "USD"}}, "total_outstanding": "0.00", "total_price": "598.94", "total_price_set": {"shop_money": {"amount": "598.94", "currency_code": "USD"}, "presentment_money": {"amount": "598.94", "currency_code": "USD"}}, "total_price_usd": "598.94", "total_shipping_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "total_tax": "11.94", "total_tax_set": {"shop_money": {"amount": "11.94", "currency_code": "USD"}, "presentment_money": {"amount": "11.94", "currency_code": "USD"}}, "total_tip_received": "0.00", "total_weight": 0, "updated_at": "2023-01-03T12:27:07-05:00", "user_id": null, "billing_address": {"first_name": "Bob", "address1": "Chestnut Street 92", "phone": "+1(502)-459-2181", "city": "Louisville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "customer": {"id": 207119551, "email": "bob.norman@mail.example.com", "accepts_marketing": false, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "first_name": "Bob", "last_name": "Norman", "orders_count": 1, "state": "disabled", "total_spent": "199.65", "last_order_id": 450789469, "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "tags": "", "last_order_name": "#1001", "currency": "USD", "phone": "+16136120707", "accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00", "marketing_opt_in_level": null, "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/207119551", "default_address": {"id": 207119551, "customer_id": 207119551, "first_name": null, "last_name": null, "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "country": "United States", "zip": "40202", "phone": "555-625-1199", "name": "", "province_code": "KY", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "discount_code", "value": "10.0", "value_type": "fixed_amount", "allocation_method": "across", "target_selection": "all", "code": "TENOFF"}], "fulfillments": [{"id": 255858046, "admin_graphql_api_id": "gid://shopify/Fulfillment/255858046", "created_at": "2023-01-03T12:21:36-05:00", "location_id": 655441491, "name": "#1001.0", "order_id": 450789469, "receipt": {"testcase": true, "authorization": "123456"}, "service": "manual", "shipment_status": null, "status": "failure", "tracking_company": "USPS", "tracking_number": "1Z2345", "tracking_numbers": ["1Z2345"], "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345", "tracking_urls": ["https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=1Z2345"], "updated_at": "2023-01-03T12:21:36-05:00", "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 518995019, "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "fulfillable_quantity": 1, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - red", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008RED", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 49148385, "variant_inventory_management": "shopify", "variant_title": "red", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}, {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "refunds": [{"id": 509562969, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "created_at": "2023-01-03T12:21:36-05:00", "note": "it broke during shipping", "order_id": 450789469, "processed_at": "2023-01-03T12:21:36-05:00", "restock": true, "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "user_id": 548380009, "order_adjustments": [], "transactions": [{"id": 179259969, "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969", "amount": "209.00", "authorization": "authorization-key", "created_at": "2005-08-05T12:59:12-04:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": null, "order_id": 450789469, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "receipt": {}, "source_name": "web", "status": "success", "test": false, "user_id": null}], "refund_line_items": [{"id": 104689539, "line_item_id": 703073504, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.66, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - black", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008BLACK", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 457924702, "variant_inventory_management": "shopify", "variant_title": "black", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.33", "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}, "discount_application_index": 0}]}}, {"id": 709875399, "line_item_id": 466157049, "location_id": 487838322, "quantity": 1, "restock_type": "legacy_restock", "subtotal": 195.67, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax": 3.98, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 200, "name": "IPod Nano - 8gb - green", "price": "199.00", "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 632910392, "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "quantity": 1, "requires_shipping": true, "sku": "IPOD2008GREEN", "taxable": true, "title": "IPod Nano - 8gb", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 39072856, "variant_inventory_management": "shopify", "variant_title": "green", "vendor": null, "tax_lines": [{"channel_liable": null, "price": "3.98", "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "rate": 0.06, "title": "State Tax"}], "duties": [], "discount_allocations": [{"amount": "3.34", "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": {"first_name": "Bob", "address1": "123 Ship Street", "phone": "+1(502)-459-2181", "city": "Shipsville", "zip": "40202", "province": "Kentucky", "country": "United States", "last_name": "Norman", "address2": "", "company": null, "latitude": 45.41634, "longitude": -75.6868, "name": "Bob Norman", "country_code": "US", "province_code": "KY"}, "shipping_lines": [{"id": 369256396, "carrier_identifier": null, "code": "Free Shipping", "delivery_category": null, "discounted_price": "0.00", "discounted_price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "phone": null, "price": "0.00", "price_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "requested_fulfillment_service_id": null, "source": "shopify", "title": "Free Shipping", "tax_lines": [], "discount_allocations": []}]}})); + + const order = new shopify.rest.Order({session: session}); + order.id = 450789469; + order.shipping_address = { + "address1": "123 Ship Street", + "city": "Shipsville" + }; + await order.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: { "order": {"shipping_address": {"address1": "123 Ship Street", "city": "Shipsville"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_34', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Order.delete({ + session: session, + id: 450789469, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/orders/450789469.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/order_risk.test.ts b/rest/admin/__tests__/2023-01/order_risk.test.ts new file mode 100644 index 000000000..19a2c9e2f --- /dev/null +++ b/rest/admin/__tests__/2023-01/order_risk.test.ts @@ -0,0 +1,135 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('OrderRisk resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"risk": {"id": 1029151490, "order_id": 450789469, "checkout_id": 901414060, "source": "External", "score": "1.0", "recommendation": "cancel", "display": true, "cause_cancel": true, "message": "This order came from an anonymous proxy", "merchant_message": "This order came from an anonymous proxy"}})); + + const order_risk = new shopify.rest.OrderRisk({session: session}); + order_risk.order_id = 450789469; + order_risk.message = "This order came from an anonymous proxy"; + order_risk.recommendation = "cancel"; + order_risk.score = 1.0; + order_risk.source = "External"; + order_risk.cause_cancel = true; + order_risk.display = true; + await order_risk.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/risks.json', + query: '', + headers, + data: { "risk": {"message": "This order came from an anonymous proxy", "recommendation": "cancel", "score": 1.0, "source": "External", "cause_cancel": true, "display": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"risks": [{"id": 284138680, "order_id": 450789469, "checkout_id": null, "source": "External", "score": "1.0", "recommendation": "cancel", "display": true, "cause_cancel": true, "message": "This order was placed from a proxy IP", "merchant_message": "This order was placed from a proxy IP"}, {"id": 1029151489, "order_id": 450789469, "checkout_id": 901414060, "source": "External", "score": "1.0", "recommendation": "cancel", "display": true, "cause_cancel": true, "message": "This order came from an anonymous proxy", "merchant_message": "This order came from an anonymous proxy"}]})); + + await shopify.rest.OrderRisk.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/risks.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"risk": {"id": 284138680, "order_id": 450789469, "checkout_id": null, "source": "External", "score": "1.0", "recommendation": "cancel", "display": true, "cause_cancel": true, "message": "This order was placed from a proxy IP", "merchant_message": "This order was placed from a proxy IP"}})); + + await shopify.rest.OrderRisk.find({ + session: session, + order_id: 450789469, + id: 284138680, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/risks/284138680.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"risk": {"order_id": 450789469, "cause_cancel": false, "message": "After further review, this is a legitimate order", "recommendation": "accept", "score": "0.0", "source": "External", "id": 284138680, "checkout_id": null, "display": true, "merchant_message": "After further review, this is a legitimate order"}})); + + const order_risk = new shopify.rest.OrderRisk({session: session}); + order_risk.order_id = 450789469; + order_risk.id = 284138680; + order_risk.message = "After further review, this is a legitimate order"; + order_risk.recommendation = "accept"; + order_risk.source = "External"; + order_risk.cause_cancel = false; + order_risk.score = 0.0; + await order_risk.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/orders/450789469/risks/284138680.json', + query: '', + headers, + data: { "risk": {"message": "After further review, this is a legitimate order", "recommendation": "accept", "source": "External", "cause_cancel": false, "score": 0.0} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.OrderRisk.delete({ + session: session, + order_id: 450789469, + id: 284138680, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/orders/450789469/risks/284138680.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/page.test.ts b/rest/admin/__tests__/2023-01/page.test.ts new file mode 100644 index 000000000..36cf12911 --- /dev/null +++ b/rest/admin/__tests__/2023-01/page.test.ts @@ -0,0 +1,284 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Page resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"pages": [{"id": 108828309, "title": "Sample Page", "shop_id": 548380009, "handle": "sample", "body_html": "

this is a sample page.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}, {"id": 322471, "title": "Support", "shop_id": 548380009, "handle": "support", "body_html": "

Come in store for support.

", "author": "Dennis", "created_at": "2009-07-15T20:00:00-04:00", "updated_at": "2009-07-16T20:00:00-04:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"}, {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}]})); + + await shopify.rest.Page.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/pages.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"pages": [{"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}, {"id": 169524623, "title": "Store hours", "shop_id": 548380009, "handle": "store-hours", "body_html": "

We never close.

", "author": "Jobs", "created_at": "2013-12-31T19:00:00-05:00", "updated_at": "2013-12-31T19:00:00-05:00", "published_at": "2014-02-01T19:00:00-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"}]})); + + await shopify.rest.Page.all({ + session: session, + since_id: "108828309", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/pages.json', + query: 'since_id=108828309', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"page": {"id": 1025371373, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:23:38-05:00", "updated_at": "2023-01-03T12:23:38-05:00", "published_at": "2023-01-03T12:23:38-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371373"}})); + + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + await page.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/pages.json', + query: '', + headers, + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"page": {"id": 1025371369, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:22:57-05:00", "updated_at": "2023-01-03T12:22:57-05:00", "published_at": "2023-01-03T12:22:57-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371369"}})); + + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.metafields = [ + { + "key": "new", + "value": "new value", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await page.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/pages.json', + query: '', + headers, + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"page": {"id": 1025371374, "title": "Warranty information", "shop_id": 548380009, "handle": "warranty-information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "author": "Shopify API", "created_at": "2023-01-03T12:23:49-05:00", "updated_at": "2023-01-03T12:23:49-05:00", "published_at": null, "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371374"}})); + + const page = new shopify.rest.Page({session: session}); + page.title = "Warranty information"; + page.body_html = "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

"; + page.published = false; + await page.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/pages.json', + query: '', + headers, + data: { "page": {"title": "Warranty information", "body_html": "

Warranty

\n

Returns accepted if we receive items 30 days after purchase.

", "published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"count": 4})); + + await shopify.rest.Page.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/pages/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"page": {"id": 131092082, "title": "Terms of Services", "shop_id": 548380009, "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2008-07-16T20:00:00-04:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + + await shopify.rest.Page.find({ + session: session, + id: 131092082, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/pages/131092082.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:26-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.metafields = [ + { + "key": "new", + "value": "new value", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"metafields": [{"key": "new", "value": "new value", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": null, "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:07-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.published = false; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "published_at": "2023-01-03T12:23:46-05:00", "title": "Terms of Services", "handle": "tos", "body_html": "

We make perfect stuff, we don't need a warranty.

", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:46-05:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.published = true; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "author": "Christopher Gorski", "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "handle": "new-warranty", "title": "New warranty", "id": 131092082, "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:28-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; + page.author = "Christopher Gorski"; + page.title = "New warranty"; + page.handle = "new-warranty"; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "author": "Christopher Gorski", "title": "New warranty", "handle": "new-warranty"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"page": {"shop_id": 548380009, "body_html": "

Returns accepted if we receive the items 14 days after purchase.

", "title": "Terms of Services", "handle": "tos", "id": 131092082, "author": "Dennis", "created_at": "2008-07-15T20:00:00-04:00", "updated_at": "2023-01-03T12:23:08-05:00", "published_at": "2008-07-15T20:00:00-04:00", "template_suffix": null, "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"}})); + + const page = new shopify.rest.Page({session: session}); + page.id = 131092082; + page.body_html = "

Returns accepted if we receive the items 14 days after purchase.

"; + await page.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/pages/131092082.json', + query: '', + headers, + data: { "page": {"body_html": "

Returns accepted if we receive the items 14 days after purchase.

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Page.delete({ + session: session, + id: 131092082, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/pages/131092082.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/payment.test.ts b/rest/admin/__tests__/2023-01/payment.test.ts new file mode 100644 index 000000000..a3682f8d1 --- /dev/null +++ b/rest/admin/__tests__/2023-01/payment.test.ts @@ -0,0 +1,132 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Payment resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"payment": {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "398.00", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {"testcase": true, "authorization": "123456"}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}}, "credit_card": null}, {"id": 1071573808, "unique_token": "client-side-idempotency-token", "payment_processing_error_message": null, "fraudulent": false, "transaction": null, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "398.00", "total_tax": "0.00", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2023-01-03T12:42:43-05:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "424242", "last_digits": "4242", "brand": "bogus", "expiry_month": 9, "expiry_year": 2024, "customer_id": 207119551}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + + const payment = new shopify.rest.Payment({session: session}); + payment.checkout_id = "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x"; + payment.request_details = { + "ip_address": "123.1.1.1", + "accept_language": "en-US,en;q=0.8,fr;q=0.6", + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" + }; + payment.amount = "398.00"; + payment.session_id = "global-d127b9b88aa1043d"; + payment.unique_token = "client-side-idempotency-token"; + await payment.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments.json', + query: '', + headers, + data: { "payment": {"request_details": {"ip_address": "123.1.1.1", "accept_language": "en-US,en;q=0.8,fr;q=0.6", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, "amount": "398.00", "session_id": "global-d127b9b88aa1043d", "unique_token": "client-side-idempotency-token"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "transaction": {"amount": "598.94", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": "authorization-key", "created_at": "2005-08-01T11:57:11-04:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 389404469, "kind": "authorization", "message": null, "status": "success", "test": false}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}]})); + + await shopify.rest.Payment.all({ + session: session, + checkout_id: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:23-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278482, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:23-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278482, "kind": "authorization", "message": null, "status": "failure", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + + await shopify.rest.Payment.find({ + session: session, + checkout_id: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + id: 25428999, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments/25428999.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"payment": {"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "next_action": {"redirect_url": null}, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:30-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278483, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null, "checkout": {"completed_at": null, "created_at": "2012-10-12T07:05:27-04:00", "currency": "USD", "presentment_currency": "USD", "customer_id": 207119551, "customer_locale": "en", "device_id": null, "discount_code": null, "discount_codes": [], "email": "bob.norman@mail.example.com", "legal_notice_url": null, "location_id": null, "name": "#446514532", "note": "", "note_attributes": {"custom engraving": "Happy Birthday", "colour": "green"}, "order_id": null, "order_status_url": null, "order": null, "payment_due": "419.49", "payment_url": "https://app.local/cardserver/sessions", "payments": [{"id": 25428999, "unique_token": "e01e661f4a99acd9dcdg6f1422d0d6f7", "payment_processing_error_message": null, "fraudulent": false, "transaction": {"amount": "419.49", "amount_in": null, "amount_out": null, "amount_rounding": null, "authorization": null, "created_at": "2023-01-03T12:42:30-05:00", "currency": "USD", "error_code": null, "parent_id": null, "gateway": "bogus", "id": 1068278483, "kind": "authorization", "message": null, "status": "success", "test": false, "receipt": {}, "location_id": null, "user_id": null, "transaction_group_id": null, "device_id": null, "payment_details": null}, "credit_card": null}], "phone": null, "shopify_payments_account_id": null, "privacy_policy_url": null, "refund_policy_url": null, "requires_shipping": true, "reservation_time_left": 0, "reservation_time": null, "source_identifier": null, "source_name": "web", "source_url": null, "subscription_policy_url": null, "subtotal_price": "398.00", "shipping_policy_url": null, "tax_exempt": false, "taxes_included": false, "terms_of_sale_url": null, "terms_of_service_url": null, "token": "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_price": "419.49", "total_tax": "21.49", "total_tip_received": "0.00", "total_line_items_price": "398.00", "updated_at": "2012-10-12T07:05:27-04:00", "user_id": null, "web_url": "https://checkout.local/548380009/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", "total_duties": null, "total_additional_fees": null, "line_items": [{"id": "71e61dc0fa94a2fc", "key": "71e61dc0fa94a2fc", "product_id": 632910392, "variant_id": 49148385, "sku": "IPOD2008RED", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Red", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}, {"id": "d76e2360549fc5e0", "key": "d76e2360549fc5e0", "product_id": 632910392, "variant_id": 808950810, "sku": "IPOD2008PINK", "vendor": "Apple", "title": "IPod Nano - 8GB", "variant_title": "Pink", "image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672766496", "taxable": true, "requires_shipping": true, "gift_card": false, "price": "199.00", "compare_at_price": null, "line_price": "199.00", "properties": {}, "quantity": 1, "grams": 200, "fulfillment_service": "manual", "applied_discounts": [], "discount_allocations": [], "tax_lines": []}], "gift_cards": [], "tax_lines": [{"price": "21.49", "rate": 0.06, "title": "State Tax", "compare_at": 0.06}], "tax_manipulations": [], "shipping_line": {"handle": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping", "tax_lines": []}, "shipping_rate": {"id": "shopify-Free%20Shipping-0.00", "price": "0.00", "title": "Free Shipping"}, "shipping_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "credit_card": {"first_name": "Bob", "last_name": "Norman", "first_digits": "1", "last_digits": "1", "brand": "bogus", "expiry_month": 8, "expiry_year": 2042, "customer_id": null}, "billing_address": {"id": 550558813, "first_name": "Bob", "last_name": "Norman", "phone": "+1(502)-459-2181", "company": null, "address1": "Chestnut Street 92", "address2": "", "city": "Louisville", "province": "Kentucky", "province_code": "KY", "country": "United States", "country_code": "US", "zip": "40202"}, "applied_discount": null, "applied_discounts": [], "discount_violations": []}}})); + + await shopify.rest.Payment.find({ + session: session, + checkout_id: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + id: 25428999, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments/25428999.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Payment.count({ + session: session, + checkout_id: "7yjf4v2we7gamku6a6h7tvm8h3mmvs4x", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/checkouts/7yjf4v2we7gamku6a6h7tvm8h3mmvs4x/payments/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/payment_gateway.test.ts b/rest/admin/__tests__/2023-01/payment_gateway.test.ts new file mode 100644 index 000000000..c931aeb19 --- /dev/null +++ b/rest/admin/__tests__/2023-01/payment_gateway.test.ts @@ -0,0 +1,140 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('PaymentGateway resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:58-05:00", "credential4": null, "attachment": null}, {"disabled": true, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": false, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00"}]})); + + await shopify.rest.PaymentGateway.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/payment_gateways.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"payment_gateways": [{"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:52-05:00", "credential4": null, "attachment": null}]})); + + await shopify.rest.PaymentGateway.all({ + session: session, + disabled: "false", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/payment_gateways.json', + query: 'disabled=false', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 1048196722, "name": "authorize_net", "provider_id": 7, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club", "jcb"], "processing_method": "direct", "service_name": "Authorize.net", "metadata": {}, "created_at": "2023-01-03T12:21:57-05:00", "updated_at": "2023-01-03T12:21:57-05:00", "credential1": "someone@example.com", "credential3": null, "credential4": null, "attachment": null}})); + + const payment_gateway = new shopify.rest.PaymentGateway({session: session}); + payment_gateway.credential1 = "someone@example.com"; + payment_gateway.provider_id = 7; + await payment_gateway.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/payment_gateways.json', + query: '', + headers, + data: { "payment_gateway": {"credential1": "someone@example.com", "provider_id": 7} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"payment": {"disabled": false, "id": 431363653, "name": "shopify_payments", "provider_id": 87, "sandbox": false, "supports_network_tokenization": null, "type": "DirectPaymentGateway", "enabled_card_brands": ["visa", "master", "american_express", "discover", "diners_club"], "processing_method": "direct", "service_name": "Shopify Payments", "metadata": {"google_pay_merchant_id": 548380009}, "created_at": "2011-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:21:54-05:00", "credential4": null, "attachment": null}})); + + await shopify.rest.PaymentGateway.find({ + session: session, + id: 431363653, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/payment_gateways/431363653.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"payment_gateway": {"disabled": false, "id": 170508070, "name": "Cash on Delivery (COD)", "provider_id": 140, "sandbox": true, "supports_network_tokenization": null, "type": "ManualPaymentGateway", "enabled_card_brands": [], "processing_method": "manual", "service_name": "Cash on Delivery (COD)", "metadata": {}, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:22:03-05:00"}})); + + const payment_gateway = new shopify.rest.PaymentGateway({session: session}); + payment_gateway.id = 170508070; + payment_gateway.sandbox = true; + await payment_gateway.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/payment_gateways/170508070.json', + query: '', + headers, + data: { "payment_gateway": {"sandbox": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.PaymentGateway.delete({ + session: session, + id: 170508070, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/payment_gateways/170508070.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/payment_transaction.test.ts b/rest/admin/__tests__/2023-01/payment_transaction.test.ts new file mode 100644 index 000000000..817809a34 --- /dev/null +++ b/rest/admin/__tests__/2023-01/payment_transaction.test.ts @@ -0,0 +1,51 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('PaymentTransaction resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"transactions": [{"id": 699519475, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-50.00", "fee": "0.00", "net": "-50.00", "source_id": 460709370, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2022-10-04T13:07:13-04:00"}, {"id": 77412310, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "50.00", "fee": "0.00", "net": "50.00", "source_id": 374511569, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2022-10-04T13:07:13-04:00"}, {"id": 1006917261, "type": "refund", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-3.45", "fee": "0.00", "net": "-3.45", "source_id": 1006917261, "source_type": "Payments::Refund", "source_order_id": 217130470, "source_order_transaction_id": 1006917261, "processed_at": "2022-10-03T13:07:13-04:00"}, {"id": 777128868, "type": "refund", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-8.05", "fee": "0.00", "net": "-8.05", "source_id": 777128868, "source_type": "Payments::Refund", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2022-10-03T13:07:13-04:00"}, {"id": 758509248, "type": "adjustment", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-1.50", "fee": "-0.25", "net": "-1.75", "source_id": 764194150, "source_type": "charge", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2022-10-03T13:07:13-04:00"}, {"id": 746296004, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "10.00", "fee": "2.00", "net": "8.00", "source_id": 746296004, "source_type": "charge", "source_order_id": 625362839, "source_order_transaction_id": 890672011, "processed_at": "2022-10-03T13:07:13-04:00"}, {"id": 515523000, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "11.50", "fee": "0.65", "net": "10.85", "source_id": 1006917261, "source_type": "Payments::Refund", "source_order_id": 217130470, "source_order_transaction_id": 1006917261, "processed_at": "2022-10-03T13:07:13-04:00"}, {"id": 482793472, "type": "adjustment", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "0.45", "fee": "0.00", "net": "0.45", "source_id": 204289877, "source_type": "charge", "source_order_id": 217130470, "source_order_transaction_id": 567994517, "processed_at": "2022-10-03T13:07:13-04:00"}, {"id": 382557793, "type": "adjustment", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "0.20", "fee": "0.00", "net": "0.20", "source_id": 204289877, "source_type": "charge", "source_order_id": 217130470, "source_order_transaction_id": 567994517, "processed_at": "2022-10-03T13:07:13-04:00"}, {"id": 201521674, "type": "refund", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-2.00", "fee": "0.00", "net": "-2.00", "source_id": 971443537, "source_type": "charge", "source_order_id": 625362839, "source_order_transaction_id": 461790020, "processed_at": "2022-10-03T13:07:13-04:00"}, {"id": 188711209, "type": "capture", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-11.37", "fee": "0.00", "net": "-11.37", "source_id": 188711209, "source_type": "charge", "source_order_id": 923751907, "source_order_transaction_id": 972637531, "processed_at": "2022-10-03T13:07:13-04:00"}, {"id": 726130462, "type": "dispute", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-11.50", "fee": "15.00", "net": "-26.50", "source_id": 598735659, "source_type": "Payments::Dispute", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2022-09-23T13:07:13-04:00"}, {"id": 996672915, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "0.00", "net": "-100.00", "source_id": 996672915, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 843310825, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "11.50", "fee": "0.63", "net": "10.87", "source_id": 843310825, "source_type": "charge", "source_order_id": 625362839, "source_order_transaction_id": 897736458, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 841651232, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "0.00", "net": "-100.00", "source_id": 841651232, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 717600021, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 717600021, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 645292099, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 717600021, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 620327031, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "11.50", "fee": "0.63", "net": "10.87", "source_id": 620327031, "source_type": "charge", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 504303358, "type": "seller_protection_credit_reversal", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-100.00", "fee": "0.00", "net": "-100.00", "source_id": 504303358, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 427940661, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "150.00", "fee": "0.00", "net": "150.00", "source_id": 427940661, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 400852343, "type": "reserve", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-42.00", "fee": "0.00", "net": "-42.00", "source_id": null, "source_type": null, "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 381560291, "type": "debit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-150.00", "fee": "0.00", "net": "-150.00", "source_id": 381560291, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 357948134, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "10.00", "fee": "0.46", "net": "9.54", "source_id": 971443537, "source_type": "charge", "source_order_id": 625362839, "source_order_transaction_id": 461790020, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 344667176, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 291591126, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 250467535, "type": "reserve", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "42.00", "fee": "0.00", "net": "42.00", "source_id": null, "source_type": null, "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 217609728, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "11.50", "fee": "0.00", "net": "11.50", "source_id": 930299385, "source_type": "charge", "source_order_id": 625362839, "source_order_transaction_id": 348327371, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 138130604, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "150.00", "fee": "0.00", "net": "150.00", "source_id": 138130604, "source_type": "Payments::Balance::AdjustmentReversal", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 105879119, "type": "credit", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "100.00", "fee": "0.00", "net": "100.00", "source_id": 105879119, "source_type": "adjustment", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2016-08-04T18:07:57-04:00"}, {"id": 567994517, "type": "charge", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "11.50", "fee": "0.65", "net": "10.85", "source_id": 204289877, "source_type": "charge", "source_order_id": 217130470, "source_order_transaction_id": 567994517, "processed_at": "2014-01-21T13:05:38-05:00"}, {"id": 854848137, "type": "payout", "test": false, "payout_id": 623721858, "payout_status": "paid", "currency": "USD", "amount": "-41.90", "fee": "0.00", "net": "-41.90", "source_id": 623721858, "source_type": "payout", "source_order_id": null, "source_order_transaction_id": null, "processed_at": "2012-11-11T19:00:00-05:00"}]})); + + await shopify.rest.PaymentTransaction.transactions({ + session: session, + payout_id: "623721858", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shopify_payments/balance/transactions.json', + query: 'payout_id=623721858', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/payout.test.ts b/rest/admin/__tests__/2023-01/payout.test.ts new file mode 100644 index 000000000..774cb740e --- /dev/null +++ b/rest/admin/__tests__/2023-01/payout.test.ts @@ -0,0 +1,86 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Payout resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"payouts": [{"id": 867808544, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 725076685, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 714327683, "status": "failed", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 631321250, "status": "scheduled", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 623721858, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}]})); + + await shopify.rest.Payout.all({ + session: session, + date_max: "2012-11-12", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shopify_payments/payouts.json', + query: 'date_max=2012-11-12', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"payouts": [{"id": 854088011, "status": "scheduled", "date": "2013-11-01", "currency": "USD", "amount": "43.12", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "45.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 512467833, "status": "failed", "date": "2013-11-01", "currency": "USD", "amount": "43.12", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "45.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 39438702, "status": "in_transit", "date": "2013-11-01", "currency": "USD", "amount": "43.12", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "45.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 710174591, "status": "paid", "date": "2012-12-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 974708905, "status": "paid", "date": "2012-11-13", "currency": "CAD", "amount": "51.69", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "6.46", "charges_gross_amount": "58.15", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 867808544, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 725076685, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 714327683, "status": "failed", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 631321250, "status": "scheduled", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}, {"id": 623721858, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}]})); + + await shopify.rest.Payout.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shopify_payments/payouts.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"payout": {"id": 623721858, "status": "paid", "date": "2012-11-12", "currency": "USD", "amount": "41.90", "summary": {"adjustments_fee_amount": "0.12", "adjustments_gross_amount": "2.13", "charges_fee_amount": "1.32", "charges_gross_amount": "44.52", "refunds_fee_amount": "-0.23", "refunds_gross_amount": "-3.54", "reserved_funds_fee_amount": "0.00", "reserved_funds_gross_amount": "0.00", "retried_payouts_fee_amount": "0.00", "retried_payouts_gross_amount": "0.00"}}})); + + await shopify.rest.Payout.find({ + session: session, + id: 623721858, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shopify_payments/payouts/623721858.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/policy.test.ts b/rest/admin/__tests__/2023-01/policy.test.ts new file mode 100644 index 000000000..5ce4eef1b --- /dev/null +++ b/rest/admin/__tests__/2023-01/policy.test.ts @@ -0,0 +1,50 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Policy resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"policies": [{"body": "You have 30 days to get a refund", "created_at": "2023-01-03T12:39:49-05:00", "updated_at": "2023-01-03T12:39:49-05:00", "handle": "refund-policy", "title": "Refund policy", "url": "https://jsmith.myshopify.com/548380009/policies/878590288"}]})); + + await shopify.rest.Policy.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/policies.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/price_rule.test.ts b/rest/admin/__tests__/2023-01/price_rule.test.ts new file mode 100644 index 000000000..6a3f35a32 --- /dev/null +++ b/rest/admin/__tests__/2023-01/price_rule.test.ts @@ -0,0 +1,253 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('PriceRule resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341481, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "allocation_limit": 3, "once_per_customer": false, "usage_limit": null, "starts_at": "2018-03-21T20:00:00-04:00", "ends_at": null, "created_at": "2023-01-03T12:06:59-05:00", "updated_at": "2023-01-03T12:06:59-05:00", "entitled_product_ids": [921728736], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [841564295], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "Buy2iPodsGetiPodTouchForFree", "admin_graphql_api_id": "gid://shopify/PriceRule/996341481"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.title = "Buy2iPodsGetiPodTouchForFree"; + price_rule.value_type = "percentage"; + price_rule.value = "-100.0"; + price_rule.customer_selection = "all"; + price_rule.target_type = "line_item"; + price_rule.target_selection = "entitled"; + price_rule.allocation_method = "each"; + price_rule.starts_at = "2018-03-22T00:00:00-00:00"; + price_rule.prerequisite_collection_ids = [ + 841564295 + ]; + price_rule.entitled_product_ids = [ + 921728736 + ]; + price_rule.prerequisite_to_entitlement_quantity_ratio = { + "prerequisite_quantity": 2, + "entitled_quantity": 1 + }; + price_rule.allocation_limit = 3; + await price_rule.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/price_rules.json', + query: '', + headers, + data: { "price_rule": {"title": "Buy2iPodsGetiPodTouchForFree", "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "each", "starts_at": "2018-03-22T00:00:00-00:00", "prerequisite_collection_ids": [841564295], "entitled_product_ids": [921728736], "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": 2, "entitled_quantity": 1}, "allocation_limit": 3} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341478, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:46-05:00", "updated_at": "2023-01-03T12:06:46-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/996341478"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.title = "SUMMERSALE10OFF"; + price_rule.target_type = "line_item"; + price_rule.target_selection = "all"; + price_rule.allocation_method = "across"; + price_rule.value_type = "fixed_amount"; + price_rule.value = "-10.0"; + price_rule.customer_selection = "all"; + price_rule.starts_at = "2017-01-19T17:59:10Z"; + await price_rule.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/price_rules.json', + query: '', + headers, + data: { "price_rule": {"title": "SUMMERSALE10OFF", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "starts_at": "2017-01-19T17:59:10Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341480, "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:56-05:00", "updated_at": "2023-01-03T12:06:56-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [841564295], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "15OFFCOLLECTION", "admin_graphql_api_id": "gid://shopify/PriceRule/996341480"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.title = "15OFFCOLLECTION"; + price_rule.target_type = "line_item"; + price_rule.target_selection = "entitled"; + price_rule.allocation_method = "across"; + price_rule.value_type = "percentage"; + price_rule.value = "-15.0"; + price_rule.customer_selection = "all"; + price_rule.entitled_collection_ids = [ + 841564295 + ]; + price_rule.starts_at = "2017-01-19T17:59:10Z"; + await price_rule.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/price_rules.json', + query: '', + headers, + data: { "price_rule": {"title": "15OFFCOLLECTION", "target_type": "line_item", "target_selection": "entitled", "allocation_method": "across", "value_type": "percentage", "value": "-15.0", "customer_selection": "all", "entitled_collection_ids": [841564295], "starts_at": "2017-01-19T17:59:10Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"price_rule": {"id": 996341479, "value_type": "percentage", "value": "-100.0", "customer_selection": "all", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "allocation_limit": null, "once_per_customer": false, "usage_limit": 20, "starts_at": "2017-01-19T12:59:10-05:00", "ends_at": null, "created_at": "2023-01-03T12:06:52-05:00", "updated_at": "2023-01-03T12:06:52-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "FREESHIPPING", "admin_graphql_api_id": "gid://shopify/PriceRule/996341479"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.title = "FREESHIPPING"; + price_rule.target_type = "shipping_line"; + price_rule.target_selection = "all"; + price_rule.allocation_method = "each"; + price_rule.value_type = "percentage"; + price_rule.value = "-100.0"; + price_rule.usage_limit = 20; + price_rule.customer_selection = "all"; + price_rule.prerequisite_subtotal_range = { + "greater_than_or_equal_to": "50.0" + }; + price_rule.starts_at = "2017-01-19T17:59:10Z"; + await price_rule.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/price_rules.json', + query: '', + headers, + data: { "price_rule": {"title": "FREESHIPPING", "target_type": "shipping_line", "target_selection": "all", "allocation_method": "each", "value_type": "percentage", "value": "-100.0", "usage_limit": 20, "customer_selection": "all", "prerequisite_subtotal_range": {"greater_than_or_equal_to": "50.0"}, "starts_at": "2017-01-19T17:59:10Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}, {"id": 106886544, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2023-01-01T12:05:09-05:00", "ends_at": "2023-01-05T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "TENOFF", "admin_graphql_api_id": "gid://shopify/PriceRule/106886544"}]})); + + await shopify.rest.PriceRule.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/price_rules.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"price_rules": [{"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "prerequisite_saved_search_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}]})); + + await shopify.rest.PriceRule.all({ + session: session, + since_id: "106886545", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/price_rules.json', + query: 'since_id=106886545', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:06:55-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "WINTER SALE", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + + const price_rule = new shopify.rest.PriceRule({session: session}); + price_rule.id = 507328175; + price_rule.title = "WINTER SALE"; + await price_rule.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/price_rules/507328175.json', + query: '', + headers, + data: { "price_rule": {"title": "WINTER SALE"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"price_rule": {"id": 507328175, "value_type": "fixed_amount", "value": "-10.0", "customer_selection": "all", "target_type": "line_item", "target_selection": "all", "allocation_method": "across", "allocation_limit": null, "once_per_customer": false, "usage_limit": null, "starts_at": "2022-12-28T12:05:09-05:00", "ends_at": "2023-01-09T12:05:09-05:00", "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "entitled_product_ids": [], "entitled_variant_ids": [], "entitled_collection_ids": [], "entitled_country_ids": [], "prerequisite_product_ids": [], "prerequisite_variant_ids": [], "prerequisite_collection_ids": [], "customer_segment_prerequisite_ids": [], "prerequisite_customer_ids": [], "prerequisite_subtotal_range": null, "prerequisite_quantity_range": null, "prerequisite_shipping_price_range": null, "prerequisite_to_entitlement_quantity_ratio": {"prerequisite_quantity": null, "entitled_quantity": null}, "prerequisite_to_entitlement_purchase": {"prerequisite_amount": null}, "title": "SUMMERSALE10OFF", "admin_graphql_api_id": "gid://shopify/PriceRule/507328175"}})); + + await shopify.rest.PriceRule.find({ + session: session, + id: 507328175, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/price_rules/507328175.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.PriceRule.delete({ + session: session, + id: 507328175, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/price_rules/507328175.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.PriceRule.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/price_rules/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/product.test.ts b/rest/admin/__tests__/2023-01/product.test.ts new file mode 100644 index 000000000..1eac2f095 --- /dev/null +++ b/rest/admin/__tests__/2023-01/product.test.ts @@ -0,0 +1,754 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Product resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + + await shopify.rest.Product.all({ + session: session, + ids: "632910392,921728736", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products.json', + query: 'ids=632910392%2C921728736', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + + await shopify.rest.Product.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"products": [{"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + + await shopify.rest.Product.all({ + session: session, + since_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products.json', + query: 'since_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}]})); + + await shopify.rest.Product.all({ + session: session, + collection_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products.json', + query: 'collection_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}, {"id": 921728736, "title": "IPod Touch 8GB", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-touch", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/921728736", "variants": [{"id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "shipwire-app", "inventory_management": "shipwire-app", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "inventory_quantity": 13, "old_inventory_quantity": 13, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/447654529"}], "options": [{"id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": ["Black"]}], "images": [], "image": null}]})); + + await shopify.rest.Product.all({ + session: session, + presentment_currencies: "USD", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products.json', + query: 'presentment_currencies=USD', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"products": [{"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}, {"id": 921728736, "title": "IPod Touch 8GB", "images": []}]})); + + await shopify.rest.Product.all({ + session: session, + fields: "id,images,title", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products.json', + query: 'fields=id%2Cimages%2Ctitle', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.Product.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Product.count({ + session: session, + collection_id: "841564295", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/count.json', + query: 'collection_id=841564295', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + await shopify.rest.Product.find({ + session: session, + id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}]}})); + + await shopify.rest.Product.find({ + session: session, + id: 632910392, + fields: "id,images,title", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: 'fields=id%2Cimages%2Ctitle', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:19-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:07-05:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.published = false; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:25-05:00", "published_at": "2023-01-03T12:59:24-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.published = true; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "Updated Product Title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:21-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "2000.00", "sku": "Updating the Product SKU", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:00:20-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.title = "Updated Product Title"; + product.variants = [ + { + "id": 808950810, + "price": "2000.00", + "sku": "Updating the Product SKU" + }, + { + "id": 49148385 + }, + { + "id": 39072856 + }, + { + "id": 457924702 + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"title": "Updated Product Title", "variants": [{"id": 808950810, "price": "2000.00", "sku": "Updating the Product SKU"}, {"id": 49148385}, {"id": 39072856}, {"id": 457924702}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:02:22-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 1001473910, "product_id": 632910392, "position": 4, "created_at": "2023-01-03T13:02:22-05:00", "updated_at": "2023-01-03T13:02:22-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-3uie15.gif?v=1672768942", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473910"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = [ + { + "id": 850703190 + }, + { + "id": 562641783 + }, + { + "id": 378407906 + }, + { + "src": "http://example.com/rails_logo.gif" + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"images": [{"id": 850703190}, {"id": 562641783}, {"id": 378407906}, {"src": "http://example.com/rails_logo.gif"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:59:57-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:59:57-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = []; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"images": []} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:01:34-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 850703190, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}], "image": {"id": 378407906, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:01:34-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768894", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.images = [ + { + "id": 850703190, + "position": 3 + }, + { + "id": 562641783, + "position": 2 + }, + { + "id": 378407906, + "position": 1 + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"images": [{"id": 850703190, "position": 3}, {"id": 562641783, "position": 2}, {"id": 378407906, "position": 1}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:02:16-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:02:16-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Black", "Green", "Red", "Pink"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.variants = [ + { + "id": 457924702 + }, + { + "id": 39072856 + }, + { + "id": 49148385 + }, + { + "id": 808950810 + } + ]; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"variants": [{"id": 457924702}, {"id": 39072856}, {"id": 49148385}, {"id": 808950810}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T12:56:35-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.metafields_global_title_tag = "Brand new title"; + product.metafields_global_description_tag = "Brand new description"; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"metafields_global_title_tag": "Brand new title", "metafields_global_description_tag": "Brand new description"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:11-05:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.status = "draft"; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"status": "draft"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "IPod Nano - 8GB", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:00:46-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Barnes & Noble, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.tags = "Barnes & Noble, John's Fav"; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"tags": "Barnes & Noble, John's Fav"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_22', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 632910392, "title": "New product title", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2023-01-03T12:56:35-05:00", "handle": "ipod-nano", "updated_at": "2023-01-03T13:01:10-05:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "status": "active", "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "admin_graphql_api_id": "gid://shopify/Product/632910392", "variants": [{"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}], "options": [{"id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": ["Pink", "Red", "Green", "Black"]}], "images": [{"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}, {"id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595", "variant_ids": [808950810], "admin_graphql_api_id": "gid://shopify/ProductImage/562641783"}, {"id": 378407906, "product_id": 632910392, "position": 3, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/378407906"}], "image": {"id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/850703190"}}})); + + const product = new shopify.rest.Product({session: session}); + product.id = 632910392; + product.title = "New product title"; + await product.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: { "product": {"title": "New product title"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_23', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Product.delete({ + session: session, + id: 632910392, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/products/632910392.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_24', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 1071559595, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:02:18-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:02:18-05:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559595", "variants": [{"id": 1070325052, "product_id": 1071559595, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:02:18-05:00", "updated_at": "2023-01-03T13:02:18-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325052, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325052"}], "options": [{"id": 1055547207, "product_id": 1071559595, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.status = "draft"; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "status": "draft"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_25', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 1071559585, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:56-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:56-05:00", "published_at": "2023-01-03T13:00:56-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559585", "variants": [{"id": 1070325040, "product_id": 1071559585, "title": "First", "price": "10.00", "sku": "123", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "First", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:56-05:00", "updated_at": "2023-01-03T13:00:56-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325040, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "10.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325040"}, {"id": 1070325041, "product_id": 1071559585, "title": "Second", "price": "20.00", "sku": "123", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Second", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:56-05:00", "updated_at": "2023-01-03T13:00:56-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325041, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "20.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325041"}], "options": [{"id": 1055547196, "product_id": 1071559585, "name": "Title", "position": 1, "values": ["First", "Second"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.variants = [ + { + "option1": "First", + "price": "10.00", + "sku": "123" + }, + { + "option1": "Second", + "price": "20.00", + "sku": "123" + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "First", "price": "10.00", "sku": "123"}, {"option1": "Second", "price": "20.00", "sku": "123"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_26', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 1071559582, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:15-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:15-05:00", "published_at": "2023-01-03T13:00:15-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559582", "variants": [{"id": 1070325035, "product_id": 1071559582, "title": "Blue / 155", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Blue", "option2": "155", "option3": null, "created_at": "2023-01-03T13:00:15-05:00", "updated_at": "2023-01-03T13:00:15-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325035, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325035"}, {"id": 1070325036, "product_id": 1071559582, "title": "Black / 159", "price": "0.00", "sku": "", "position": 2, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Black", "option2": "159", "option3": null, "created_at": "2023-01-03T13:00:15-05:00", "updated_at": "2023-01-03T13:00:15-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325036, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325036"}], "options": [{"id": 1055547192, "product_id": 1071559582, "name": "Color", "position": 1, "values": ["Blue", "Black"]}, {"id": 1055547193, "product_id": 1071559582, "name": "Size", "position": 2, "values": ["155", "159"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.variants = [ + { + "option1": "Blue", + "option2": "155" + }, + { + "option1": "Black", + "option2": "159" + } + ]; + product.options = [ + { + "name": "Color", + "values": [ + "Blue", + "Black" + ] + }, + { + "name": "Size", + "values": [ + "155", + "159" + ] + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "variants": [{"option1": "Blue", "option2": "155"}, {"option1": "Black", "option2": "159"}], "options": [{"name": "Color", "values": ["Blue", "Black"]}, {"name": "Size", "values": ["155", "159"]}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_27', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 1071559586, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:01:04-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:01:04-05:00", "published_at": "2023-01-03T13:01:04-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "Barnes & Noble, Big Air, John's Fav", "admin_graphql_api_id": "gid://shopify/Product/1071559586", "variants": [{"id": 1070325042, "product_id": 1071559586, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:01:04-05:00", "updated_at": "2023-01-03T13:01:04-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325042, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325042"}], "options": [{"id": 1055547197, "product_id": 1071559586, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.tags = [ + "Barnes & Noble", + "Big Air", + "John's Fav" + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "tags": ["Barnes & Noble", "Big Air", "John's Fav"]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_28', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 1071559578, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T12:59:53-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T12:59:53-05:00", "published_at": "2023-01-03T12:59:53-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559578", "variants": [{"id": 1070325031, "product_id": 1071559578, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325031, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325031"}], "options": [{"id": 1055547186, "product_id": 1071559578, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473906, "product_id": 1071559578, "position": 1, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-j94qo6.gif?v=1672768793", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473906"}], "image": {"id": 1001473906, "product_id": 1071559578, "position": 1, "created_at": "2023-01-03T12:59:53-05:00", "updated_at": "2023-01-03T12:59:53-05:00", "alt": null, "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/rails_logo20230103-54493-j94qo6.gif?v=1672768793", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473906"}}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "src": "http://example.com/rails_logo.gif" + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"src": "http://example.com/rails_logo.gif"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_29', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 1071559583, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:23-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:23-05:00", "published_at": "2023-01-03T13:00:23-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559583", "variants": [{"id": 1070325037, "product_id": 1071559583, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325037, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325037"}], "options": [{"id": 1055547194, "product_id": 1071559583, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [{"id": 1001473907, "product_id": 1071559583, "position": 1, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768823", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473907"}], "image": {"id": 1001473907, "product_id": 1071559583, "position": 1, "created_at": "2023-01-03T13:00:23-05:00", "updated_at": "2023-01-03T13:00:23-05:00", "alt": null, "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672768823", "variant_ids": [], "admin_graphql_api_id": "gid://shopify/ProductImage/1001473907"}}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.images = [ + { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n" + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "images": [{"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_30', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 1071559581, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:09-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:09-05:00", "published_at": null, "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559581", "variants": [{"id": 1070325034, "product_id": 1071559581, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:09-05:00", "updated_at": "2023-01-03T13:00:09-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325034, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325034"}], "options": [{"id": 1055547191, "product_id": 1071559581, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.published = false; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_31', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 1071559576, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T12:59:44-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T12:59:44-05:00", "published_at": "2023-01-03T12:59:44-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559576", "variants": [{"id": 1070325030, "product_id": 1071559576, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T12:59:44-05:00", "updated_at": "2023-01-03T12:59:44-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325030, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325030"}], "options": [{"id": 1055547183, "product_id": 1071559576, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_32', async () => { + queueMockResponse(JSON.stringify({"product": {"id": 1071559584, "title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2023-01-03T13:00:52-05:00", "handle": "burton-custom-freestyle-151", "updated_at": "2023-01-03T13:00:52-05:00", "published_at": "2023-01-03T13:00:52-05:00", "template_suffix": null, "status": "active", "published_scope": "global", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/1071559584", "variants": [{"id": 1070325039, "product_id": 1071559584, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2023-01-03T13:00:52-05:00", "updated_at": "2023-01-03T13:00:52-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325039, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325039"}], "options": [{"id": 1055547195, "product_id": 1071559584, "name": "Title", "position": 1, "values": ["Default Title"]}], "images": [], "image": null}})); + + const product = new shopify.rest.Product({session: session}); + product.title = "Burton Custom Freestyle 151"; + product.body_html = "Good snowboard!"; + product.vendor = "Burton"; + product.product_type = "Snowboard"; + product.metafields_global_title_tag = "Product SEO Title"; + product.metafields_global_description_tag = "Product SEO Description"; + await product.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products.json', + query: '', + headers, + data: { "product": {"title": "Burton Custom Freestyle 151", "body_html": "Good snowboard!", "vendor": "Burton", "product_type": "Snowboard", "metafields_global_title_tag": "Product SEO Title", "metafields_global_description_tag": "Product SEO Description"} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/product_listing.test.ts b/rest/admin/__tests__/2023-01/product_listing.test.ts new file mode 100644 index 000000000..5ff219aca --- /dev/null +++ b/rest/admin/__tests__/2023-01/product_listing.test.ts @@ -0,0 +1,137 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('ProductListing resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"product_listings": [{"product_id": 632910392, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.

", "handle": "ipod-nano", "product_type": "Cult Products", "title": "IPod Nano - 8GB", "vendor": "Apple", "available": true, "tags": "Emotive, Flash Memory, MP3, Music", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 808950810, "title": "Pink", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Pink"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008PINK", "barcode": "1234_pink", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 10, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": 562641783, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 49148385, "title": "Red", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Red"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008RED", "barcode": "1234_red", "taxable": true, "position": 2, "available": true, "inventory_policy": "continue", "inventory_quantity": 20, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 39072856, "title": "Green", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Green"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008GREEN", "barcode": "1234_green", "taxable": true, "position": 3, "available": true, "inventory_policy": "continue", "inventory_quantity": 30, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}, {"id": 457924702, "title": "Black", "option_values": [{"option_id": 594680422, "name": "Color", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2008BLACK", "barcode": "1234_black", "taxable": true, "position": 4, "available": true, "inventory_policy": "continue", "inventory_quantity": 40, "inventory_management": "shopify", "fulfillment_service": "manual", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [{"id": 850703190, "created_at": "2023-01-03T12:05:09-05:00", "position": 1, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672765509", "variant_ids": [], "width": 123, "height": 456}, {"id": 562641783, "created_at": "2023-01-03T12:05:09-05:00", "position": 2, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672765509", "variant_ids": [808950810], "width": 123, "height": 456}, {"id": 378407906, "created_at": "2023-01-03T12:05:09-05:00", "position": 3, "updated_at": "2023-01-03T12:05:09-05:00", "product_id": 632910392, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672765509", "variant_ids": [], "width": 123, "height": 456}], "options": [{"id": 594680422, "name": "Color", "product_id": 632910392, "position": 1, "values": ["Pink", "Red", "Green", "Black"]}]}, {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}]})); + + await shopify.rest.ProductListing.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/product_listings.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"product_ids": [921728736, 632910392]})); + + await shopify.rest.ProductListing.product_ids({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/product_listings/product_ids.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.ProductListing.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/product_listings/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + + await shopify.rest.ProductListing.find({ + session: session, + product_id: 921728736, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/product_listings/921728736.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"product_listing": {"product_id": 921728736, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00", "body_html": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.

", "handle": "ipod-touch", "product_type": "Cult Products", "title": "IPod Touch 8GB", "vendor": "Apple", "available": true, "tags": "", "published_at": "2017-08-31T20:00:00-04:00", "variants": [{"id": 447654529, "title": "Black", "option_values": [{"option_id": 891236591, "name": "Title", "value": "Black"}], "price": "199.00", "formatted_price": "$199.00", "compare_at_price": null, "grams": 567, "requires_shipping": true, "sku": "IPOD2009BLACK", "barcode": "1234_black", "taxable": true, "position": 1, "available": true, "inventory_policy": "continue", "inventory_quantity": 13, "inventory_management": "shipwire-app", "fulfillment_service": "shipwire-app", "weight": 1.25, "weight_unit": "lb", "image_id": null, "created_at": "2023-01-03T12:05:09-05:00", "updated_at": "2023-01-03T12:05:09-05:00"}], "images": [], "options": [{"id": 891236591, "name": "Title", "product_id": 921728736, "position": 1, "values": ["Black"]}]}})); + + const product_listing = new shopify.rest.ProductListing({session: session}); + product_listing.product_id = 921728736; + await product_listing.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/product_listings/921728736.json', + query: '', + headers, + data: { "product_listing": {} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.ProductListing.delete({ + session: session, + product_id: 921728736, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/product_listings/921728736.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/product_resource_feedback.test.ts b/rest/admin/__tests__/2023-01/product_resource_feedback.test.ts new file mode 100644 index 000000000..51c316870 --- /dev/null +++ b/rest/admin/__tests__/2023-01/product_resource_feedback.test.ts @@ -0,0 +1,94 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('ProductResourceFeedback resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:45:42-05:00", "updated_at": "2023-01-03T12:45:42-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2023-01-03T12:45:40-05:00", "state": "requires_action"}})); + + const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); + product_resource_feedback.product_id = 632910392; + product_resource_feedback.state = "requires_action"; + product_resource_feedback.messages = [ + "Needs at least one image." + ]; + product_resource_feedback.resource_updated_at = "2023-01-03T12:21:36-05:00"; + product_resource_feedback.feedback_generated_at = "2023-01-03T17:45:40.928568Z"; + await product_resource_feedback.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/resource_feedback.json', + query: '', + headers, + data: { "resource_feedback": {"state": "requires_action", "messages": ["Needs at least one image."], "resource_updated_at": "2023-01-03T12:21:36-05:00", "feedback_generated_at": "2023-01-03T17:45:40.928568Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:45:45-05:00", "updated_at": "2023-01-03T12:45:45-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": [], "feedback_generated_at": "2023-01-03T12:45:44-05:00", "state": "success"}})); + + const product_resource_feedback = new shopify.rest.ProductResourceFeedback({session: session}); + product_resource_feedback.product_id = 632910392; + product_resource_feedback.state = "success"; + product_resource_feedback.resource_updated_at = "2023-01-03T12:21:36-05:00"; + product_resource_feedback.feedback_generated_at = "2023-01-03T17:45:44.063762Z"; + await product_resource_feedback.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/resource_feedback.json', + query: '', + headers, + data: { "resource_feedback": {"state": "success", "resource_updated_at": "2023-01-03T12:21:36-05:00", "feedback_generated_at": "2023-01-03T17:45:44.063762Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2023-01-03T12:45:45-05:00", "updated_at": "2023-01-03T12:45:45-05:00", "resource_id": 632910392, "resource_type": "Product", "resource_updated_at": "2023-01-03T12:21:36-05:00", "messages": ["Needs at least one image."], "feedback_generated_at": "2023-01-03T11:45:45-05:00", "state": "requires_action"}]})); + + await shopify.rest.ProductResourceFeedback.all({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/resource_feedback.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/province.test.ts b/rest/admin/__tests__/2023-01/province.test.ts new file mode 100644 index 000000000..86f290878 --- /dev/null +++ b/rest/admin/__tests__/2023-01/province.test.ts @@ -0,0 +1,126 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Province resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"provinces": [{"id": 205434194, "country_id": 879921427, "name": "Alberta", "code": "AB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 170405627, "country_id": 879921427, "name": "British Columbia", "code": "BC", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 342345110, "country_id": 879921427, "name": "Manitoba", "code": "MB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.07, "tax_percentage": 7.0}, {"id": 92264567, "country_id": 879921427, "name": "New Brunswick", "code": "NB", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 243284171, "country_id": 879921427, "name": "Newfoundland", "code": "NL", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 439598329, "country_id": 879921427, "name": "Northwest Territories", "code": "NT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 448070559, "country_id": 879921427, "name": "Nova Scotia", "code": "NS", "tax_name": null, "tax_type": "harmonized", "shipping_zone_id": null, "tax": 0.15, "tax_percentage": 15.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 473391800, "country_id": 879921427, "name": "Saskatchewan", "code": "SK", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]})); + + await shopify.rest.Province.all({ + session: session, + country_id: 879921427, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/countries/879921427/provinces.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"provinces": [{"id": 570891722, "country_id": 879921427, "name": "Prince Edward Island", "code": "PE", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.1, "tax_percentage": 10.0}, {"id": 670206421, "country_id": 879921427, "name": "Nunavut", "code": "NU", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.08, "tax_percentage": 8.0}, {"id": 1005264686, "country_id": 879921427, "name": "Yukon", "code": "YT", "tax_name": null, "tax_type": null, "shipping_zone_id": null, "tax": 0.0, "tax_percentage": 0.0}]})); + + await shopify.rest.Province.all({ + session: session, + country_id: 879921427, + since_id: "536137098", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/countries/879921427/provinces.json', + query: 'since_id=536137098', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"count": 13})); + + await shopify.rest.Province.count({ + session: session, + country_id: 879921427, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/countries/879921427/provinces/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"province": {"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}})); + + await shopify.rest.Province.find({ + session: session, + country_id: 879921427, + id: 224293623, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/countries/879921427/provinces/224293623.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"province": {"country_id": 879921427, "id": 224293623, "name": "Quebec", "code": "QC", "tax_name": "HST", "tax_type": "compounded", "shipping_zone_id": null, "tax": 0.09, "tax_percentage": 9.0}})); + + const province = new shopify.rest.Province({session: session}); + province.country_id = 879921427; + province.id = 224293623; + province.tax = 0.09; + await province.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/countries/879921427/provinces/224293623.json', + query: '', + headers, + data: { "province": {"tax": 0.09} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/recurring_application_charge.test.ts b/rest/admin/__tests__/2023-01/recurring_application_charge.test.ts new file mode 100644 index 000000000..871125873 --- /dev/null +++ b/rest/admin/__tests__/2023-01/recurring_application_charge.test.ts @@ -0,0 +1,203 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('RecurringApplicationCharge resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266949, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:35-05:00", "updated_at": "2023-01-03T13:06:35-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 5, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266949", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266949/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAVeWT06EmF1dG9fYWN0aXZhdGVU--9b5c79476bf6e10095d51a27255892c04e5dd4fa"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.name = "Super Duper Plan"; + recurring_application_charge.price = 10.0; + recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + recurring_application_charge.trial_days = 5; + await recurring_application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/recurring_application_charges.json', + query: '', + headers, + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "trial_days": 5} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266951, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:39-05:00", "updated_at": "2023-01-03T13:06:39-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": null, "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266951", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266951/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAdeWT06EmF1dG9fYWN0aXZhdGVU--4e07fb141094c2ffacfcff713a2dc85eab38a229"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.name = "Super Duper Plan"; + recurring_application_charge.price = 10.0; + recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + recurring_application_charge.capped_amount = 100; + recurring_application_charge.terms = "$1 for 1000 emails"; + await recurring_application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/recurring_application_charges.json', + query: '', + headers, + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "capped_amount": 100, "terms": "$1 for 1000 emails"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266952, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:41-05:00", "updated_at": "2023-01-03T13:06:41-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266952", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266952/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBAheWT06EmF1dG9fYWN0aXZhdGVU--c278a9ebe0e4885c8b9df2be46598c9b9abf0731"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.name = "Super Duper Plan"; + recurring_application_charge.price = 10.0; + recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + await recurring_application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/recurring_application_charges.json', + query: '', + headers, + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 1029266954, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:51-05:00", "updated_at": "2023-01-03T13:06:51-05:00", "test": true, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266954", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266954/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBApeWT06EmF1dG9fYWN0aXZhdGVU--f0a955813cb17f90e052cdbc976832ce6f213068"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.name = "Super Duper Plan"; + recurring_application_charge.price = 10.0; + recurring_application_charge.return_url = "http://super-duper.shopifyapps.com"; + recurring_application_charge.test = true; + await recurring_application_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/recurring_application_charges.json', + query: '', + headers, + data: { "recurring_application_charge": {"name": "Super Duper Plan", "price": 10.0, "return_url": "http://super-duper.shopifyapps.com", "test": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "accepted", "return_url": "http://yourapp.example.org", "billing_on": "2023-01-03", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:06:22-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195"}]})); + + await shopify.rest.RecurringApplicationCharge.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/recurring_application_charges.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"recurring_application_charges": [{"id": 1029266947, "name": "Super Duper Plan", "api_client_id": 755357713, "price": "10.00", "status": "pending", "return_url": "http://super-duper.shopifyapps.com/", "billing_on": null, "created_at": "2023-01-03T13:06:21-05:00", "updated_at": "2023-01-03T13:06:21-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://super-duper.shopifyapps.com/?charge_id=1029266947", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/1029266947/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBANeWT06EmF1dG9fYWN0aXZhdGVU--4e6554253be678506a3421452fb801fd291e6db7"}]})); + + await shopify.rest.RecurringApplicationCharge.all({ + session: session, + since_id: "455696195", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/recurring_application_charges.json', + query: 'since_id=455696195', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"recurring_application_charge": {"id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "pending", "return_url": "http://yourapp.example.org", "billing_on": "2023-01-03", "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T12:56:35-05:00", "test": null, "activated_on": null, "cancelled_on": null, "trial_days": 0, "trial_ends_on": null, "decorated_return_url": "http://yourapp.example.org?charge_id=455696195", "confirmation_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_recurring_application_charge?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVU--b5f90d04779cc5242b396e4054f2e650c5dace1c"}})); + + await shopify.rest.RecurringApplicationCharge.find({ + session: session, + id: 455696195, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/recurring_application_charges/455696195.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.RecurringApplicationCharge.delete({ + session: session, + id: 455696195, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/recurring_application_charges/455696195.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"recurring_application_charge": {"return_url": "http://yourapp.example.org/", "id": 455696195, "name": "Super Mega Plan", "api_client_id": 755357713, "price": "15.00", "status": "active", "billing_on": null, "created_at": "2023-01-03T12:56:35-05:00", "updated_at": "2023-01-03T13:06:19-05:00", "test": null, "activated_on": "2023-01-03", "cancelled_on": null, "trial_days": 0, "capped_amount": "100.00", "trial_ends_on": "2023-01-03", "balance_used": 0.0, "balance_remaining": 100.0, "risk_level": 0, "decorated_return_url": "http://yourapp.example.org/?charge_id=455696195", "update_capped_amount_url": "https://jsmith.myshopify.com/admin/charges/755357713/455696195/RecurringApplicationCharge/confirm_update_capped_amount?signature=BAh7BzoHaWRpBENfKRs6EmF1dG9fYWN0aXZhdGVG--c9d104c0a19c52b84fa17360f32abc13aae86935"}})); + + const recurring_application_charge = new shopify.rest.RecurringApplicationCharge({session: session}); + recurring_application_charge.id = 455696195; + await recurring_application_charge.customize({ + recurring_application_charge: {"capped_amount": "200"}, + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/recurring_application_charges/455696195/customize.json', + query: 'recurring_application_charge%5Bcapped_amount%5D=200', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/redirect.test.ts b/rest/admin/__tests__/2023-01/redirect.test.ts new file mode 100644 index 000000000..b88f7adad --- /dev/null +++ b/rest/admin/__tests__/2023-01/redirect.test.ts @@ -0,0 +1,212 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Redirect resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"redirects": [{"id": 950115854, "path": "/ibook", "target": "/products/macbook"}]})); + + await shopify.rest.Redirect.all({ + session: session, + since_id: "668809255", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/redirects.json', + query: 'since_id=668809255', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"redirects": [{"id": 304339089, "path": "/products.php", "target": "/products"}, {"id": 668809255, "path": "/leopard", "target": "/pages/macosx"}, {"id": 950115854, "path": "/ibook", "target": "/products/macbook"}]})); + + await shopify.rest.Redirect.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/redirects.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Redirect.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/redirects/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"redirect": {"id": 668809255, "path": "/leopard", "target": "/pages/macosx"}})); + + await shopify.rest.Redirect.find({ + session: session, + id: 668809255, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/redirects/668809255.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"redirect": {"path": "/powermac", "target": "/pages/macpro", "id": 950115854}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.id = 950115854; + redirect.path = "/powermac"; + redirect.target = "/pages/macpro"; + await redirect.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/redirects/950115854.json', + query: '', + headers, + data: { "redirect": {"path": "/powermac", "target": "/pages/macpro"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"redirect": {"path": "/tiger", "target": "/pages/macosx", "id": 668809255}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.id = 668809255; + redirect.path = "/tiger"; + await redirect.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/redirects/668809255.json', + query: '', + headers, + data: { "redirect": {"path": "/tiger"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"redirect": {"target": "/pages/macpro", "path": "/leopard", "id": 668809255}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.id = 668809255; + redirect.target = "/pages/macpro"; + await redirect.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/redirects/668809255.json', + query: '', + headers, + data: { "redirect": {"target": "/pages/macpro"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Redirect.delete({ + session: session, + id: 668809255, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/redirects/668809255.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"redirect": {"id": 984542200, "path": "/ipod", "target": "/pages/itunes"}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.path = "/ipod"; + redirect.target = "/pages/itunes"; + await redirect.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/redirects.json', + query: '', + headers, + data: { "redirect": {"path": "/ipod", "target": "/pages/itunes"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"redirect": {"id": 984542199, "path": "/forums", "target": "http://forums.apple.com/"}})); + + const redirect = new shopify.rest.Redirect({session: session}); + redirect.path = "http://www.apple.com/forums"; + redirect.target = "http://forums.apple.com"; + await redirect.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/redirects.json', + query: '', + headers, + data: { "redirect": {"path": "http://www.apple.com/forums", "target": "http://forums.apple.com"} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/refund.test.ts b/rest/admin/__tests__/2023-01/refund.test.ts new file mode 100644 index 000000000..5aaaf21e2 --- /dev/null +++ b/rest/admin/__tests__/2023-01/refund.test.ts @@ -0,0 +1,195 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Refund resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"refunds": [{"id": 509562969, "order_id": 450789469, "created_at": "2023-01-03T12:56:35-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2023-01-03T12:56:35-05:00", "restock": true, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}]})); + + await shopify.rest.Refund.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/refunds.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"refund": {"id": 929361465, "order_id": 450789469, "created_at": "2023-01-03T13:05:55-05:00", "note": "wrong size", "user_id": null, "processed_at": "2023-01-03T13:05:55-05:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/929361465", "refund_line_items": [{"location_id": null, "restock_type": "no_restock", "quantity": 1, "id": 1058498312, "line_item_id": 518995019, "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 518995019, "variant_id": 49148385, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008RED", "variant_title": "red", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - red", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/518995019", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 1068278491, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T13:05:54-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2023-01-03T13:05:54-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "41.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278491"}], "order_adjustments": []}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + refund.currency = "USD"; + refund.notify = true; + refund.note = "wrong size"; + refund.shipping = { + "full_refund": true + }; + refund.refund_line_items = [ + { + "line_item_id": 518995019, + "quantity": 1, + "restock_type": "return", + "location_id": 487838322 + } + ]; + refund.transactions = [ + { + "parent_id": 801038806, + "amount": 41.94, + "kind": "refund", + "gateway": "bogus" + } + ]; + await refund.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/refunds.json', + query: '', + headers, + data: { "refund": {"currency": "USD", "notify": true, "note": "wrong size", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "return", "location_id": 487838322}], "transactions": [{"parent_id": 801038806, "amount": 41.94, "kind": "refund", "gateway": "bogus"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"refund": {"id": 929361466, "order_id": 450789469, "created_at": "2023-01-03T13:05:59-05:00", "note": null, "user_id": null, "processed_at": "2023-01-03T13:05:59-05:00", "restock": false, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/929361466", "refund_line_items": [], "transactions": [{"id": 1068278492, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T13:05:59-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2023-01-03T13:05:59-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "receipt": {}, "amount": "5.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278492"}], "order_adjustments": [{"id": 1030976843, "order_id": 450789469, "refund_id": 929361466, "amount": "-5.00", "tax_amount": "0.00", "kind": "shipping_refund", "reason": "Shipping refund", "amount_set": {"shop_money": {"amount": "-5.00", "currency_code": "USD"}, "presentment_money": {"amount": "-5.00", "currency_code": "USD"}}, "tax_amount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}}]}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + refund.currency = "USD"; + refund.shipping = { + "amount": 5.0 + }; + refund.transactions = [ + { + "parent_id": 801038806, + "amount": 5.0, + "kind": "refund", + "gateway": "bogus" + } + ]; + await refund.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/refunds.json', + query: '', + headers, + data: { "refund": {"currency": "USD", "shipping": {"amount": 5.0}, "transactions": [{"parent_id": 801038806, "amount": 5.0, "kind": "refund", "gateway": "bogus"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"refund": {"id": 509562969, "order_id": 450789469, "created_at": "2023-01-03T12:56:35-05:00", "note": "it broke during shipping", "user_id": 548380009, "processed_at": "2023-01-03T12:56:35-05:00", "restock": true, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "admin_graphql_api_id": "gid://shopify/Refund/509562969", "refund_line_items": [{"id": 104689539, "quantity": 1, "line_item_id": 703073504, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.67, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.67", "currency_code": "USD"}, "presentment_money": {"amount": "195.67", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 703073504, "variant_id": 457924702, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008BLACK", "variant_title": "black", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - black", "variant_inventory_management": "shopify", "properties": [], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.33", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.33", "currency_code": "USD"}, "presentment_money": {"amount": "3.33", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/703073504", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}, {"id": 709875399, "quantity": 1, "line_item_id": 466157049, "location_id": 487838322, "restock_type": "legacy_restock", "subtotal": 195.66, "total_tax": 3.98, "subtotal_set": {"shop_money": {"amount": "195.66", "currency_code": "USD"}, "presentment_money": {"amount": "195.66", "currency_code": "USD"}}, "total_tax_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}, "line_item": {"id": 466157049, "variant_id": 39072856, "title": "IPod Nano - 8gb", "quantity": 1, "sku": "IPOD2008GREEN", "variant_title": "green", "vendor": null, "fulfillment_service": "manual", "product_id": 632910392, "requires_shipping": true, "taxable": true, "gift_card": false, "name": "IPod Nano - 8gb - green", "variant_inventory_management": "shopify", "properties": [{"name": "Custom Engraving Front", "value": "Happy Birthday"}, {"name": "Custom Engraving Back", "value": "Merry Christmas"}], "product_exists": true, "fulfillable_quantity": 1, "grams": 200, "price": "199.00", "total_discount": "0.00", "fulfillment_status": null, "price_set": {"shop_money": {"amount": "199.00", "currency_code": "USD"}, "presentment_money": {"amount": "199.00", "currency_code": "USD"}}, "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "discount_allocations": [{"amount": "3.34", "discount_application_index": 0, "amount_set": {"shop_money": {"amount": "3.34", "currency_code": "USD"}, "presentment_money": {"amount": "3.34", "currency_code": "USD"}}}], "duties": [], "admin_graphql_api_id": "gid://shopify/LineItem/466157049", "tax_lines": [{"title": "State Tax", "price": "3.98", "rate": 0.06, "channel_liable": null, "price_set": {"shop_money": {"amount": "3.98", "currency_code": "USD"}, "presentment_money": {"amount": "3.98", "currency_code": "USD"}}}]}}], "transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}], "order_adjustments": []}})); + + await shopify.rest.Refund.find({ + session: session, + order_id: 450789469, + id: 509562969, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/refunds/509562969.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "2.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "2.00", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + await refund.calculate({ + body: {"refund": {"currency": "USD", "shipping": {"amount": 2.0}}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/refunds/calculate.json', + query: '', + headers, + data: { "refund": {"currency": "USD", "shipping": {"amount": 2.0}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + await refund.calculate({ + body: {"refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/refunds/calculate.json', + query: '', + headers, + data: { "refund": {"currency": "USD", "shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"refund": {"shipping": {"amount": "5.00", "tax": "0.00", "maximum_refundable": "5.00"}, "duties": [], "total_duties_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "additional_fees": [], "total_additional_fees_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "return": null, "refund_line_items": [{"quantity": 1, "line_item_id": 518995019, "location_id": null, "restock_type": "no_restock", "price": "199.00", "subtotal": "195.67", "total_tax": "3.98", "discounted_price": "199.00", "discounted_total_price": "199.00", "total_cart_discount_amount": "3.33"}], "transactions": [{"order_id": 450789469, "kind": "suggested_refund", "gateway": "bogus", "parent_id": 801038806, "amount": "41.94", "currency": "USD", "maximum_refundable": "41.94"}], "currency": "USD"}})); + + const refund = new shopify.rest.Refund({session: session}); + refund.order_id = 450789469; + await refund.calculate({ + body: {"refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]}}, + }); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/refunds/calculate.json', + query: '', + headers, + data: { "refund": {"shipping": {"full_refund": true}, "refund_line_items": [{"line_item_id": 518995019, "quantity": 1, "restock_type": "no_restock"}]} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/report.test.ts b/rest/admin/__tests__/2023-01/report.test.ts new file mode 100644 index 000000000..f92f2e92e --- /dev/null +++ b/rest/admin/__tests__/2023-01/report.test.ts @@ -0,0 +1,214 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Report resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}, {"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}]})); + + await shopify.rest.Report.all({ + session: session, + since_id: "123", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/reports.json', + query: 'since_id=123', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + + await shopify.rest.Report.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/reports.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales"}, {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}]})); + + await shopify.rest.Report.all({ + session: session, + fields: "id,shopify_ql", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/reports.json', + query: 'fields=id%2Cshopify_ql', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"reports": [{"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + + await shopify.rest.Report.all({ + session: session, + ids: "517154478", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/reports.json', + query: 'ids=517154478', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"reports": [{"id": 752357116, "name": "Custom App Report 2", "shopify_ql": "SHOW total_sales BY order_id FROM sales ORDER BY total_sales", "updated_at": "2023-01-03T12:21:36-05:00", "category": "custom_app_reports"}, {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}]})); + + await shopify.rest.Report.all({ + session: session, + updated_at_min: "2005-07-31 15:57:11 EDT -04:00", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/reports.json', + query: 'updated_at_min=2005-07-31+15%3A57%3A11+EDT+-04%3A00', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"report": {"id": 517154478, "name": "Wholesale Sales Report", "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today", "updated_at": "2017-04-10T16:33:22-04:00", "category": "custom_app_reports"}})); + + await shopify.rest.Report.find({ + session: session, + id: 517154478, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/reports/517154478.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"report": {"id": 517154478, "shopify_ql": "SHOW total_sales BY order_id FROM sales WHERE api_client_id == 123 SINCE -1m UNTIL today"}})); + + await shopify.rest.Report.find({ + session: session, + id: 517154478, + fields: "id,shopify_ql", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/reports/517154478.json', + query: 'fields=id%2Cshopify_ql', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"report": {"name": "Changed Report Name", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -12m UNTIL today ORDER BY total_sales", "id": 517154478, "updated_at": "2023-01-03T12:47:04-05:00", "category": "custom_app_reports"}})); + + const report = new shopify.rest.Report({session: session}); + report.id = 517154478; + report.name = "Changed Report Name"; + report.shopify_ql = "SHOW total_sales BY order_id FROM sales SINCE -12m UNTIL today ORDER BY total_sales"; + await report.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/reports/517154478.json', + query: '', + headers, + data: { "report": {"name": "Changed Report Name", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -12m UNTIL today ORDER BY total_sales"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Report.delete({ + session: session, + id: 517154478, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/reports/517154478.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"report": {"id": 1016888664, "name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales", "updated_at": "2023-01-03T12:46:45-05:00", "category": "custom_app_reports"}})); + + const report = new shopify.rest.Report({session: session}); + report.name = "A new app report"; + report.shopify_ql = "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"; + await report.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/reports.json', + query: '', + headers, + data: { "report": {"name": "A new app report", "shopify_ql": "SHOW total_sales BY order_id FROM sales SINCE -1m UNTIL today ORDER BY total_sales"} } + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/resource_feedback.test.ts b/rest/admin/__tests__/2023-01/resource_feedback.test.ts new file mode 100644 index 000000000..5a94c5eed --- /dev/null +++ b/rest/admin/__tests__/2023-01/resource_feedback.test.ts @@ -0,0 +1,89 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('ResourceFeedback resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:53:47-05:00", "updated_at": "2023-01-03T12:53:47-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T12:53:46-05:00", "state": "requires_action"}})); + + const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); + resource_feedback.state = "requires_action"; + resource_feedback.messages = [ + "is not connected. Connect your account to use this sales channel." + ]; + resource_feedback.feedback_generated_at = "2023-01-03T17:53:46.212756Z"; + await resource_feedback.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/resource_feedback.json', + query: '', + headers, + data: { "resource_feedback": {"state": "requires_action", "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T17:53:46.212756Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"resource_feedback": {"created_at": "2023-01-03T12:53:50-05:00", "updated_at": "2023-01-03T12:53:50-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": [], "feedback_generated_at": "2023-01-03T12:53:49-05:00", "state": "success"}})); + + const resource_feedback = new shopify.rest.ResourceFeedback({session: session}); + resource_feedback.state = "success"; + resource_feedback.feedback_generated_at = "2023-01-03T17:53:49.185362Z"; + await resource_feedback.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/resource_feedback.json', + query: '', + headers, + data: { "resource_feedback": {"state": "success", "feedback_generated_at": "2023-01-03T17:53:49.185362Z"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"resource_feedback": [{"created_at": "2023-01-03T12:53:44-05:00", "updated_at": "2023-01-03T12:53:44-05:00", "resource_id": 548380009, "resource_type": "Shop", "resource_updated_at": null, "messages": ["is not connected. Connect your account to use this sales channel."], "feedback_generated_at": "2023-01-03T11:53:44-05:00", "state": "requires_action"}]})); + + await shopify.rest.ResourceFeedback.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/resource_feedback.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/script_tag.test.ts b/rest/admin/__tests__/2023-01/script_tag.test.ts new file mode 100644 index 000000000..2734b0445 --- /dev/null +++ b/rest/admin/__tests__/2023-01/script_tag.test.ts @@ -0,0 +1,175 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('ScriptTag resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"script_tags": [{"id": 421379493, "src": "https://js.example.org/bar.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}, {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); + + await shopify.rest.ScriptTag.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/script_tags.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); + + await shopify.rest.ScriptTag.all({ + session: session, + since_id: "421379493", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/script_tags.json', + query: 'since_id=421379493', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"script_tags": [{"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all"}]})); + + await shopify.rest.ScriptTag.all({ + session: session, + src: "https://js.example.org/foo.js", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/script_tags.json', + query: 'src=https%3A%2F%2Fjs.example.org%2Ffoo.js', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"id": 870402688, "src": "https://example.com/my_script.js", "event": "onload", "created_at": "2023-01-03T12:54:19-05:00", "updated_at": "2023-01-03T12:54:19-05:00", "display_scope": "all", "cache": false}})); + + const script_tag = new shopify.rest.ScriptTag({session: session}); + script_tag.event = "onload"; + script_tag.src = "https://example.com/my_script.js"; + await script_tag.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/script_tags.json', + query: '', + headers, + data: { "script_tag": {"event": "onload", "src": "https://example.com/my_script.js"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"count": 2})); + + await shopify.rest.ScriptTag.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/script_tags/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"id": 596726825, "src": "https://js.example.org/foo.js", "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "display_scope": "all", "cache": false}})); + + await shopify.rest.ScriptTag.find({ + session: session, + id: 596726825, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/script_tags/596726825.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"script_tag": {"src": "https://somewhere-else.com/another.js", "cache": false, "id": 596726825, "event": "onload", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:54:18-05:00", "display_scope": "all"}})); + + const script_tag = new shopify.rest.ScriptTag({session: session}); + script_tag.id = 596726825; + script_tag.src = "https://somewhere-else.com/another.js"; + await script_tag.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/script_tags/596726825.json', + query: '', + headers, + data: { "script_tag": {"src": "https://somewhere-else.com/another.js"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.ScriptTag.delete({ + session: session, + id: 596726825, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/script_tags/596726825.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/shipping_zone.test.ts b/rest/admin/__tests__/2023-01/shipping_zone.test.ts new file mode 100644 index 000000000..b100bcbef --- /dev/null +++ b/rest/admin/__tests__/2023-01/shipping_zone.test.ts @@ -0,0 +1,50 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('ShippingZone resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"shipping_zones": [{"id": 44570466, "name": "Downtown Ottawa", "profile_id": "gid://shopify/DeliveryProfile/690933842", "location_group_id": "gid://shopify/DeliveryLocationGroup/694323328", "admin_graphql_api_id": "gid://shopify/DeliveryZone/44570466", "countries": [{"id": 359115488, "name": "Colombia", "tax": 0.15, "code": "CO", "tax_name": "VAT", "shipping_zone_id": 44570466, "provinces": []}, {"id": 879921427, "name": "Canada", "tax": 0.05, "code": "CA", "tax_name": "GST", "shipping_zone_id": 44570466, "provinces": [{"id": 224293623, "country_id": 879921427, "name": "Quebec", "code": "QC", "tax": 0.09, "tax_name": "HST", "tax_type": "compounded", "tax_percentage": 9.0, "shipping_zone_id": 44570466}, {"id": 702530425, "country_id": 879921427, "name": "Ontario", "code": "ON", "tax": 0.08, "tax_name": null, "tax_type": null, "tax_percentage": 8.0, "shipping_zone_id": 44570466}]}, {"id": 817138619, "name": "United States", "tax": 0.0, "code": "US", "tax_name": "Federal Tax", "shipping_zone_id": 44570466, "provinces": [{"id": 9350860, "country_id": 817138619, "name": "Massachusetts", "code": "MA", "tax": 0.065, "tax_name": null, "tax_type": null, "tax_percentage": 6.5, "shipping_zone_id": 44570466}, {"id": 1013111685, "country_id": 817138619, "name": "New York", "code": "NY", "tax": 0.04, "tax_name": null, "tax_type": null, "tax_percentage": 4.0, "shipping_zone_id": 44570466}]}], "weight_based_shipping_rates": [{"id": 522512552, "name": "Free Under 5kg", "price": "0.00", "shipping_zone_id": 44570466, "weight_low": 0.0, "weight_high": 5.0}], "price_based_shipping_rates": [{"id": 64051, "name": "Free Shipping", "price": "0.00", "shipping_zone_id": 44570466, "min_order_subtotal": null, "max_order_subtotal": "450"}], "carrier_shipping_rate_providers": [{"id": 615128020, "carrier_service_id": 260046840, "flat_modifier": "", "percent_modifier": null, "service_filter": {"*": "+"}, "shipping_zone_id": 44570466}]}]})); + + await shopify.rest.ShippingZone.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shipping_zones.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/shop.test.ts b/rest/admin/__tests__/2023-01/shop.test.ts new file mode 100644 index 000000000..a9a0cae91 --- /dev/null +++ b/rest/admin/__tests__/2023-01/shop.test.ts @@ -0,0 +1,68 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Shop resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"shop": {"id": 548380009, "name": "John Smith Test Store", "email": "j.smith@example.com", "domain": "shop.apple.com", "province": "California", "country": "US", "address1": "1 Infinite Loop", "zip": "95014", "city": "Cupertino", "source": null, "phone": "1231231234", "latitude": 45.45, "longitude": -75.43, "primary_locale": "en", "address2": "Suite 100", "created_at": "2007-12-31T19:00:00-05:00", "updated_at": "2023-01-03T12:55:05-05:00", "country_code": "US", "country_name": "United States", "currency": "USD", "customer_email": "customers@apple.com", "timezone": "(GMT-05:00) Eastern Time (US & Canada)", "iana_timezone": "America/New_York", "shop_owner": "John Smith", "money_format": "${{amount}}", "money_with_currency_format": "${{amount}} USD", "weight_unit": "lb", "province_code": "CA", "taxes_included": null, "auto_configure_tax_inclusivity": null, "tax_shipping": null, "county_taxes": true, "plan_display_name": "Shopify Plus", "plan_name": "enterprise", "has_discounts": true, "has_gift_cards": true, "myshopify_domain": "jsmith.myshopify.com", "google_apps_domain": null, "google_apps_login_enabled": null, "money_in_emails_format": "${{amount}}", "money_with_currency_in_emails_format": "${{amount}} USD", "eligible_for_payments": true, "requires_extra_payments_agreement": false, "password_enabled": false, "has_storefront": true, "eligible_for_card_reader_giveaway": false, "finances": true, "primary_location_id": 655441491, "cookie_consent_level": "implicit", "visitor_tracking_consent_preference": "allow_all", "checkout_api_supported": true, "multi_location_enabled": true, "setup_required": false, "pre_launch_enabled": false, "enabled_presentment_currencies": ["USD"], "transactional_sms_disabled": false, "marketing_sms_consent_enabled_at_checkout": false}})); + + await shopify.rest.Shop.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shop.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"shop": {"province": "California", "country": "US", "address1": "1 Infinite Loop", "city": "Cupertino", "address2": "Suite 100"}})); + + await shopify.rest.Shop.all({ + session: session, + fields: "address1,address2,city,province,country", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/shop.json', + query: 'fields=address1%2Caddress2%2Ccity%2Cprovince%2Ccountry', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/smart_collection.test.ts b/rest/admin/__tests__/2023-01/smart_collection.test.ts new file mode 100644 index 000000000..a2325bf3f --- /dev/null +++ b/rest/admin/__tests__/2023-01/smart_collection.test.ts @@ -0,0 +1,472 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('SmartCollection resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001318, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T12:43:30-05:00", "body_html": null, "published_at": "2023-01-03T12:43:29-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001318"}]})); + + await shopify.rest.SmartCollection.all({ + session: session, + since_id: "482865238", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/smart_collections.json', + query: 'since_id=482865238', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); + + await shopify.rest.SmartCollection.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/smart_collections.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); + + await shopify.rest.SmartCollection.all({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/smart_collections.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"smart_collections": [{"id": 1063001324, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:44:05-05:00", "body_html": null, "published_at": "2023-01-03T12:44:05-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001324"}, {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}]})); + + await shopify.rest.SmartCollection.all({ + session: session, + ids: "482865238,1063001324", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/smart_collections.json', + query: 'ids=482865238%2C1063001324', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.SmartCollection.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/smart_collections/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.SmartCollection.count({ + session: session, + product_id: "632910392", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/smart_collections/count.json', + query: 'product_id=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"id": 482865238, "handle": "smart-ipods", "title": "Smart iPods", "updated_at": "2008-02-01T19:00:00-05:00", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "products_count": 2, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); + + await shopify.rest.SmartCollection.find({ + session: session, + id: 482865238, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/smart_collections/482865238.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": null, "updated_at": "2023-01-03T12:43:43-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.published = false; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "id": 482865238, "published_at": "2023-01-03T12:43:23-05:00", "updated_at": "2023-01-03T12:43:23-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.published = true; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"published": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

The best selling ipod ever

", "handle": "smart-ipods", "updated_at": "2023-01-03T12:44:13-05:00", "id": 482865238, "sort_order": "manual", "title": "Smart iPods", "disjunctive": false, "template_suffix": null, "published_at": "2008-02-01T19:00:00-05:00", "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = ""; + smart_collection.updated_at = "2023-01-03T12:44:12-05:00"; + smart_collection.title = "Smart iPods"; + smart_collection.handle = "smart-ipods"; + smart_collection.body_html = "

The best selling ipod ever

"; + smart_collection.published_at = "2008-02-01T19:00:00-05:00"; + smart_collection.sort_order = "manual"; + smart_collection.template_suffix = null; + smart_collection.disjunctive = false; + smart_collection.rules = [ + { + "column": "type", + "relation": "equals", + "condition": "Cult Products" + } + ]; + smart_collection.published_scope = "web"; + smart_collection.admin_graphql_api_id = "gid://shopify/Collection/482865238"; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"image": "", "updated_at": "2023-01-03T12:44:12-05:00", "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2023-01-03T12:44:35-05:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:44:35-05:00", "alt": "Rails logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/fd43f2c8883f6e9b680e3295fd990d2c.gif?v=1672767875"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVrT7tdRtK3uffu6NWeaL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zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", + "alt": "Rails logo" + }; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"image": {"attachment": "R0lGODlhbgCMAPf/APbr48VySrxTO7IgKt2qmKQdJeK8lsFjROG5p/nz7Zg3\nMNmnd7Q1MLNVS9GId71hSJMZIuzTu4UtKbeEeakhKMl8U8WYjfr18YQaIbAf\nKKwhKdKzqpQtLebFortOOejKrOjZ1Mt7aMNpVbAqLLV7bsNqR+3WwMqEWenN\nsZYxL/Ddy/Pm2e7ZxLlUQrIjNPXp3bU5MbhENbEtLtqhj5ZQTfHh0bMxL7Ip\nNsNyUYkZIrZJPcqGdYIUHb5aPKkeJnoUHd2yiJkiLKYiKLRFOsyJXKVDO8up\nosFaS+TBnK4kKti5sNaYg/z49aqYl5kqLrljUtORfMOlo/36+H4ZH8yDYq0f\nKKFYTaU9MrY8MrZBNXwXHpgaIdGVYu/byLZNP9SaZLIyOuXCtHkpJst+Wpcm\nLMyCa8BfP9GMb9KQdPDd1PPk1sd5VP79/L5dQZ0bI9+ymqssK9WcfIoXHdzG\nxdWWfteib79lSr1YP86MYurQxKdcUKdMQr5ZSfPs6YEZH8uhl4oWIenMuurQ\nttmejaqoqsqBVaAcJLlJN5kvMLlZRMNsSL5fRak0LbdQQMVvSPjw6cJnRpkf\nKtmjhvfu5cJtT7IuOMVvWLY/M/37+o0YH9ibhtSYdObErc6HarM9NnYSGNGR\navLi09unje3WyeO8rsVr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vJwOLD7AQhU2efSbG6zm7VgiG1ofBc+//nGgZ7vbYw67aVux4v/\nfXSSK53by/HVrzIwDZTBBANUrzpMeAAIWASeB4P/AQ9+cHjEJx7xWgDE5nLQ\neMdHXvKbg/zkMZ23H/1oFRjYPOc9v3nQ58Aw0xn9LACvO7HQAOZVf/jl0ii1\nHcXe9bPX3euftaPL5R71tIf97nsy7/o0WlP2r4/JOU7B+r5nqva7jz1EdZ97\n4qNe+bonfvCfVXvly1762beOOdLBd+Q7PCAAOw==\n", "alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"updated_at": "2023-01-03T12:43:34-05:00", "id": 482865238, "title": "Smart iPods", "handle": "smart-ipods", "body_html": "

The best selling ipod ever

", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"alt": "Rails logo", "created_at": "2023-01-03T12:43:32-05:00", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-iapzkx.gif?v=1672767814"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.image = { + "alt": "Rails logo" + }; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"image": {"alt": "Rails logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_13', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"body_html": "

5000 songs in your pocket

", "title": "Smart iPods", "handle": "smart-ipods", "id": 482865238, "updated_at": "2023-01-03T12:44:20-05:00", "published_at": "2008-02-01T19:00:00-05:00", "sort_order": "manual", "template_suffix": null, "disjunctive": false, "rules": [{"column": "type", "relation": "equals", "condition": "Cult Products"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/482865238", "image": {"created_at": "2023-01-03T12:21:36-05:00", "alt": "MP3 Player 8gb", "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/ipod_nano_8gb.jpg?v=1672766496"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + smart_collection.body_html = "

5000 songs in your pocket

"; + await smart_collection.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/smart_collections/482865238.json', + query: '', + headers, + data: { "smart_collection": {"body_html": "

5000 songs in your pocket

"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_14', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.SmartCollection.delete({ + session: session, + id: 482865238, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/smart_collections/482865238.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_15', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001315, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:20-05:00", "body_html": null, "published_at": "2023-01-03T12:43:20-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001315", "image": {"created_at": "2023-01-03T12:43:20-05:00", "alt": "iPod", "width": 1, "height": 1, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/df3e567d6f16d040326c7a0ea29a4f41.gif?v=1672767800"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + smart_collection.image = { + "attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", + "alt": "iPod" + }; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"attachment": "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n", "alt": "iPod"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_16', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001314, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:18-05:00", "body_html": null, "published_at": "2023-01-03T12:43:18-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001314", "image": {"created_at": "2023-01-03T12:43:18-05:00", "alt": "Rails Logo", "width": 110, "height": 140, "src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/collections/rails_logo20230103-54493-xezjfo.gif?v=1672767798"}}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + smart_collection.image = { + "src": "http://example.com/rails_logo.gif", + "alt": "Rails Logo" + }; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "image": {"src": "http://example.com/rails_logo.gif", "alt": "Rails Logo"}} } + }).toMatchMadeHttpRequest(); + }); + + it('test_17', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001313, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:43:16-05:00", "body_html": null, "published_at": null, "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001313"}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + smart_collection.published = false; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published": false} } + }).toMatchMadeHttpRequest(); + }); + + it('test_18', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001326, "handle": "ipods-1", "title": "IPods", "updated_at": "2023-01-03T12:44:09-05:00", "body_html": null, "published_at": "2023-01-03T12:44:09-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001326"}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "IPods"; + smart_collection.rules = [ + { + "column": "title", + "relation": "starts_with", + "condition": "iPod" + } + ]; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "IPods", "rules": [{"column": "title", "relation": "starts_with", "condition": "iPod"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_19', async () => { + queueMockResponse(JSON.stringify({"smart_collection": {"id": 1063001329, "handle": "macbooks", "title": "Macbooks", "updated_at": "2023-01-03T12:44:38-05:00", "body_html": null, "published_at": "2023-01-03T12:44:38-05:00", "sort_order": "best-selling", "template_suffix": null, "disjunctive": false, "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}], "published_scope": "web", "admin_graphql_api_id": "gid://shopify/Collection/1063001329"}})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.title = "Macbooks"; + smart_collection.rules = [ + { + "column": "vendor", + "relation": "equals", + "condition": "Apple" + } + ]; + await smart_collection.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/smart_collections.json', + query: '', + headers, + data: { "smart_collection": {"title": "Macbooks", "rules": [{"column": "vendor", "relation": "equals", "condition": "Apple"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_20', async () => { + queueMockResponse(JSON.stringify({})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + await smart_collection.order({ + products: ["921728736", "632910392"], + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/smart_collections/482865238/order.json', + query: 'products%5B%5D=921728736&products%5B%5D=632910392', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_21', async () => { + queueMockResponse(JSON.stringify({})); + + const smart_collection = new shopify.rest.SmartCollection({session: session}); + smart_collection.id = 482865238; + await smart_collection.order({ + sort_order: "alpha-desc", + }); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/smart_collections/482865238/order.json', + query: 'sort_order=alpha-desc', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/storefront_access_token.test.ts b/rest/admin/__tests__/2023-01/storefront_access_token.test.ts new file mode 100644 index 000000000..beec3710a --- /dev/null +++ b/rest/admin/__tests__/2023-01/storefront_access_token.test.ts @@ -0,0 +1,85 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('StorefrontAccessToken resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"storefront_access_token": {"access_token": "b3ababb5c68d0062d5619d853abf6efa", "access_scope": "unauthenticated_read_product_listings", "created_at": "2023-01-03T12:44:44-05:00", "id": 1003303990, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/1003303990", "title": "Test"}})); + + const storefront_access_token = new shopify.rest.StorefrontAccessToken({session: session}); + storefront_access_token.title = "Test"; + await storefront_access_token.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/storefront_access_tokens.json', + query: '', + headers, + data: { "storefront_access_token": {"title": "Test"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"storefront_access_tokens": [{"access_token": "378d95641257a4ab3feff967ee234f4d", "access_scope": "unauthenticated_read_product_listings", "created_at": "2023-01-03T12:21:36-05:00", "id": 755357713, "admin_graphql_api_id": "gid://shopify/StorefrontAccessToken/755357713", "title": "API Client Extension"}]})); + + await shopify.rest.StorefrontAccessToken.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/storefront_access_tokens.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.StorefrontAccessToken.delete({ + session: session, + id: 755357713, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/storefront_access_tokens/755357713.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/tender_transaction.test.ts b/rest/admin/__tests__/2023-01/tender_transaction.test.ts new file mode 100644 index 000000000..46bd76124 --- /dev/null +++ b/rest/admin/__tests__/2023-01/tender_transaction.test.ts @@ -0,0 +1,140 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('TenderTransaction resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222852, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222851, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/tender_transactions.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222858, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + since_id: "1011222857", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/tender_transactions.json', + query: 'since_id=1011222857', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222855, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}, {"id": 1011222856, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + order: "processed_at ASC", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/tender_transactions.json', + query: 'order=processed_at+ASC', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222842, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-07T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + processed_at_min: "2005-08-06 10:22:51 -0400", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/tender_transactions.json', + query: 'processed_at_min=2005-08-06+10%3A22%3A51+-0400', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222853, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + processed_at_max: "2005-08-06 10:22:51 -0400", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/tender_transactions.json', + query: 'processed_at_max=2005-08-06+10%3A22%3A51+-0400', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"tender_transactions": [{"id": 1011222843, "order_id": 450789469, "amount": "250.94", "currency": "USD", "user_id": null, "test": false, "processed_at": "2005-08-05T10:22:51-04:00", "remote_reference": "authorization-key", "payment_details": null, "payment_method": "credit_card"}]})); + + await shopify.rest.TenderTransaction.all({ + session: session, + processed_at_max: "2005-08-05 10:22:51 -0400", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/tender_transactions.json', + query: 'processed_at_max=2005-08-05+10%3A22%3A51+-0400', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/theme.test.ts b/rest/admin/__tests__/2023-01/theme.test.ts new file mode 100644 index 000000000..31445fd15 --- /dev/null +++ b/rest/admin/__tests__/2023-01/theme.test.ts @@ -0,0 +1,141 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Theme resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"themes": [{"id": 828155753, "name": "Comfort", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}, {"id": 976877075, "name": "Preview of Parallax", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "demo", "theme_store_id": 688, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/976877075"}, {"id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}]})); + + await shopify.rest.Theme.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/themes.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"theme": {"id": 1049083723, "name": "Lemongrass", "created_at": "2023-01-03T12:25:57-05:00", "updated_at": "2023-01-03T12:25:57-05:00", "role": "unpublished", "theme_store_id": null, "previewable": false, "processing": true, "admin_graphql_api_id": "gid://shopify/Theme/1049083723"}})); + + const theme = new shopify.rest.Theme({session: session}); + theme.name = "Lemongrass"; + theme.src = "http://themes.shopify.com/theme.zip"; + theme.role = "main"; + await theme.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/themes.json', + query: '', + headers, + data: { "theme": {"name": "Lemongrass", "src": "http://themes.shopify.com/theme.zip", "role": "main"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"theme": {"id": 828155753, "name": "Comfort", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "main", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/828155753"}})); + + await shopify.rest.Theme.find({ + session: session, + id: 828155753, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/themes/828155753.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"theme": {"role": "main", "id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:51-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + + const theme = new shopify.rest.Theme({session: session}); + theme.id = 752253240; + theme.role = "main"; + await theme.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/themes/752253240.json', + query: '', + headers, + data: { "theme": {"role": "main"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"theme": {"name": "Experimental", "role": "unpublished", "id": 752253240, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:26:01-05:00", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"}})); + + const theme = new shopify.rest.Theme({session: session}); + theme.id = 752253240; + theme.name = "Experimental"; + await theme.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/themes/752253240.json', + query: '', + headers, + data: { "theme": {"name": "Experimental"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"id": 752253240, "name": "Sandbox", "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "role": "unpublished", "theme_store_id": null, "previewable": true, "processing": false, "admin_graphql_api_id": "gid://shopify/Theme/752253240"})); + + await shopify.rest.Theme.delete({ + session: session, + id: 752253240, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/themes/752253240.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/transaction.test.ts b/rest/admin/__tests__/2023-01/transaction.test.ts new file mode 100644 index 000000000..f3e8b09a9 --- /dev/null +++ b/rest/admin/__tests__/2023-01/transaction.test.ts @@ -0,0 +1,190 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Transaction resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"transactions": [{"id": 179259969, "order_id": 450789469, "kind": "refund", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T12:59:12-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 801038806, "processed_at": "2005-08-05T12:59:12-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "209.00", "currency": "USD", "payment_id": "#1001.3", "admin_graphql_api_id": "gid://shopify/OrderTransaction/179259969"}, {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "#1001.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}, {"id": 801038806, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-05T10:22:51-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2005-08-05T10:22:51-04:00", "device_id": null, "error_code": null, "source_name": "web", "receipt": {}, "currency_exchange_adjustment": null, "amount": "250.94", "currency": "USD", "payment_id": "#1001.2", "admin_graphql_api_id": "gid://shopify/OrderTransaction/801038806"}]})); + + await shopify.rest.Transaction.all({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/transactions.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"transactions": [{"id": 1068278485, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:26-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:26-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278485"}]})); + + await shopify.rest.Transaction.all({ + session: session, + order_id: 450789469, + since_id: "801038806", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/transactions.json', + query: 'since_id=801038806', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278488, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:33-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:33-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278488"}})); + + const transaction = new shopify.rest.Transaction({session: session}); + transaction.order_id = 450789469; + transaction.currency = "USD"; + transaction.amount = "10.00"; + transaction.kind = "capture"; + transaction.parent_id = 389404469; + await transaction.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/transactions.json', + query: '', + headers, + data: { "transaction": {"currency": "USD", "amount": "10.00", "kind": "capture", "parent_id": 389404469} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278486, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:29-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:29-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278486"}})); + + const transaction = new shopify.rest.Transaction({session: session}); + transaction.order_id = 450789469; + transaction.kind = "capture"; + transaction.authorization = "authorization-key"; + await transaction.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/transactions.json', + query: '', + headers, + data: { "transaction": {"kind": "capture", "authorization": "authorization-key"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278484, "order_id": 450789469, "kind": "capture", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:24-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:24-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "10.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278484"}})); + + const transaction = new shopify.rest.Transaction({session: session}); + transaction.order_id = 450789469; + transaction.currency = "USD"; + transaction.amount = "10.00"; + transaction.kind = "capture"; + transaction.parent_id = 389404469; + transaction.test = true; + await transaction.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/transactions.json', + query: '', + headers, + data: { "transaction": {"currency": "USD", "amount": "10.00", "kind": "capture", "parent_id": 389404469, "test": true} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"transaction": {"id": 1068278487, "order_id": 450789469, "kind": "void", "gateway": "bogus", "status": "success", "message": "Bogus Gateway: Forced success", "created_at": "2023-01-03T12:54:31-05:00", "test": true, "authorization": null, "location_id": null, "user_id": null, "parent_id": 389404469, "processed_at": "2023-01-03T12:54:31-05:00", "device_id": null, "error_code": null, "source_name": "755357713", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa", "credit_card_name": null, "credit_card_wallet": null, "credit_card_expiration_month": null, "credit_card_expiration_year": null}, "receipt": {}, "currency_exchange_adjustment": null, "amount": "0.00", "currency": "USD", "payment_id": "c901414060.1", "admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278487"}})); + + const transaction = new shopify.rest.Transaction({session: session}); + transaction.order_id = 450789469; + transaction.currency = "USD"; + transaction.amount = "10.00"; + transaction.kind = "void"; + transaction.parent_id = 389404469; + await transaction.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/orders/450789469/transactions.json', + query: '', + headers, + data: { "transaction": {"currency": "USD", "amount": "10.00", "kind": "void", "parent_id": 389404469} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"count": 3})); + + await shopify.rest.Transaction.count({ + session: session, + order_id: 450789469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/transactions/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"transaction": {"id": 389404469, "order_id": 450789469, "kind": "authorization", "gateway": "bogus", "status": "success", "message": null, "created_at": "2005-08-01T11:57:11-04:00", "test": false, "authorization": "authorization-key", "location_id": null, "user_id": null, "parent_id": null, "processed_at": "2005-08-01T11:57:11-04:00", "device_id": null, "error_code": null, "source_name": "web", "payment_details": {"credit_card_bin": null, "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 4242", "credit_card_company": "Visa"}, "receipt": {"testcase": true, "authorization": "123456"}, "currency_exchange_adjustment": null, "amount": "598.94", "currency": "USD", "authorization_expires_at": null, "extended_authorization_attributes": {}, "admin_graphql_api_id": "gid://shopify/OrderTransaction/389404469"}})); + + await shopify.rest.Transaction.find({ + session: session, + order_id: 450789469, + id: 389404469, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/orders/450789469/transactions/389404469.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/usage_charge.test.ts b/rest/admin/__tests__/2023-01/usage_charge.test.ts new file mode 100644 index 000000000..817a9c6cb --- /dev/null +++ b/rest/admin/__tests__/2023-01/usage_charge.test.ts @@ -0,0 +1,89 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('UsageCharge resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618209, "description": "Super Mega Plan 1000 emails", "price": "1.00", "created_at": "2023-01-03T12:42:12-05:00", "billing_on": null, "balance_used": 11.0, "balance_remaining": 89.0, "risk_level": 0}})); + + const usage_charge = new shopify.rest.UsageCharge({session: session}); + usage_charge.recurring_application_charge_id = 455696195; + usage_charge.description = "Super Mega Plan 1000 emails"; + usage_charge.price = 1.0; + await usage_charge.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/recurring_application_charges/455696195/usage_charges.json', + query: '', + headers, + data: { "usage_charge": {"description": "Super Mega Plan 1000 emails", "price": 1.0} } + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"usage_charges": [{"id": 1034618206, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2023-01-03T12:42:08-05:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}]})); + + await shopify.rest.UsageCharge.all({ + session: session, + recurring_application_charge_id: 455696195, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/recurring_application_charges/455696195/usage_charges.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"usage_charge": {"id": 1034618207, "description": "Super Mega Plan Add-ons", "price": "10.00", "created_at": "2023-01-03T12:42:10-05:00", "billing_on": null, "balance_used": 10.0, "balance_remaining": 90.0, "risk_level": 0}})); + + await shopify.rest.UsageCharge.find({ + session: session, + recurring_application_charge_id: 455696195, + id: 1034618207, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/recurring_application_charges/455696195/usage_charges/1034618207.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/user.test.ts b/rest/admin/__tests__/2023-01/user.test.ts new file mode 100644 index 000000000..8d52a2a51 --- /dev/null +++ b/rest/admin/__tests__/2023-01/user.test.ts @@ -0,0 +1,85 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('User resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"users": [{"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}, {"id": 930143300, "first_name": "John", "email": "j.limited@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Limited", "account_owner": false, "receive_announcements": 1, "bio": null, "permissions": [], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/930143300", "tfa_enabled?": false}]})); + + await shopify.rest.User.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/users.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); + + await shopify.rest.User.find({ + session: session, + id: 548380009, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/users/548380009.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"user": {"id": 548380009, "first_name": "John", "email": "j.smith@example.com", "url": "www.example.com", "im": null, "screen_name": null, "phone": null, "last_name": "Smith", "account_owner": true, "receive_announcements": 1, "bio": null, "permissions": ["applications", "beacons", "billing_application_charges", "channels", "content", "content_entries_delete", "content_entries_edit", "content_entries_view", "content_models_delete", "content_models_edit", "content_models_view", "custom_pixels_management", "custom_pixels_view", "customers", "dashboard", "domains", "draft_orders", "edit_orders", "edit_private_apps", "gift_cards", "links", "locations", "marketing", "marketing_section", "metaobjects_delete", "metaobjects_edit", "metaobjects_view", "metaobject_definitions_delete", "metaobject_definitions_edit", "metaobject_definitions_view", "orders", "overviews", "pages", "pay_draft_orders_by_credit_card", "pay_orders_by_credit_card", "pay_orders_by_vaulted_card", "preferences", "products", "refund_orders", "reports", "translations", "themes", "view_private_apps", "shopify_payments_accounts", "shopify_payments_transfers", "staff_audit_log_view", "staff_management_update", "applications_billing", "attestation_authority", "authentication_management", "balance_bank_accounts_management", "billing_charges", "billing_invoices_pay", "billing_invoices_view", "billing_payment_methods_manage", "billing_payment_methods_view", "billing_settings", "billing_subscriptions", "capital", "shopify_credit", "customer_private_data", "erase_customer_data", "request_customer_data", "domains_management", "enable_private_apps", "experiments_management", "gdpr_actions", "payment_settings", "shopify_payments", "staff_api_permission_management", "staff_management", "staff_management_activation", "staff_management_create", "staff_management_delete", "support_methods", "collaborator_request_management", "collaborator_request_settings", "export_customers", "export_draft_orders", "export_orders", "export_products"], "locale": "en", "user_type": "regular", "admin_graphql_api_id": "gid://shopify/StaffMember/548380009", "tfa_enabled?": false}})); + + await shopify.rest.User.current({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/users/current.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/variant.test.ts b/rest/admin/__tests__/2023-01/variant.test.ts new file mode 100644 index 000000000..68dec2b4b --- /dev/null +++ b/rest/admin/__tests__/2023-01/variant.test.ts @@ -0,0 +1,270 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Variant resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + + await shopify.rest.Variant.all({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/variants.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"variants": [{"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + + await shopify.rest.Variant.all({ + session: session, + product_id: 632910392, + since_id: "49148385", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/variants.json', + query: 'since_id=49148385', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"variants": [{"id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "inventory_quantity": 30, "old_inventory_quantity": 30, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"}, {"id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "inventory_quantity": 20, "old_inventory_quantity": 20, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"}, {"id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "inventory_quantity": 40, "old_inventory_quantity": 40, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"}, {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": "249.00", "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": {"amount": "249.00", "currency_code": "USD"}}, {"price": {"amount": "249.00", "currency_code": "CAD"}, "compare_at_price": {"amount": "312.00", "currency_code": "CAD"}}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}]})); + + await shopify.rest.Variant.all({ + session: session, + product_id: 632910392, + presentment_currencies: "USD,CAD", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/variants.json', + query: 'presentment_currencies=USD%2CCAD', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"variant": {"id": 1070325020, "product_id": 632910392, "title": "Yellow", "price": "1.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Yellow", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:18-05:00", "updated_at": "2023-01-03T12:25:18-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325020, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "1.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325020"}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Yellow"; + variant.price = "1.00"; + await variant.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/variants.json', + query: '', + headers, + data: { "variant": {"option1": "Yellow", "price": "1.00"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"variant": {"id": 1070325023, "product_id": 632910392, "title": "Blue", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Blue", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:36-05:00", "updated_at": "2023-01-03T12:25:36-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325023, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325023"}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.option1 = "Blue"; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await variant.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/variants.json', + query: '', + headers, + data: { "variant": {"option1": "Blue", "metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"variant": {"id": 1070325022, "product_id": 632910392, "title": "Purple", "price": "0.00", "sku": "", "position": 5, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Purple", "option2": null, "option3": null, "created_at": "2023-01-03T12:25:32-05:00", "updated_at": "2023-01-03T12:25:32-05:00", "taxable": true, "barcode": null, "grams": 0, "image_id": 850703190, "weight": 0.0, "weight_unit": "lb", "inventory_item_id": 1070325022, "inventory_quantity": 0, "old_inventory_quantity": 0, "presentment_prices": [{"price": {"amount": "0.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/1070325022"}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.product_id = 632910392; + variant.image_id = 850703190; + variant.option1 = "Purple"; + await variant.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/products/632910392/variants.json', + query: '', + headers, + data: { "variant": {"image_id": 850703190, "option1": "Purple"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"count": 4})); + + await shopify.rest.Variant.count({ + session: session, + product_id: 632910392, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/products/632910392/variants/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:21:36-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "tax_code": "DA040000", "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + + await shopify.rest.Variant.find({ + session: session, + id: 808950810, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/variants/808950810.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:13-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.id = 808950810; + variant.metafields = [ + { + "key": "new", + "value": "newvalue", + "type": "single_line_text_field", + "namespace": "global" + } + ]; + await variant.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/variants/808950810.json', + query: '', + headers, + data: { "variant": {"metafields": [{"key": "new", "value": "newvalue", "type": "single_line_text_field", "namespace": "global"}]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:26-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "199.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.id = 808950810; + variant.image_id = 562641783; + await variant.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/variants/808950810.json', + query: '', + headers, + data: { "variant": {"image_id": 562641783} } + }).toMatchMadeHttpRequest(); + }); + + it('test_11', async () => { + queueMockResponse(JSON.stringify({"variant": {"id": 808950810, "product_id": 632910392, "title": "Not Pink", "price": "99.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Not Pink", "option2": null, "option3": null, "created_at": "2023-01-03T12:21:36-05:00", "updated_at": "2023-01-03T12:25:43-05:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "inventory_quantity": 10, "old_inventory_quantity": 10, "presentment_prices": [{"price": {"amount": "99.00", "currency_code": "USD"}, "compare_at_price": null}], "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"}})); + + const variant = new shopify.rest.Variant({session: session}); + variant.id = 808950810; + variant.option1 = "Not Pink"; + variant.price = "99.00"; + await variant.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/variants/808950810.json', + query: '', + headers, + data: { "variant": {"option1": "Not Pink", "price": "99.00"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_12', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Variant.delete({ + session: session, + product_id: 632910392, + id: 808950810, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/products/632910392/variants/808950810.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +}); diff --git a/rest/admin/__tests__/2023-01/webhook.test.ts b/rest/admin/__tests__/2023-01/webhook.test.ts new file mode 100644 index 000000000..8b868e8ff --- /dev/null +++ b/rest/admin/__tests__/2023-01/webhook.test.ts @@ -0,0 +1,218 @@ +/*********************************************************************************************************************** +* This file is auto-generated. If you have an issue, please create a GitHub issue. * +***********************************************************************************************************************/ + +import {Session} from '../../../../lib/session/session'; +import {testConfig, queueMockResponse} from '../../../../lib/__tests__/test-helper'; +import {ApiVersion} from '../../../../lib/types'; +import {shopifyApi, Shopify} from '../../../../lib'; + +import {restResources} from '../../2023-01'; + +let shopify: Shopify; + +beforeEach(() => { + shopify = shopifyApi({ + ...testConfig, + apiVersion: ApiVersion.January23, + restResources, + }); +}); + +describe('Webhook resource', () => { + const domain = 'test-shop.myshopify.io'; + const headers = {'X-Shopify-Access-Token': 'this_is_a_test_token'}; + const session = new Session({ + id: '1234', + shop: domain, + state: '1234', + isOnline: true, + }); + session.accessToken = 'this_is_a_test_token'; + + it('test_1', async () => { + queueMockResponse(JSON.stringify({"webhooks": [{"id": 4759306, "address": "https://apple.com", "topic": "orders/create", "created_at": "2022-12-13T13:49:15-05:00", "updated_at": "2022-12-13T13:49:15-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}, {"id": 892403750, "address": "https://example.org/fully_loaded_1", "topic": "orders/cancelled", "created_at": "2021-12-01T05:23:43-05:00", "updated_at": "2021-12-01T05:23:43-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}, {"id": 901431826, "address": "https://apple.com/uninstall", "topic": "app/uninstalled", "created_at": "2022-12-13T13:49:15-05:00", "updated_at": "2022-12-13T13:49:15-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}, {"id": 1014196360, "address": "https://example.org/app_uninstalled", "topic": "app/uninstalled", "created_at": "2022-12-13T13:49:15-05:00", "updated_at": "2022-12-13T13:49:15-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}]})); + + await shopify.rest.Webhook.all({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/webhooks.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_2', async () => { + queueMockResponse(JSON.stringify({"webhooks": [{"id": 1014196360, "address": "https://example.org/app_uninstalled", "topic": "app/uninstalled", "created_at": "2022-12-13T13:49:15-05:00", "updated_at": "2022-12-13T13:49:15-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}]})); + + await shopify.rest.Webhook.all({ + session: session, + since_id: "901431826", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/webhooks.json', + query: 'since_id=901431826', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_3', async () => { + queueMockResponse(JSON.stringify({"webhook": {"id": 7041679462, "address": "pubsub://projectName:topicName", "topic": "customers/update", "created_at": "2022-12-13T13:54:52-05:00", "updated_at": "2022-12-13T13:54:52-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + const webhook = new shopify.rest.Webhook({session: session}); + webhook.address = "pubsub://projectName:topicName"; + webhook.topic = "customers/update"; + webhook.format = "json"; + await webhook.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/webhooks.json', + query: '', + headers, + data: { "webhook": {"address": "pubsub://projectName:topicName", "topic": "customers/update", "format": "json"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_4', async () => { + queueMockResponse(JSON.stringify({"webhook": {"id": 7041679455, "address": "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/755357713/example-event-source", "topic": "customers/update", "created_at": "2022-12-13T13:53:43-05:00", "updated_at": "2022-12-13T13:53:43-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + const webhook = new shopify.rest.Webhook({session: session}); + webhook.address = "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/755357713/example-event-source"; + webhook.topic = "customers/update"; + webhook.format = "json"; + await webhook.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/webhooks.json', + query: '', + headers, + data: { "webhook": {"address": "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/755357713/example-event-source", "topic": "customers/update", "format": "json"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_5', async () => { + queueMockResponse(JSON.stringify({"webhook": {"id": 7041679469, "address": "https://example.hostname.com/", "topic": "orders/create", "created_at": "2022-12-13T13:55:57-05:00", "updated_at": "2022-12-13T13:55:57-05:00", "format": "json", "fields": ["id", "note"], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + const webhook = new shopify.rest.Webhook({session: session}); + webhook.topic = "orders/create"; + webhook.address = "https://example.hostname.com/"; + webhook.format = "json"; + webhook.fields = [ + "id", + "note" + ]; + await webhook.save({}); + + expect({ + method: 'POST', + domain, + path: '/admin/api/2023-01/webhooks.json', + query: '', + headers, + data: { "webhook": {"topic": "orders/create", "address": "https://example.hostname.com/", "format": "json", "fields": ["id", "note"]} } + }).toMatchMadeHttpRequest(); + }); + + it('test_6', async () => { + queueMockResponse(JSON.stringify({"count": 1})); + + await shopify.rest.Webhook.count({ + session: session, + topic: "orders/create", + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/webhooks/count.json', + query: 'topic=orders%2Fcreate', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_7', async () => { + queueMockResponse(JSON.stringify({"count": 4})); + + await shopify.rest.Webhook.count({ + session: session, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/webhooks/count.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_8', async () => { + queueMockResponse(JSON.stringify({"webhook": {"id": 4759306, "address": "https://apple.com", "topic": "orders/create", "created_at": "2022-12-13T13:49:15-05:00", "updated_at": "2022-12-13T13:49:15-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + await shopify.rest.Webhook.find({ + session: session, + id: 4759306, + }); + + expect({ + method: 'GET', + domain, + path: '/admin/api/2023-01/webhooks/4759306.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + + it('test_9', async () => { + queueMockResponse(JSON.stringify({"webhook": {"id": 4759306, "address": "https://somewhere-else.com/", "topic": "orders/create", "created_at": "2022-12-13T13:49:15-05:00", "updated_at": "2022-12-13T13:55:59-05:00", "format": "json", "fields": [], "metafield_namespaces": [], "api_version": "unstable", "private_metafield_namespaces": []}})); + + const webhook = new shopify.rest.Webhook({session: session}); + webhook.id = 4759306; + webhook.address = "https://somewhere-else.com/"; + await webhook.save({}); + + expect({ + method: 'PUT', + domain, + path: '/admin/api/2023-01/webhooks/4759306.json', + query: '', + headers, + data: { "webhook": {"address": "https://somewhere-else.com/"} } + }).toMatchMadeHttpRequest(); + }); + + it('test_10', async () => { + queueMockResponse(JSON.stringify({})); + + await shopify.rest.Webhook.delete({ + session: session, + id: 4759306, + }); + + expect({ + method: 'DELETE', + domain, + path: '/admin/api/2023-01/webhooks/4759306.json', + query: '', + headers, + data: undefined + }).toMatchMadeHttpRequest(); + }); + +});