diff --git a/src/v0/sources/shopify/config.js b/src/v0/sources/shopify/config.js index a5ededf9da9..7f5d41ec964 100644 --- a/src/v0/sources/shopify/config.js +++ b/src/v0/sources/shopify/config.js @@ -35,7 +35,7 @@ const SHOPIFY_TRACK_MAP = { orders_cancelled: 'Order Cancelled', orders_fulfilled: 'Order Fulfilled', orders_paid: 'Order Paid', - orders_partially_fullfilled: 'Order Partially Fulfilled', + orders_partially_fulfilled: 'Order Partially Fulfilled', // following are the events that supported by rudderstack pixel app as generic track events customer_tags_added: 'Customer Tags Added', customer_tags_removed: 'Customer Tags Removed', @@ -125,7 +125,7 @@ const SUPPORTED_TRACK_EVENTS = [ 'orders_cancelled', 'orders_fulfilled', 'orders_paid', - 'orders_partially_fullfilled', + 'orders_partially_fulfilled', // following are the events that supported by rudderstack pixel app as generic track events 'customer_tags_added', 'customer_tags_removed', diff --git a/test/integrations/sources/shopify/data.ts b/test/integrations/sources/shopify/data.ts index 7a74bc4d06a..a2b27cbbccd 100644 --- a/test/integrations/sources/shopify/data.ts +++ b/test/integrations/sources/shopify/data.ts @@ -610,6 +610,827 @@ const serverSideEventsScenarios = [ }, }, }, + { + name: 'shopify', + description: 'Track Call -> Order Partially Fulfilled event', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + query_parameters: { + topic: ['orders_partially_fulfilled'], + writeKey: ['sample-write-key'], + signature: ['rudderstack'], + }, + id: 820982911946154508, + admin_graphql_api_id: 'gid://shopify/Order/820982911946154508', + app_id: null, + browser_ip: null, + buyer_accepts_marketing: true, + cancel_reason: 'customer', + cancelled_at: '2021-12-31T19:00:00-05:00', + cart_token: null, + checkout_id: null, + checkout_token: null, + client_details: null, + closed_at: null, + confirmation_number: null, + confirmed: false, + contact_email: 'jon@example.com', + created_at: '2021-12-31T19:00:00-05:00', + currency: 'USD', + current_subtotal_price: '398.00', + current_subtotal_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, + }, + current_total_additional_fees_set: null, + 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: '398.00', + current_total_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.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: 'en', + device_id: null, + discount_codes: [], + email: 'jon@example.com', + estimated_taxes: false, + financial_status: 'voided', + fulfillment_status: 'pending', + landing_site: null, + landing_site_ref: null, + location_id: null, + merchant_of_record_app_id: null, + name: '#9999', + note: null, + note_attributes: [], + number: 234, + order_number: 1234, + order_status_url: + 'https://jsmith.myshopify.com/548380009/orders/123456abcd/authenticate?key=abcdefg', + original_total_additional_fees_set: null, + original_total_duties_set: null, + payment_gateway_names: ['visa', 'bogus'], + phone: null, + po_number: null, + presentment_currency: 'USD', + processed_at: '2021-12-31T19:00:00-05:00', + reference: null, + referring_site: null, + source_identifier: null, + source_name: 'web', + source_url: null, + subtotal_price: '388.00', + subtotal_price_set: { + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, + }, + tags: 'tag1, tag2', + tax_exempt: false, + tax_lines: [], + taxes_included: false, + test: true, + token: '123456abcd', + total_discounts: '20.00', + total_discounts_set: { + shop_money: { + amount: '20.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '20.00', + currency_code: 'USD', + }, + }, + total_line_items_price: '398.00', + total_line_items_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, + }, + total_outstanding: '398.00', + total_price: '388.00', + total_price_set: { + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, + }, + total_shipping_price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.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: '2021-12-31T19:00:00-05:00', + user_id: null, + billing_address: { + first_name: 'Steve', + address1: '123 Shipping Street', + phone: '555-555-SHIP', + city: 'Shippington', + zip: '40003', + province: 'Kentucky', + country: 'United States', + last_name: 'Shipper', + address2: null, + company: 'Shipping Company', + latitude: null, + longitude: null, + name: 'Steve Shipper', + country_code: 'US', + province_code: 'KY', + }, + customer: { + id: 115310627314723954, + email: 'john@example.com', + created_at: null, + updated_at: null, + first_name: 'John', + last_name: 'Smith', + state: 'disabled', + note: null, + verified_email: true, + multipass_identifier: null, + tax_exempt: false, + phone: null, + email_marketing_consent: { + state: 'not_subscribed', + opt_in_level: null, + consent_updated_at: null, + }, + sms_marketing_consent: null, + tags: '', + currency: 'USD', + tax_exemptions: [], + admin_graphql_api_id: 'gid://shopify/Customer/115310627314723954', + default_address: { + id: 715243470612851245, + customer_id: 115310627314723954, + first_name: null, + last_name: null, + company: null, + address1: '123 Elm St.', + address2: null, + city: 'Ottawa', + province: 'Ontario', + country: 'Canada', + zip: 'K2H7A8', + phone: '123-123-1234', + name: '', + province_code: 'ON', + country_code: 'CA', + country_name: 'Canada', + default: true, + }, + }, + discount_applications: [], + fulfillments: [], + line_items: [ + { + id: 866550311766439020, + admin_graphql_api_id: 'gid://shopify/LineItem/866550311766439020', + attributed_staffs: [ + { + id: 'gid://shopify/StaffMember/902541635', + quantity: 1, + }, + ], + current_quantity: 1, + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + name: 'IPod Nano - 8GB', + price: '199.00', + price_set: { + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, + }, + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + variant_id: 808950810, + variant_inventory_management: 'shopify', + variant_title: null, + vendor: null, + tax_lines: [], + duties: [], + discount_allocations: [], + }, + { + id: 141249953214522974, + admin_graphql_api_id: 'gid://shopify/LineItem/141249953214522974', + attributed_staffs: [], + current_quantity: 1, + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + name: 'IPod Nano - 8GB', + price: '199.00', + price_set: { + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, + }, + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + variant_id: 808950810, + variant_inventory_management: 'shopify', + variant_title: null, + vendor: null, + tax_lines: [], + duties: [], + discount_allocations: [], + }, + ], + payment_terms: null, + refunds: [], + shipping_address: { + first_name: 'Steve', + address1: '123 Shipping Street', + phone: '555-555-SHIP', + city: 'Shippington', + zip: '40003', + province: 'Kentucky', + country: 'United States', + last_name: 'Shipper', + address2: null, + company: 'Shipping Company', + latitude: null, + longitude: null, + name: 'Steve Shipper', + country_code: 'US', + province_code: 'KY', + }, + shipping_lines: [ + { + id: 271878346596884015, + carrier_identifier: null, + code: null, + discounted_price: '10.00', + discounted_price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, + }, + is_removed: false, + phone: null, + price: '10.00', + price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, + }, + requested_fulfillment_service_id: null, + source: 'shopify', + title: 'Generic Shipping', + tax_lines: [], + discount_allocations: [], + }, + ], + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + cart_token: null, + checkout_token: null, + integration: { + name: 'SHOPIFY', + }, + library: { + name: 'RudderStack Shopify Cloud', + version: '1.0.0', + }, + topic: 'orders_partially_fulfilled', + }, + event: 'Order Partially Fulfilled', + integrations: { + SHOPIFY: true, + }, + properties: { + admin_graphql_api_id: 'gid://shopify/Order/820982911946154508', + app_id: null, + browser_ip: null, + buyer_accepts_marketing: true, + cancel_reason: 'customer', + cancelled_at: '2021-12-31T19:00:00-05:00', + cart_token: null, + checkout_id: null, + checkout_token: null, + client_details: null, + closed_at: null, + confirmation_number: null, + confirmed: false, + contact_email: 'jon@example.com', + created_at: '2021-12-31T19:00:00-05:00', + currency: 'USD', + current_subtotal_price: '398.00', + current_subtotal_price_set: { + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + }, + current_total_additional_fees_set: null, + current_total_discounts: '0.00', + current_total_discounts_set: { + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + current_total_duties_set: null, + current_total_price: '398.00', + current_total_price_set: { + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + }, + current_total_tax: '0.00', + current_total_tax_set: { + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + customer_locale: 'en', + device_id: null, + discount_applications: [], + discount_codes: [], + email: 'jon@example.com', + estimated_taxes: false, + financial_status: 'voided', + fulfillment_status: 'pending', + fulfillments: [], + id: 820982911946154500, + landing_site: null, + landing_site_ref: null, + location_id: null, + merchant_of_record_app_id: null, + name: '#9999', + note: null, + note_attributes: [], + number: 234, + order_number: 1234, + order_status_url: + 'https://jsmith.myshopify.com/548380009/orders/123456abcd/authenticate?key=abcdefg', + original_total_additional_fees_set: null, + original_total_duties_set: null, + payment_gateway_names: ['visa', 'bogus'], + payment_terms: null, + phone: null, + po_number: null, + presentment_currency: 'USD', + processed_at: '2021-12-31T19:00:00-05:00', + products: [ + { + admin_graphql_api_id: 'gid://shopify/LineItem/866550311766439020', + attributed_staffs: [ + { + id: 'gid://shopify/StaffMember/902541635', + quantity: 1, + }, + ], + current_quantity: 1, + discount_allocations: [], + duties: [], + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + id: 866550311766439000, + price: '199.00', + price_set: { + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + }, + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + tax_lines: [], + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + variant: '808950810 ', + variant_inventory_management: 'shopify', + }, + { + admin_graphql_api_id: 'gid://shopify/LineItem/141249953214522974', + attributed_staffs: [], + current_quantity: 1, + discount_allocations: [], + duties: [], + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + id: 141249953214522980, + price: '199.00', + price_set: { + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + }, + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + tax_lines: [], + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + variant: '808950810 ', + variant_inventory_management: 'shopify', + }, + ], + reference: null, + referring_site: null, + refunds: [], + shipping_lines: [ + { + carrier_identifier: null, + code: null, + discount_allocations: [], + discounted_price: '10.00', + discounted_price_set: { + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + }, + id: 271878346596884000, + is_removed: false, + phone: null, + price: '10.00', + price_set: { + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + }, + requested_fulfillment_service_id: null, + source: 'shopify', + tax_lines: [], + title: 'Generic Shipping', + }, + ], + source_identifier: null, + source_name: 'web', + source_url: null, + subtotal_price: '388.00', + subtotal_price_set: { + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + }, + tags: 'tag1, tag2', + tax_exempt: false, + tax_lines: [], + taxes_included: false, + test: true, + token: '123456abcd', + total_discounts: '20.00', + total_discounts_set: { + presentment_money: { + amount: '20.00', + currency_code: 'USD', + }, + shop_money: { + amount: '20.00', + currency_code: 'USD', + }, + }, + total_line_items_price: '398.00', + total_line_items_price_set: { + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + }, + total_outstanding: '398.00', + total_price: '388.00', + total_price_set: { + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + }, + total_shipping_price_set: { + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + }, + total_tax: '0.00', + total_tax_set: { + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + total_tip_received: '0.00', + total_weight: 0, + updated_at: '2021-12-31T19:00:00-05:00', + user_id: null, + }, + traits: { + address: { + address1: '123 Elm St.', + address2: null, + city: 'Ottawa', + company: null, + country: 'Canada', + country_code: 'CA', + country_name: 'Canada', + customer_id: 115310627314723950, + default: true, + first_name: null, + id: 715243470612851200, + last_name: null, + name: '', + phone: '123-123-1234', + province: 'Ontario', + province_code: 'ON', + zip: 'K2H7A8', + }, + adminGraphqlApiId: 'gid://shopify/Customer/115310627314723954', + billingAddress: { + address1: '123 Shipping Street', + address2: null, + city: 'Shippington', + company: 'Shipping Company', + country: 'United States', + country_code: 'US', + first_name: 'Steve', + last_name: 'Shipper', + latitude: null, + longitude: null, + name: 'Steve Shipper', + phone: '555-555-SHIP', + province: 'Kentucky', + province_code: 'KY', + zip: '40003', + }, + currency: 'USD', + email: 'john@example.com', + firstName: 'John', + lastName: 'Smith', + shippingAddress: { + address1: '123 Shipping Street', + address2: null, + city: 'Shippington', + company: 'Shipping Company', + country: 'United States', + country_code: 'US', + first_name: 'Steve', + last_name: 'Shipper', + latitude: null, + longitude: null, + name: 'Steve Shipper', + phone: '555-555-SHIP', + province: 'Kentucky', + province_code: 'KY', + zip: '40003', + }, + state: 'disabled', + tags: '', + taxExempt: false, + taxExemptions: [], + verifiedEmail: true, + }, + type: 'track', + userId: '115310627314723950', + }, + ], + }, + }, + ], + }, + }, + }, ]; export const data = [