diff --git a/airbyte-integrations/connectors/source-shopify/integration_tests/abnormal_state.json b/airbyte-integrations/connectors/source-shopify/integration_tests/abnormal_state.json index 41c0eddf197dcf..dc792db8fa23b2 100644 --- a/airbyte-integrations/connectors/source-shopify/integration_tests/abnormal_state.json +++ b/airbyte-integrations/connectors/source-shopify/integration_tests/abnormal_state.json @@ -35,6 +35,17 @@ } } }, + { + "type": "STREAM", + "stream": { + "stream_state": { + "updated_at": "2027-07-11T13:07:45-07:00" + }, + "stream_descriptor": { + "name": "order_agreements" + } + } + }, { "type": "STREAM", "stream": { diff --git a/airbyte-integrations/connectors/source-shopify/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-shopify/integration_tests/configured_catalog.json index 34483fa911f99c..cf50e596ab7ea7 100644 --- a/airbyte-integrations/connectors/source-shopify/integration_tests/configured_catalog.json +++ b/airbyte-integrations/connectors/source-shopify/integration_tests/configured_catalog.json @@ -12,6 +12,18 @@ "cursor_field": ["id"], "destination_sync_mode": "append" }, + { + "stream": { + "name": "order_agreements", + "json_schema": {}, + "supported_sync_modes": ["incremental", "full_refresh"], + "source_defined_cursor": true, + "default_cursor_field": ["updated_at"] + }, + "sync_mode": "incremental", + "cursor_field": ["updated_at"], + "destination_sync_mode": "append" + }, { "stream": { "name": "disputes", diff --git a/airbyte-integrations/connectors/source-shopify/integration_tests/expected_records.jsonl b/airbyte-integrations/connectors/source-shopify/integration_tests/expected_records.jsonl index a4d263672b058b..a9c1035a1e83d3 100644 --- a/airbyte-integrations/connectors/source-shopify/integration_tests/expected_records.jsonl +++ b/airbyte-integrations/connectors/source-shopify/integration_tests/expected_records.jsonl @@ -64,6 +64,9 @@ {"stream": "order_refunds", "data": {"id": 845032358077, "admin_graphql_api_id": "gid://shopify/Refund/845032358077", "created_at": "2022-03-07T02:09:04-08:00", "note": null, "order_id": 4147980107965, "processed_at": "2022-03-07T02:09:04-08:00", "restock": true, "total_duties_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "user_id": 74861019325, "order_adjustments": [], "transactions": [], "refund_line_items": [{"id": 352716947645, "line_item_id": 10576771317949, "location_id": 63590301885, "quantity": 1, "restock_type": "return", "subtotal": 27.0, "subtotal_set": {"shop_money": {"amount": 27.0, "currency_code": "USD"}, "presentment_money": {"amount": 27.0, "currency_code": "USD"}}, "total_tax": 0.0, "total_tax_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 10576771317949, "admin_graphql_api_id": "gid://shopify/LineItem/10576771317949", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 285, "name": "Red & Silver Fishing Lure - Plastic", "price": 27.0, "price_set": {"shop_money": {"amount": 27.0, "currency_code": "USD"}, "presentment_money": {"amount": 27.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796218302653, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "Red & Silver Fishing Lure", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090580615357, "variant_inventory_management": "shopify", "variant_title": "Plastic", "vendor": "Harris - Hamill", "tax_lines": [], "duties": [], "discount_allocations": []}}], "duties": "[]", "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953889761} {"stream": "order_refunds", "data": {"id": 829538369725, "admin_graphql_api_id": "gid://shopify/Refund/829538369725", "created_at": "2021-09-21T05:31:59-07:00", "note": "test refund", "order_id": 3935377129661, "processed_at": "2021-09-21T05:31:59-07:00", "restock": true, "total_duties_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "user_id": 74861019325, "order_adjustments": [], "transactions": [{"id": 5189894406333, "admin_graphql_api_id": "gid://shopify/OrderTransaction/5189894406333", "amount": "102.00", "authorization": null, "created_at": "2021-09-21T05:31:58-07:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 3935377129661, "parent_id": 4933790040253, "payment_id": "c21670281707709.2", "processed_at": "2021-09-21T05:31:58-07:00", "receipt": {"paid_amount": "102.00"}, "source_name": "1830279", "status": "success", "test": true, "user_id": 74861019325, "payment_details": {"credit_card_bin": "1", "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 1", "credit_card_company": "Bogus", "buyer_action_info": null, "credit_card_name": "Bogus Gateway", "credit_card_wallet": null, "credit_card_expiration_month": 11, "credit_card_expiration_year": 2023}}], "refund_line_items": [{"id": 332807864509, "line_item_id": 10130216452285, "location_id": 63590301885, "quantity": 1, "restock_type": "cancel", "subtotal": 102.0, "subtotal_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "total_tax": 17.0, "total_tax_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "line_item": {"id": 10130216452285, "admin_graphql_api_id": "gid://shopify/LineItem/10130216452285", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 63, "name": "8 Ounce Soy Candle - Wooden", "price": 102.0, "price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796229509309, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "8 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090604011709, "variant_inventory_management": "shopify", "variant_title": "Wooden", "vendor": "Bosco Inc", "tax_lines": [{"channel_liable": false, "price": 17.0, "price_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}}], "duties": "[]", "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953889762} {"stream": "order_risks", "data": {"id": 4147980107965, "order_id": 4147980107965, "checkout_id": null, "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", "updated_at": "2023-04-24T14:03:06+00:00", "admin_graphql_api_id": "gid://shopify/Order/4147980107965", "assessments": [{"risk_level":"NONE","facts":[{"description":"Card Verification Value (CVV) isn't available","sentiment":"NEUTRAL"},{"description":"Billing address or credit card's address wasn't available","sentiment":"NEUTRAL"},{"description":"Billing address ZIP or postal code isn't available to match with credit card's registered address","sentiment":"NEUTRAL"},{"description":"There were no payment attempts","sentiment":"NEUTRAL"},{"description":"The payment method used isn't available","sentiment":"NEUTRAL"},{"description":"Location of IP address used to place the order isn't available","sentiment":"NEUTRAL"},{"description":"Distance between shipping address and location of IP address isn't available","sentiment":"NEUTRAL"},{"description":"The billing country or the country of the IP used to place the order isn't available","sentiment":"NEUTRAL"},{"description":"Can't determine if a high risk internet connection was used because the IP address isn't available","sentiment":"NEUTRAL"}],"provider":null},{"risk_level":"HIGH","facts":[{"description":"This order came from an anonymous proxy","sentiment":"NEGATIVE"}],"provider":{"features":[],"description":null,"handle":null,"embedded":false,"title":"Airbyte Test","published":false,"developer_name":"app developer","developer_type":"MERCHANT","app_store_app_url":null,"install_url":null,"app_store_developer_url":null,"is_post_purchase_app_in_use":false,"previously_installed":false,"pricing_details_summary":"Free","pricing_details":null,"privacy_policy_url":null,"public_category":"CUSTOM","uninstall_message":"You won't be able to view or access features for this app anymore. Discounts that use this app will also be deleted.","webhook_api_version":"2023-04","shopify_developed":false,"provider_id":5505221,"failed_requirements":[],"feedback":null,"admin_graphql_api_id":"gid://shopify/App/5505221"}}], "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953893694} +{"stream": "order_agreements", "data": {"id": 5010585911485, "created_at": "2023-04-13T12:11:15Z", "updated_at": "2023-04-13T12:11:20Z", "admin_graphql_api_id": "gid://shopify/Order/5010585911485", "agreements": [{"id": 5366918480061, "happened_at": "2023-04-13T12:11:15+00:00", "reason": "ORDER", "sales": [{"quantity": 1, "id": 15631567225021, "action_type": "ORDER", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": 19.0, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 3.17, "currency_code": "USD"}}, "line_item": {"id": 12204216385725, "admin_graphql_api_id": "gid://shopify/LineItem/12204216385725"}, "admin_graphql_api_id": "gid://shopify/Sale/15631567225021"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/5366918480061"}], "shop_url": "airbyte-integration-test"}, "emitted_at": 1718643528972} +{"stream": "order_agreements", "data": {"id": 4554821468349, "created_at": "2022-06-15T12:16:53Z", "updated_at": "2023-04-24T14:00:37Z", "admin_graphql_api_id": "gid://shopify/Order/4554821468349", "agreements": [{"id": 4945859805373, "happened_at": "2022-06-15T12:16:53+00:00", "reason": "ORDER", "sales": [{"quantity": 1, "id": 14453296726205, "action_type": "ORDER", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": 57.23, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": 1.77, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": 1.77, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093"}, "admin_graphql_api_id": "gid://shopify/Sale/14453296726205"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/4945859805373"}, {"id": 4945913807037, "happened_at": "2022-06-15T13:25:43+00:00", "reason": "REFUND", "sales": [{"quantity": -1, "id": 14453444280509, "action_type": "RETURN", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": -57.23, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": -1.77, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": -1.77, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093"}, "admin_graphql_api_id": "gid://shopify/Sale/14453444280509"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/4945913807037"}], "shop_url": "airbyte-integration-test"}, "emitted_at": 1718643528973} +{"stream": "order_agreements", "data": {"id": 4147980107965, "created_at": "2021-09-19T16:08:23Z", "updated_at": "2023-04-24T14:03:06Z", "admin_graphql_api_id": "gid://shopify/Order/4147980107965", "agreements": [{"id": 4518978355389, "happened_at": "2021-09-19T16:08:23+00:00", "reason": "ORDER", "sales": [{"quantity": 1, "id": 13239469113533, "action_type": "ORDER", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": 27.0, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 10576771317949, "admin_graphql_api_id": "gid://shopify/LineItem/10576771317949"}, "admin_graphql_api_id": "gid://shopify/Sale/13239469113533"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/4518978355389"}, {"id": 4816347431101, "happened_at": "2022-03-07T10:09:04+00:00", "reason": "REFUND", "sales": [{"quantity": -1, "id": 14101476671677, "action_type": "RETURN", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": -27.0, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 10576771317949, "admin_graphql_api_id": "gid://shopify/LineItem/10576771317949"}, "admin_graphql_api_id": "gid://shopify/Sale/14101476671677"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/4816347431101"}], "shop_url": "airbyte-integration-test"}, "emitted_at": 1718643528974} {"stream": "orders", "data": {"id": 5010584895677, "admin_graphql_api_id": "gid://shopify/Order/5010584895677", "app_id": 1354745, "browser_ip": "109.162.18.117", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": 27351199088829, "checkout_token": "4064bfadc2457c9e15f2c7b4ee7ddb7d", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "109.162.18.117", "browser_width": null, "session_hash": null, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"}, "closed_at": "2023-04-13T05:09:46-07:00", "company": null, "confirmation_number": "ECI3YZGWP", "confirmed": true, "contact_email": null, "created_at": "2023-04-13T05:09:44-07:00", "currency": "USD", "current_subtotal_price": 102.0, "current_subtotal_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": 0.0, "current_total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": 102.0, "current_total_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "current_total_tax": 17.0, "current_total_tax_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "customer_locale": "en", "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "landing_site": null, "landing_site_ref": null, "location_id": 63590301885, "merchant_of_record_app_id": null, "name": "#1143", "note": null, "note_attributes": [], "number": 143, "order_number": 1143, "order_status_url": "https://airbyte-integration-test.myshopify.com/58033176765/orders/ad85969259bee7d4b380744934e67556/authenticate?key=cdd70808759b04f31c29975ba796fce9", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["manual"], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2023-04-13T05:09:44-07:00", "reference": "b9344c8b118753db132edd503dc91515", "referring_site": null, "source_identifier": "b9344c8b118753db132edd503dc91515", "source_name": "shopify_draft_order", "source_url": null, "subtotal_price": 102.0, "subtotal_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": 17.0, "rate": 0.2, "title": "PDV", "price_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "channel_liable": false}], "taxes_included": true, "test": false, "token": "ad85969259bee7d4b380744934e67556", "total_discounts": 0.0, "total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_line_items_price": 102.0, "total_line_items_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "total_outstanding": 0.0, "total_price": 102.0, "total_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax": 17.0, "total_tax_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "total_tip_received": 0.0, "total_weight": 63, "updated_at": "2023-04-13T05:09:50-07:00", "user_id": 74861019325, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [{"id": 4451164913853, "admin_graphql_api_id": "gid://shopify/Fulfillment/4451164913853", "created_at": "2023-04-13T05:09:45-07:00", "location_id": 63590301885, "name": "#1143.1", "order_id": 5010584895677, "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-04-13T05:09:45-07:00", "line_items": [{"id": 12204214845629, "admin_graphql_api_id": "gid://shopify/LineItem/12204214845629", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 63, "name": "8 Ounce Soy Candle - Wooden", "price": 102.0, "price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796229509309, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "8 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090604011709, "variant_inventory_management": "shopify", "variant_title": "Wooden", "vendor": "Bosco Inc", "tax_lines": [{"channel_liable": false, "price": 17.0, "price_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 12204214845629, "admin_graphql_api_id": "gid://shopify/LineItem/12204214845629", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 63, "name": "8 Ounce Soy Candle - Wooden", "price": 102.0, "price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796229509309, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "8 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090604011709, "variant_inventory_management": "shopify", "variant_title": "Wooden", "vendor": "Bosco Inc", "tax_lines": [{"channel_liable": false, "price": 17.0, "price_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": [], "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953896328} {"stream": "orders", "data": {"id": 5010585911485, "admin_graphql_api_id": "gid://shopify/Order/5010585911485", "app_id": 1354745, "browser_ip": "109.162.18.117", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": 27351203774653, "checkout_token": "117b35b4fd64c8de8d984830b72edfaf", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "109.162.18.117", "browser_width": null, "session_hash": null, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"}, "closed_at": "2023-04-13T05:11:17-07:00", "company": null, "confirmation_number": "CQPWZK5ZU", "confirmed": true, "contact_email": null, "created_at": "2023-04-13T05:11:15-07:00", "currency": "USD", "current_subtotal_price": 19.0, "current_subtotal_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": 0.0, "current_total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": 19.0, "current_total_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "current_total_tax": 3.17, "current_total_tax_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "customer_locale": "en", "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "landing_site": null, "landing_site_ref": null, "location_id": 63590301885, "merchant_of_record_app_id": null, "name": "#1144", "note": null, "note_attributes": [], "number": 144, "order_number": 1144, "order_status_url": "https://airbyte-integration-test.myshopify.com/58033176765/orders/a2d4a8a04fc6ec52a85f1811d269c88f/authenticate?key=a26b27cc1a040df3a1d7c67f6b14df75", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["manual"], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2023-04-13T05:11:15-07:00", "reference": "f75c72a120e34e15a4dbc2d32315cc72", "referring_site": null, "source_identifier": "f75c72a120e34e15a4dbc2d32315cc72", "source_name": "shopify_draft_order", "source_url": null, "subtotal_price": 19.0, "subtotal_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": 3.17, "rate": 0.2, "title": "PDV", "price_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "channel_liable": false}], "taxes_included": true, "test": false, "token": "a2d4a8a04fc6ec52a85f1811d269c88f", "total_discounts": 0.0, "total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_line_items_price": 19.0, "total_line_items_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "total_outstanding": 0.0, "total_price": 19.0, "total_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax": 3.17, "total_tax_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "total_tip_received": 0.0, "total_weight": 112, "updated_at": "2023-04-13T05:11:20-07:00", "user_id": 74861019325, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [{"id": 4451169501373, "admin_graphql_api_id": "gid://shopify/Fulfillment/4451169501373", "created_at": "2023-04-13T05:11:16-07:00", "location_id": 63590301885, "name": "#1144.1", "order_id": 5010585911485, "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-04-13T05:11:16-07:00", "line_items": [{"id": 12204216385725, "admin_graphql_api_id": "gid://shopify/LineItem/12204216385725", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 112, "name": "4 Ounce Soy Candle - Test Variant 2", "price": 19.0, "price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796220989629, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "4 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 41561961824445, "variant_inventory_management": "shopify", "variant_title": "Test Variant 2", "vendor": "Hartmann Group", "tax_lines": [{"channel_liable": false, "price": 3.17, "price_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 12204216385725, "admin_graphql_api_id": "gid://shopify/LineItem/12204216385725", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 112, "name": "4 Ounce Soy Candle - Test Variant 2", "price": 19.0, "price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796220989629, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "4 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 41561961824445, "variant_inventory_management": "shopify", "variant_title": "Test Variant 2", "vendor": "Hartmann Group", "tax_lines": [{"channel_liable": false, "price": 3.17, "price_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": [], "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953896336} {"stream": "orders", "data": {"id": 4554821468349, "admin_graphql_api_id": "gid://shopify/Order/4554821468349", "app_id": 580111, "browser_ip": "176.113.167.23", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": 25048437719229, "checkout_token": "cf5d16a0a0688905bd551c6dec591506", "client_details": {"accept_language": "en-US,en;q=0.9,uk;q=0.8", "browser_height": 754, "browser_ip": "176.113.167.23", "browser_width": 1519, "session_hash": null, "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53"}, "closed_at": "2022-06-15T06:25:43-07:00", "company": null, "confirmation_number": null, "confirmed": true, "contact_email": "integration-test@airbyte.io", "created_at": "2022-06-15T05:16:53-07:00", "currency": "USD", "current_subtotal_price": 0.0, "current_subtotal_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": 0.0, "current_total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": 0.0, "current_total_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_tax": 0.0, "current_total_tax_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "customer_locale": "en", "device_id": null, "discount_codes": [], "email": "integration-test@airbyte.io", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": "fulfilled", "landing_site": "/wallets/checkouts.json", "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1136", "note": "updated_mon_24.04.2023", "note_attributes": [], "number": 136, "order_number": 1136, "order_status_url": "https://airbyte-integration-test.myshopify.com/58033176765/orders/e4f98630ea44a884e33e700203ce2130/authenticate?key=edf087d6ae55a4541bf1375432f6a4b8", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2022-06-15T05:16:53-07:00", "reference": null, "referring_site": "https://airbyte-integration-test.myshopify.com/products/all-black-sneaker-right-foot", "source_identifier": null, "source_name": "web", "source_url": null, "subtotal_price": 57.23, "subtotal_price_set": {"shop_money": {"amount": 57.23, "currency_code": "USD"}, "presentment_money": {"amount": 57.23, "currency_code": "USD"}}, "tags": "Refund", "tax_exempt": false, "tax_lines": [], "taxes_included": true, "test": true, "token": "e4f98630ea44a884e33e700203ce2130", "total_discounts": 1.77, "total_discounts_set": {"shop_money": {"amount": 1.77, "currency_code": "USD"}, "presentment_money": {"amount": 1.77, "currency_code": "USD"}}, "total_line_items_price": 59.0, "total_line_items_price_set": {"shop_money": {"amount": 59.0, "currency_code": "USD"}, "presentment_money": {"amount": 59.0, "currency_code": "USD"}}, "total_outstanding": 0.0, "total_price": 57.23, "total_price_set": {"shop_money": {"amount": 57.23, "currency_code": "USD"}, "presentment_money": {"amount": 57.23, "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax": 0.0, "total_tax_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tip_received": 0.0, "total_weight": 0, "updated_at": "2023-04-24T07:00:37-07:00", "user_id": null, "billing_address": {"first_name": "Iryna", "address1": "2261 Market Street", "phone": null, "city": "San Francisco", "zip": "94114", "province": "California", "country": "United States", "last_name": "Grankova", "address2": "4381", "company": null, "latitude": 37.7647751, "longitude": -122.4320369, "name": "Iryna Grankova", "country_code": "US", "province_code": "CA"}, "customer": {"id": 5362027233469, "email": "integration-test@airbyte.io", "created_at": "2021-07-08T05:41:47-07:00", "updated_at": "2022-06-22T03:50:13-07:00", "first_name": "Airbyte", "last_name": "Team", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": null, "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "tags": "", "currency": "USD", "accepts_marketing": false, "accepts_marketing_updated_at": null, "marketing_opt_in_level": "single_opt_in", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/5362027233469", "default_address": {"id": 7492260823229, "customer_id": 5362027233469, "first_name": "Airbyte", "last_name": "Team", "company": null, "address1": "2261 Market Street", "address2": "4381", "city": "San Francisco", "province": "California", "country": "United States", "zip": "94114", "phone": null, "name": "Airbyte Team", "province_code": "CA", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "automatic", "value": "3.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "eeeee"}], "fulfillments": [{"id": 4075788501181, "admin_graphql_api_id": "gid://shopify/Fulfillment/4075788501181", "created_at": "2022-06-15T05:16:55-07:00", "location_id": 63590301885, "name": "#1136.1", "order_id": 4554821468349, "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-06-15T05:16:55-07:00", "line_items": [{"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 0, "name": "All Black Sneaker Right Foot - ivory", "price": 59.0, "price_set": {"shop_money": {"amount": 59.0, "currency_code": "USD"}, "presentment_money": {"amount": 59.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796226560189, "properties": [], "quantity": 1, "requires_shipping": false, "sku": "", "taxable": true, "title": "All Black Sneaker Right Foot", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090597884093, "variant_inventory_management": "shopify", "variant_title": "ivory", "vendor": "Becker - Moore", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "1.77", "amount_set": {"shop_money": {"amount": "1.77", "currency_code": "USD"}, "presentment_money": {"amount": "1.77", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 0, "name": "All Black Sneaker Right Foot - ivory", "price": 59.0, "price_set": {"shop_money": {"amount": 59.0, "currency_code": "USD"}, "presentment_money": {"amount": 59.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796226560189, "properties": [], "quantity": 1, "requires_shipping": false, "sku": "", "taxable": true, "title": "All Black Sneaker Right Foot", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090597884093, "variant_inventory_management": "shopify", "variant_title": "ivory", "vendor": "Becker - Moore", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "1.77", "amount_set": {"shop_money": {"amount": "1.77", "currency_code": "USD"}, "presentment_money": {"amount": "1.77", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 852809646269, "admin_graphql_api_id": "gid://shopify/Refund/852809646269", "created_at": "2022-06-15T06:25:43-07:00", "note": null, "order_id": 4554821468349, "processed_at": "2022-06-15T06:25:43-07:00", "restock": true, "total_duties_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "user_id": 74861019325, "order_adjustments": [], "transactions": [{"id": 5721170968765, "admin_graphql_api_id": "gid://shopify/OrderTransaction/5721170968765", "amount": "57.23", "authorization": null, "created_at": "2022-06-15T06:25:42-07:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 4554821468349, "parent_id": 5721110872253, "payment_id": "c25048437719229.2", "processed_at": "2022-06-15T06:25:42-07:00", "receipt": {"paid_amount": "57.23"}, "source_name": "1830279", "status": "success", "test": true, "user_id": null, "payment_details": {"credit_card_bin": "1", "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 1", "credit_card_company": "Bogus", "buyer_action_info": null, "credit_card_name": "Bogus Gateway", "credit_card_wallet": null, "credit_card_expiration_month": 2, "credit_card_expiration_year": 2025}}], "refund_line_items": [{"id": 363131404477, "line_item_id": 11406125564093, "location_id": 63590301885, "quantity": 1, "restock_type": "return", "subtotal": 57.23, "subtotal_set": {"shop_money": {"amount": "57.23", "currency_code": "USD"}, "presentment_money": {"amount": "57.23", "currency_code": "USD"}}, "total_tax": 0.0, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "line_item": {"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 0, "name": "All Black Sneaker Right Foot - ivory", "price": "59.00", "price_set": {"shop_money": {"amount": "59.00", "currency_code": "USD"}, "presentment_money": {"amount": "59.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 6796226560189, "properties": [], "quantity": 1, "requires_shipping": false, "sku": "", "taxable": true, "title": "All Black Sneaker Right Foot", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 40090597884093, "variant_inventory_management": "shopify", "variant_title": "ivory", "vendor": "Becker - Moore", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "1.77", "amount_set": {"shop_money": {"amount": "1.77", "currency_code": "USD"}, "presentment_money": {"amount": "1.77", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": null, "shipping_lines": [], "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953896344} diff --git a/airbyte-integrations/connectors/source-shopify/integration_tests/expected_records_transactions_with_user_id.jsonl b/airbyte-integrations/connectors/source-shopify/integration_tests/expected_records_transactions_with_user_id.jsonl index bbd86757ebbfb3..7bcd21fb5694a1 100644 --- a/airbyte-integrations/connectors/source-shopify/integration_tests/expected_records_transactions_with_user_id.jsonl +++ b/airbyte-integrations/connectors/source-shopify/integration_tests/expected_records_transactions_with_user_id.jsonl @@ -64,6 +64,9 @@ {"stream": "order_refunds", "data": {"id": 845032358077, "admin_graphql_api_id": "gid://shopify/Refund/845032358077", "created_at": "2022-03-07T02:09:04-08:00", "note": null, "order_id": 4147980107965, "processed_at": "2022-03-07T02:09:04-08:00", "restock": true, "total_duties_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "user_id": 74861019325, "order_adjustments": [], "transactions": [], "refund_line_items": [{"id": 352716947645, "line_item_id": 10576771317949, "location_id": 63590301885, "quantity": 1, "restock_type": "return", "subtotal": 27.0, "subtotal_set": {"shop_money": {"amount": 27.0, "currency_code": "USD"}, "presentment_money": {"amount": 27.0, "currency_code": "USD"}}, "total_tax": 0.0, "total_tax_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 10576771317949, "admin_graphql_api_id": "gid://shopify/LineItem/10576771317949", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 285, "name": "Red & Silver Fishing Lure - Plastic", "price": 27.0, "price_set": {"shop_money": {"amount": 27.0, "currency_code": "USD"}, "presentment_money": {"amount": 27.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796218302653, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "Red & Silver Fishing Lure", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090580615357, "variant_inventory_management": "shopify", "variant_title": "Plastic", "vendor": "Harris - Hamill", "tax_lines": [], "duties": [], "discount_allocations": []}}], "duties": "[]", "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953661479} {"stream": "order_refunds", "data": {"id": 829538369725, "admin_graphql_api_id": "gid://shopify/Refund/829538369725", "created_at": "2021-09-21T05:31:59-07:00", "note": "test refund", "order_id": 3935377129661, "processed_at": "2021-09-21T05:31:59-07:00", "restock": true, "total_duties_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "user_id": 74861019325, "order_adjustments": [], "transactions": [{"id": 5189894406333, "admin_graphql_api_id": "gid://shopify/OrderTransaction/5189894406333", "amount": "102.00", "authorization": null, "created_at": "2021-09-21T05:31:58-07:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 3935377129661, "parent_id": 4933790040253, "payment_id": "c21670281707709.2", "processed_at": "2021-09-21T05:31:58-07:00", "receipt": {"paid_amount": "102.00"}, "source_name": "1830279", "status": "success", "test": true, "user_id": 74861019325, "payment_details": {"credit_card_bin": "1", "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 1", "credit_card_company": "Bogus", "buyer_action_info": null, "credit_card_name": "Bogus Gateway", "credit_card_wallet": null, "credit_card_expiration_month": 11, "credit_card_expiration_year": 2023}}], "refund_line_items": [{"id": 332807864509, "line_item_id": 10130216452285, "location_id": 63590301885, "quantity": 1, "restock_type": "cancel", "subtotal": 102.0, "subtotal_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "total_tax": 17.0, "total_tax_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "line_item": {"id": 10130216452285, "admin_graphql_api_id": "gid://shopify/LineItem/10130216452285", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": null, "gift_card": false, "grams": 63, "name": "8 Ounce Soy Candle - Wooden", "price": 102.0, "price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796229509309, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "8 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090604011709, "variant_inventory_management": "shopify", "variant_title": "Wooden", "vendor": "Bosco Inc", "tax_lines": [{"channel_liable": false, "price": 17.0, "price_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}}], "duties": "[]", "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953661480} {"stream": "order_risks", "data": {"id": 4147980107965, "order_id": 4147980107965, "checkout_id": null, "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", "updated_at": "2023-04-24T14:03:06+00:00", "admin_graphql_api_id": "gid://shopify/Order/4147980107965", "assessments": [{"risk_level":"NONE","facts":[{"description":"Card Verification Value (CVV) isn't available","sentiment":"NEUTRAL"},{"description":"Billing address or credit card's address wasn't available","sentiment":"NEUTRAL"},{"description":"Billing address ZIP or postal code isn't available to match with credit card's registered address","sentiment":"NEUTRAL"},{"description":"There were no payment attempts","sentiment":"NEUTRAL"},{"description":"The payment method used isn't available","sentiment":"NEUTRAL"},{"description":"Location of IP address used to place the order isn't available","sentiment":"NEUTRAL"},{"description":"Distance between shipping address and location of IP address isn't available","sentiment":"NEUTRAL"},{"description":"The billing country or the country of the IP used to place the order isn't available","sentiment":"NEUTRAL"},{"description":"Can't determine if a high risk internet connection was used because the IP address isn't available","sentiment":"NEUTRAL"}],"provider":null},{"risk_level":"HIGH","facts":[{"description":"This order came from an anonymous proxy","sentiment":"NEGATIVE"}],"provider":{"features":[],"description":null,"handle":null,"embedded":false,"title":"Airbyte Test","published":false,"developer_name":"app developer","developer_type":"MERCHANT","app_store_app_url":null,"install_url":null,"app_store_developer_url":null,"is_post_purchase_app_in_use":false,"previously_installed":false,"pricing_details_summary":"Free","pricing_details":null,"privacy_policy_url":null,"public_category":"CUSTOM","uninstall_message":"You won't be able to view or access features for this app anymore. Discounts that use this app will also be deleted.","webhook_api_version":"2023-04","shopify_developed":false,"provider_id":5505221,"failed_requirements":[],"feedback":null,"admin_graphql_api_id":"gid://shopify/App/5505221"}}], "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953893694} +{"stream": "order_agreements", "data": {"id": 5010585911485, "created_at": "2023-04-13T12:11:15Z", "updated_at": "2023-04-13T12:11:20Z", "admin_graphql_api_id": "gid://shopify/Order/5010585911485", "agreements": [{"id": 5366918480061, "happened_at": "2023-04-13T12:11:15+00:00", "reason": "ORDER", "sales": [{"quantity": 1, "id": 15631567225021, "action_type": "ORDER", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": 19.0, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 3.17, "currency_code": "USD"}}, "line_item": {"id": 12204216385725, "admin_graphql_api_id": "gid://shopify/LineItem/12204216385725"}, "admin_graphql_api_id": "gid://shopify/Sale/15631567225021"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/5366918480061"}], "shop_url": "airbyte-integration-test"}, "emitted_at": 1718643528972} +{"stream": "order_agreements", "data": {"id": 4554821468349, "created_at": "2022-06-15T12:16:53Z", "updated_at": "2023-04-24T14:00:37Z", "admin_graphql_api_id": "gid://shopify/Order/4554821468349", "agreements": [{"id": 4945859805373, "happened_at": "2022-06-15T12:16:53+00:00", "reason": "ORDER", "sales": [{"quantity": 1, "id": 14453296726205, "action_type": "ORDER", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": 57.23, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": 1.77, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": 1.77, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093"}, "admin_graphql_api_id": "gid://shopify/Sale/14453296726205"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/4945859805373"}, {"id": 4945913807037, "happened_at": "2022-06-15T13:25:43+00:00", "reason": "REFUND", "sales": [{"quantity": -1, "id": 14453444280509, "action_type": "RETURN", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": -57.23, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": -1.77, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": -1.77, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093"}, "admin_graphql_api_id": "gid://shopify/Sale/14453444280509"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/4945913807037"}], "shop_url": "airbyte-integration-test"}, "emitted_at": 1718643528973} +{"stream": "order_agreements", "data": {"id": 4147980107965, "created_at": "2021-09-19T16:08:23Z", "updated_at": "2023-04-24T14:03:06Z", "admin_graphql_api_id": "gid://shopify/Order/4147980107965", "agreements": [{"id": 4518978355389, "happened_at": "2021-09-19T16:08:23+00:00", "reason": "ORDER", "sales": [{"quantity": 1, "id": 13239469113533, "action_type": "ORDER", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": 27.0, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 10576771317949, "admin_graphql_api_id": "gid://shopify/LineItem/10576771317949"}, "admin_graphql_api_id": "gid://shopify/Sale/13239469113533"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/4518978355389"}, {"id": 4816347431101, "happened_at": "2022-03-07T10:09:04+00:00", "reason": "REFUND", "sales": [{"quantity": -1, "id": 14101476671677, "action_type": "RETURN", "line_type": "PRODUCT", "total_amount": {"shop_money": {"amount": -27.0, "currency_code": "USD"}}, "total_discount_amount_after_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_discount_amount_before_taxes": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax_amount": {"shop_money": {"amount": 0.0, "currency_code": "USD"}}, "line_item": {"id": 10576771317949, "admin_graphql_api_id": "gid://shopify/LineItem/10576771317949"}, "admin_graphql_api_id": "gid://shopify/Sale/14101476671677"}], "admin_graphql_api_id": "gid://shopify/SalesAgreement/4816347431101"}], "shop_url": "airbyte-integration-test"}, "emitted_at": 1718643528974} {"stream": "orders", "data": {"id": 5010584895677, "admin_graphql_api_id": "gid://shopify/Order/5010584895677", "app_id": 1354745, "browser_ip": "109.162.18.117", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": 27351199088829, "checkout_token": "4064bfadc2457c9e15f2c7b4ee7ddb7d", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "109.162.18.117", "browser_width": null, "session_hash": null, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"}, "closed_at": "2023-04-13T05:09:46-07:00", "company": null, "confirmation_number": "ECI3YZGWP", "confirmed": true, "contact_email": null, "created_at": "2023-04-13T05:09:44-07:00", "currency": "USD", "current_subtotal_price": 102.0, "current_subtotal_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": 0.0, "current_total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": 102.0, "current_total_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "current_total_tax": 17.0, "current_total_tax_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "customer_locale": "en", "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "landing_site": null, "landing_site_ref": null, "location_id": 63590301885, "merchant_of_record_app_id": null, "name": "#1143", "note": null, "note_attributes": [], "number": 143, "order_number": 1143, "order_status_url": "https://airbyte-integration-test.myshopify.com/58033176765/orders/ad85969259bee7d4b380744934e67556/authenticate?key=cdd70808759b04f31c29975ba796fce9", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["manual"], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2023-04-13T05:09:44-07:00", "reference": "b9344c8b118753db132edd503dc91515", "referring_site": null, "source_identifier": "b9344c8b118753db132edd503dc91515", "source_name": "shopify_draft_order", "source_url": null, "subtotal_price": 102.0, "subtotal_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": 17.0, "rate": 0.2, "title": "PDV", "price_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "channel_liable": false}], "taxes_included": true, "test": false, "token": "ad85969259bee7d4b380744934e67556", "total_discounts": 0.0, "total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_line_items_price": 102.0, "total_line_items_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "total_outstanding": 0.0, "total_price": 102.0, "total_price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax": 17.0, "total_tax_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "total_tip_received": 0.0, "total_weight": 63, "updated_at": "2023-04-13T05:09:50-07:00", "user_id": 74861019325, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [{"id": 4451164913853, "admin_graphql_api_id": "gid://shopify/Fulfillment/4451164913853", "created_at": "2023-04-13T05:09:45-07:00", "location_id": 63590301885, "name": "#1143.1", "order_id": 5010584895677, "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-04-13T05:09:45-07:00", "line_items": [{"id": 12204214845629, "admin_graphql_api_id": "gid://shopify/LineItem/12204214845629", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 63, "name": "8 Ounce Soy Candle - Wooden", "price": 102.0, "price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796229509309, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "8 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090604011709, "variant_inventory_management": "shopify", "variant_title": "Wooden", "vendor": "Bosco Inc", "tax_lines": [{"channel_liable": false, "price": 17.0, "price_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 12204214845629, "admin_graphql_api_id": "gid://shopify/LineItem/12204214845629", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 63, "name": "8 Ounce Soy Candle - Wooden", "price": 102.0, "price_set": {"shop_money": {"amount": 102.0, "currency_code": "USD"}, "presentment_money": {"amount": 102.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796229509309, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "8 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090604011709, "variant_inventory_management": "shopify", "variant_title": "Wooden", "vendor": "Bosco Inc", "tax_lines": [{"channel_liable": false, "price": 17.0, "price_set": {"shop_money": {"amount": 17.0, "currency_code": "USD"}, "presentment_money": {"amount": 17.0, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": [], "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953668490} {"stream": "orders", "data": {"id": 5010585911485, "admin_graphql_api_id": "gid://shopify/Order/5010585911485", "app_id": 1354745, "browser_ip": "109.162.18.117", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": 27351203774653, "checkout_token": "117b35b4fd64c8de8d984830b72edfaf", "client_details": {"accept_language": null, "browser_height": null, "browser_ip": "109.162.18.117", "browser_width": null, "session_hash": null, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"}, "closed_at": "2023-04-13T05:11:17-07:00", "company": null, "confirmation_number": "CQPWZK5ZU", "confirmed": true, "contact_email": null, "created_at": "2023-04-13T05:11:15-07:00", "currency": "USD", "current_subtotal_price": 19.0, "current_subtotal_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": 0.0, "current_total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": 19.0, "current_total_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "current_total_tax": 3.17, "current_total_tax_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "customer_locale": "en", "device_id": null, "discount_codes": [], "email": "", "estimated_taxes": false, "financial_status": "paid", "fulfillment_status": "fulfilled", "landing_site": null, "landing_site_ref": null, "location_id": 63590301885, "merchant_of_record_app_id": null, "name": "#1144", "note": null, "note_attributes": [], "number": 144, "order_number": 1144, "order_status_url": "https://airbyte-integration-test.myshopify.com/58033176765/orders/a2d4a8a04fc6ec52a85f1811d269c88f/authenticate?key=a26b27cc1a040df3a1d7c67f6b14df75", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["manual"], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2023-04-13T05:11:15-07:00", "reference": "f75c72a120e34e15a4dbc2d32315cc72", "referring_site": null, "source_identifier": "f75c72a120e34e15a4dbc2d32315cc72", "source_name": "shopify_draft_order", "source_url": null, "subtotal_price": 19.0, "subtotal_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "tags": "", "tax_exempt": false, "tax_lines": [{"price": 3.17, "rate": 0.2, "title": "PDV", "price_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "channel_liable": false}], "taxes_included": true, "test": false, "token": "a2d4a8a04fc6ec52a85f1811d269c88f", "total_discounts": 0.0, "total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_line_items_price": 19.0, "total_line_items_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "total_outstanding": 0.0, "total_price": 19.0, "total_price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax": 3.17, "total_tax_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "total_tip_received": 0.0, "total_weight": 112, "updated_at": "2023-04-13T05:11:20-07:00", "user_id": 74861019325, "billing_address": null, "customer": null, "discount_applications": [], "fulfillments": [{"id": 4451169501373, "admin_graphql_api_id": "gid://shopify/Fulfillment/4451169501373", "created_at": "2023-04-13T05:11:16-07:00", "location_id": 63590301885, "name": "#1144.1", "order_id": 5010585911485, "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-04-13T05:11:16-07:00", "line_items": [{"id": 12204216385725, "admin_graphql_api_id": "gid://shopify/LineItem/12204216385725", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 112, "name": "4 Ounce Soy Candle - Test Variant 2", "price": 19.0, "price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796220989629, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "4 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 41561961824445, "variant_inventory_management": "shopify", "variant_title": "Test Variant 2", "vendor": "Hartmann Group", "tax_lines": [{"channel_liable": false, "price": 3.17, "price_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}]}], "line_items": [{"id": 12204216385725, "admin_graphql_api_id": "gid://shopify/LineItem/12204216385725", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 112, "name": "4 Ounce Soy Candle - Test Variant 2", "price": 19.0, "price_set": {"shop_money": {"amount": 19.0, "currency_code": "USD"}, "presentment_money": {"amount": 19.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796220989629, "properties": [], "quantity": 1, "requires_shipping": true, "sku": "", "taxable": true, "title": "4 Ounce Soy Candle", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 41561961824445, "variant_inventory_management": "shopify", "variant_title": "Test Variant 2", "vendor": "Hartmann Group", "tax_lines": [{"channel_liable": false, "price": 3.17, "price_set": {"shop_money": {"amount": 3.17, "currency_code": "USD"}, "presentment_money": {"amount": 3.17, "currency_code": "USD"}}, "rate": 0.2, "title": "PDV"}], "duties": [], "discount_allocations": []}], "payment_terms": null, "refunds": [], "shipping_address": null, "shipping_lines": [], "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953668500} {"stream": "orders", "data": {"id": 4554821468349, "admin_graphql_api_id": "gid://shopify/Order/4554821468349", "app_id": 580111, "browser_ip": "176.113.167.23", "buyer_accepts_marketing": false, "cancel_reason": null, "cancelled_at": null, "cart_token": null, "checkout_id": 25048437719229, "checkout_token": "cf5d16a0a0688905bd551c6dec591506", "client_details": {"accept_language": "en-US,en;q=0.9,uk;q=0.8", "browser_height": 754, "browser_ip": "176.113.167.23", "browser_width": 1519, "session_hash": null, "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53"}, "closed_at": "2022-06-15T06:25:43-07:00", "company": null, "confirmation_number": null, "confirmed": true, "contact_email": "integration-test@airbyte.io", "created_at": "2022-06-15T05:16:53-07:00", "currency": "USD", "current_subtotal_price": 0.0, "current_subtotal_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_additional_fees_set": null, "current_total_discounts": 0.0, "current_total_discounts_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_duties_set": null, "current_total_price": 0.0, "current_total_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "current_total_tax": 0.0, "current_total_tax_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "customer_locale": "en", "device_id": null, "discount_codes": [], "email": "integration-test@airbyte.io", "estimated_taxes": false, "financial_status": "refunded", "fulfillment_status": "fulfilled", "landing_site": "/wallets/checkouts.json", "landing_site_ref": null, "location_id": null, "merchant_of_record_app_id": null, "name": "#1136", "note": "updated_mon_24.04.2023", "note_attributes": [], "number": 136, "order_number": 1136, "order_status_url": "https://airbyte-integration-test.myshopify.com/58033176765/orders/e4f98630ea44a884e33e700203ce2130/authenticate?key=edf087d6ae55a4541bf1375432f6a4b8", "original_total_additional_fees_set": null, "original_total_duties_set": null, "payment_gateway_names": ["bogus"], "phone": null, "po_number": null, "presentment_currency": "USD", "processed_at": "2022-06-15T05:16:53-07:00", "reference": null, "referring_site": "https://airbyte-integration-test.myshopify.com/products/all-black-sneaker-right-foot", "source_identifier": null, "source_name": "web", "source_url": null, "subtotal_price": 57.23, "subtotal_price_set": {"shop_money": {"amount": 57.23, "currency_code": "USD"}, "presentment_money": {"amount": 57.23, "currency_code": "USD"}}, "tags": "Refund", "tax_exempt": false, "tax_lines": [], "taxes_included": true, "test": true, "token": "e4f98630ea44a884e33e700203ce2130", "total_discounts": 1.77, "total_discounts_set": {"shop_money": {"amount": 1.77, "currency_code": "USD"}, "presentment_money": {"amount": 1.77, "currency_code": "USD"}}, "total_line_items_price": 59.0, "total_line_items_price_set": {"shop_money": {"amount": 59.0, "currency_code": "USD"}, "presentment_money": {"amount": 59.0, "currency_code": "USD"}}, "total_outstanding": 0.0, "total_price": 57.23, "total_price_set": {"shop_money": {"amount": 57.23, "currency_code": "USD"}, "presentment_money": {"amount": 57.23, "currency_code": "USD"}}, "total_shipping_price_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tax": 0.0, "total_tax_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "total_tip_received": 0.0, "total_weight": 0, "updated_at": "2023-04-24T07:00:37-07:00", "user_id": null, "billing_address": {"first_name": "Iryna", "address1": "2261 Market Street", "phone": null, "city": "San Francisco", "zip": "94114", "province": "California", "country": "United States", "last_name": "Grankova", "address2": "4381", "company": null, "latitude": 37.7647751, "longitude": -122.4320369, "name": "Iryna Grankova", "country_code": "US", "province_code": "CA"}, "customer": {"id": 5362027233469, "email": "integration-test@airbyte.io", "created_at": "2021-07-08T05:41:47-07:00", "updated_at": "2022-06-22T03:50:13-07:00", "first_name": "Airbyte", "last_name": "Team", "state": "disabled", "note": null, "verified_email": true, "multipass_identifier": null, "tax_exempt": false, "phone": null, "email_marketing_consent": {"state": "not_subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": null}, "sms_marketing_consent": null, "tags": "", "currency": "USD", "accepts_marketing": false, "accepts_marketing_updated_at": null, "marketing_opt_in_level": "single_opt_in", "tax_exemptions": [], "admin_graphql_api_id": "gid://shopify/Customer/5362027233469", "default_address": {"id": 7492260823229, "customer_id": 5362027233469, "first_name": "Airbyte", "last_name": "Team", "company": null, "address1": "2261 Market Street", "address2": "4381", "city": "San Francisco", "province": "California", "country": "United States", "zip": "94114", "phone": null, "name": "Airbyte Team", "province_code": "CA", "country_code": "US", "country_name": "United States", "default": true}}, "discount_applications": [{"target_type": "line_item", "type": "automatic", "value": "3.0", "value_type": "percentage", "allocation_method": "across", "target_selection": "all", "title": "eeeee"}], "fulfillments": [{"id": 4075788501181, "admin_graphql_api_id": "gid://shopify/Fulfillment/4075788501181", "created_at": "2022-06-15T05:16:55-07:00", "location_id": 63590301885, "name": "#1136.1", "order_id": 4554821468349, "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-06-15T05:16:55-07:00", "line_items": [{"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 0, "name": "All Black Sneaker Right Foot - ivory", "price": 59.0, "price_set": {"shop_money": {"amount": 59.0, "currency_code": "USD"}, "presentment_money": {"amount": 59.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796226560189, "properties": [], "quantity": 1, "requires_shipping": false, "sku": "", "taxable": true, "title": "All Black Sneaker Right Foot", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090597884093, "variant_inventory_management": "shopify", "variant_title": "ivory", "vendor": "Becker - Moore", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "1.77", "amount_set": {"shop_money": {"amount": "1.77", "currency_code": "USD"}, "presentment_money": {"amount": "1.77", "currency_code": "USD"}}, "discount_application_index": 0}]}]}], "line_items": [{"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 0, "name": "All Black Sneaker Right Foot - ivory", "price": 59.0, "price_set": {"shop_money": {"amount": 59.0, "currency_code": "USD"}, "presentment_money": {"amount": 59.0, "currency_code": "USD"}}, "product_exists": true, "product_id": 6796226560189, "properties": [], "quantity": 1, "requires_shipping": false, "sku": "", "taxable": true, "title": "All Black Sneaker Right Foot", "total_discount": 0.0, "total_discount_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "variant_id": 40090597884093, "variant_inventory_management": "shopify", "variant_title": "ivory", "vendor": "Becker - Moore", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "1.77", "amount_set": {"shop_money": {"amount": "1.77", "currency_code": "USD"}, "presentment_money": {"amount": "1.77", "currency_code": "USD"}}, "discount_application_index": 0}]}], "payment_terms": null, "refunds": [{"id": 852809646269, "admin_graphql_api_id": "gid://shopify/Refund/852809646269", "created_at": "2022-06-15T06:25:43-07:00", "note": null, "order_id": 4554821468349, "processed_at": "2022-06-15T06:25:43-07:00", "restock": true, "total_duties_set": {"shop_money": {"amount": 0.0, "currency_code": "USD"}, "presentment_money": {"amount": 0.0, "currency_code": "USD"}}, "user_id": 74861019325, "order_adjustments": [], "transactions": [{"id": 5721170968765, "admin_graphql_api_id": "gid://shopify/OrderTransaction/5721170968765", "amount": "57.23", "authorization": null, "created_at": "2022-06-15T06:25:42-07:00", "currency": "USD", "device_id": null, "error_code": null, "gateway": "bogus", "kind": "refund", "location_id": null, "message": "Bogus Gateway: Forced success", "order_id": 4554821468349, "parent_id": 5721110872253, "payment_id": "c25048437719229.2", "processed_at": "2022-06-15T06:25:42-07:00", "receipt": {"paid_amount": "57.23"}, "source_name": "1830279", "status": "success", "test": true, "user_id": null, "payment_details": {"credit_card_bin": "1", "avs_result_code": null, "cvv_result_code": null, "credit_card_number": "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 1", "credit_card_company": "Bogus", "buyer_action_info": null, "credit_card_name": "Bogus Gateway", "credit_card_wallet": null, "credit_card_expiration_month": 2, "credit_card_expiration_year": 2025}}], "refund_line_items": [{"id": 363131404477, "line_item_id": 11406125564093, "location_id": 63590301885, "quantity": 1, "restock_type": "return", "subtotal": 57.23, "subtotal_set": {"shop_money": {"amount": "57.23", "currency_code": "USD"}, "presentment_money": {"amount": "57.23", "currency_code": "USD"}}, "total_tax": 0.0, "total_tax_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "line_item": {"id": 11406125564093, "admin_graphql_api_id": "gid://shopify/LineItem/11406125564093", "fulfillable_quantity": 0, "fulfillment_service": "manual", "fulfillment_status": "fulfilled", "gift_card": false, "grams": 0, "name": "All Black Sneaker Right Foot - ivory", "price": "59.00", "price_set": {"shop_money": {"amount": "59.00", "currency_code": "USD"}, "presentment_money": {"amount": "59.00", "currency_code": "USD"}}, "product_exists": true, "product_id": 6796226560189, "properties": [], "quantity": 1, "requires_shipping": false, "sku": "", "taxable": true, "title": "All Black Sneaker Right Foot", "total_discount": "0.00", "total_discount_set": {"shop_money": {"amount": "0.00", "currency_code": "USD"}, "presentment_money": {"amount": "0.00", "currency_code": "USD"}}, "variant_id": 40090597884093, "variant_inventory_management": "shopify", "variant_title": "ivory", "vendor": "Becker - Moore", "tax_lines": [], "duties": [], "discount_allocations": [{"amount": "1.77", "amount_set": {"shop_money": {"amount": "1.77", "currency_code": "USD"}, "presentment_money": {"amount": "1.77", "currency_code": "USD"}}, "discount_application_index": 0}]}}], "duties": []}], "shipping_address": null, "shipping_lines": [], "shop_url": "airbyte-integration-test"}, "emitted_at": 1708953668502} diff --git a/airbyte-integrations/connectors/source-shopify/integration_tests/state.json b/airbyte-integrations/connectors/source-shopify/integration_tests/state.json index c2288065be9d9e..a1d5078d4cdc7d 100644 --- a/airbyte-integrations/connectors/source-shopify/integration_tests/state.json +++ b/airbyte-integrations/connectors/source-shopify/integration_tests/state.json @@ -11,6 +11,9 @@ }, "updated_at": "2023-04-24T11:00:10-07:00" }, + "order_agreements": { + "updated_at": "2023-04-24T11:00:10-07:00" + }, "draft_orders": { "updated_at": "2023-07-11T12:57:55-07:00" }, diff --git a/airbyte-integrations/connectors/source-shopify/metadata.yaml b/airbyte-integrations/connectors/source-shopify/metadata.yaml index 21a3de8bb869f8..1338bebeb893e3 100644 --- a/airbyte-integrations/connectors/source-shopify/metadata.yaml +++ b/airbyte-integrations/connectors/source-shopify/metadata.yaml @@ -11,7 +11,7 @@ data: connectorSubtype: api connectorType: source definitionId: 9da77001-af33-4bcd-be46-6252bf9342b9 - dockerImageTag: 2.3.0 + dockerImageTag: 2.4.0 dockerRepository: airbyte/source-shopify documentationUrl: https://docs.airbyte.com/integrations/sources/shopify githubIssueLabel: source-shopify @@ -77,6 +77,8 @@ data: suggestedStreams: streams: - customers + - customer_journey_summary + - order_agreements - order_refunds - transactions_graphql - product_variants diff --git a/airbyte-integrations/connectors/source-shopify/pyproject.toml b/airbyte-integrations/connectors/source-shopify/pyproject.toml index 1c9d364b60c27f..b8d2fe7b39665f 100644 --- a/airbyte-integrations/connectors/source-shopify/pyproject.toml +++ b/airbyte-integrations/connectors/source-shopify/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] build-backend = "poetry.core.masonry.api" [tool.poetry] -version = "2.3.0" +version = "2.4.0" name = "source-shopify" description = "Source CDK implementation for Shopify." authors = [ "Airbyte ",] diff --git a/airbyte-integrations/connectors/source-shopify/source_shopify/schemas/order_agreements.json b/airbyte-integrations/connectors/source-shopify/source_shopify/schemas/order_agreements.json new file mode 100644 index 00000000000000..0c9ae7f03d3fd8 --- /dev/null +++ b/airbyte-integrations/connectors/source-shopify/source_shopify/schemas/order_agreements.json @@ -0,0 +1,176 @@ +{ + "type": "object", + "additionalProperties": true, + "properties": { + "id": { + "description": "A globally-unique Order ID", + "type": ["null", "integer"] + }, + "created_at": { + "description": "The date and time when the order was created", + "type": ["null", "string"], + "format": "date-time" + }, + "updated_at": { + "description": "The date and time when the order was last updated", + "type": ["null", "string"], + "format": "date-time" + }, + "admin_graphql_api_id": { + "description": "The original order id reference for the shopify api", + "type": ["null", "string"] + }, + "shop_url": { + "description": "URL of the shop where the order was placed.", + "type": ["null", "string"] + }, + "agreements": { + "description": "A list of sales agreements associated with the order.", + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "id": { + "description": "The unique ID for the agreement.", + "type": ["null", "integer"] + }, + "happened_at": { + "description": "The date and time at which the agreement occured.", + "type": ["null", "string"], + "format": "date-time" + }, + "reason": { + "description": "The reason the agremeent was created.", + "type": ["null", "string"] + }, + "sales": { + "type": ["null", "array"], + "items": { + "type": ["null", "object"], + "properties": { + "quantity": { + "description": "The number of units either ordered or intended to be returned.", + "type": ["null", "integer"] + }, + "id": { + "description": "The unique ID for the sale.", + "type": ["null", "integer"] + }, + "action_type": { + "description": "The type of order action that the sale represents.", + "type": ["null", "string"] + }, + "line_type": { + "description": "The line type assocated with the sale.", + "type": ["null", "string"] + }, + "total_amount": { + "description": "The total sale amount after taxes and discounts.", + "type": ["null", "object"], + "properties": { + "shop_money": { + "description": "Amount in shop currency.", + "type": ["null", "object"], + "properties": { + "amount": { + "description": "Decimal money amount.", + "type": ["null", "number"] + }, + "currency_code": { + "description": "Currency of the money.", + "type": ["null", "string"] + } + } + } + } + }, + "total_discount_amount_after_taxes": { + "description": "The total discounts allocated to the sale after taxes.", + "type": ["null", "object"], + "properties": { + "shop_money": { + "description": "Amount in shop currency.", + "type": ["null", "object"], + "properties": { + "amount": { + "description": "Decimal money amount.", + "type": ["null", "number"] + }, + "currency_code": { + "description": "Currency of the money.", + "type": ["null", "string"] + } + } + } + } + }, + "total_discount_amount_before_taxes": { + "description": "The total discounts allocated to the sale before taxes.", + "type": ["null", "object"], + "properties": { + "shop_money": { + "description": "Amount in shop currency.", + "type": ["null", "object"], + "properties": { + "amount": { + "description": "Decimal money amount.", + "type": ["null", "number"] + }, + "currency_code": { + "description": "Currency of the money.", + "type": ["null", "string"] + } + } + } + } + }, + "total_tax_amount": { + "description": "The total amount of taxes for the sale.", + "type": ["null", "object"], + "properties": { + "shop_money": { + "description": "Amount in shop currency.", + "type": ["null", "object"], + "properties": { + "amount": { + "description": "Decimal money amount.", + "type": ["null", "number"] + }, + "currency_code": { + "description": "Currency of the money.", + "type": ["null", "string"] + } + } + } + } + }, + "line_item": { + "description": "The line item for the associated sale.", + "type": ["null", "object"], + "properties": { + "id": { + "description": "A globally-unique line item ID.", + "type": ["null", "integer"] + }, + "admin_graphql_api_id": { + "description": "The original agreement-sales-related line item id reference for the shopify api", + "type": ["null", "string"] + } + } + }, + "admin_graphql_api_id": { + "description": "The original agreement-related sale id reference for the shopify api", + "type": ["null", "string"] + } + } + } + }, + "admin_graphql_api_id": { + "description": "The original agreement id reference for the shopify api", + "type": ["null", "string"] + } + } + } + } + } +} diff --git a/airbyte-integrations/connectors/source-shopify/source_shopify/scopes.py b/airbyte-integrations/connectors/source-shopify/source_shopify/scopes.py index d48be94d403779..41522bec790975 100644 --- a/airbyte-integrations/connectors/source-shopify/source_shopify/scopes.py +++ b/airbyte-integrations/connectors/source-shopify/source_shopify/scopes.py @@ -20,6 +20,7 @@ "CustomerSavedSearch": ("read_customers",), "CustomerAddress": ("read_customers",), # SCOPE: read_orders + "OrderAgreements": ("read_orders",), "Orders": ("read_orders",), "CustomerJourneySummary": ("read_orders",), "AbandonedCheckouts": ("read_orders",), diff --git a/airbyte-integrations/connectors/source-shopify/source_shopify/shopify_graphql/bulk/query.py b/airbyte-integrations/connectors/source-shopify/source_shopify/shopify_graphql/bulk/query.py index e9fc23e9d36ef6..56427c410cf542 100644 --- a/airbyte-integrations/connectors/source-shopify/source_shopify/shopify_graphql/bulk/query.py +++ b/airbyte-integrations/connectors/source-shopify/source_shopify/shopify_graphql/bulk/query.py @@ -2375,3 +2375,262 @@ def record_process_components(self, record: MutableMapping[str, Any]) -> Optiona record.pop("risk", None) yield record + + +class OrderAgreement(ShopifyBulkQuery): + """ + Output example to BULK query `order agreement` from `orders` with `filter query` by `updated_at` sorted `ASC`: + { + orders(query: "updated_at:>='2020-06-13T00:00:00+00:00' AND updated_at:<'2024-06-14T00:00:00+00:00'", sortKey:UPDATED_AT) { + edges { + node { + __typename + id + createdAt + updatedAt + agreements { + edges { + node { + __typename + id + happenedAt + reason + sales { + edges { + node { + __typename + quantity + id + actionType + lineType + totalAmount { + shopMoney { + amount + currencyCode + } + } + totalDiscountAmountAfterTaxes { + shopMoney { + amount + currencyCode + } + } + totalDiscountAmountBeforeTaxes { + shopMoney { + amount + currencyCode + } + } + totalTaxAmount { + shopMoney { + amount + currencyCode + } + } + ... on ProductSale { + id + lineItem { + id + } + } + } + } + } + } + } + } + } + } + } + } + """ + + query_name = "orders" + sort_key = "UPDATED_AT" + + shop_money_fields: List[Field] = [ + "amount", + Field(name="currencyCode", alias="currency_code"), + ] + + sales_fields: List[Field] = [ + Field( + name="edges", + fields=[ + Field( + name="node", + fields=[ + "__typename", + "quantity", + "id", + Field(name="actionType", alias="action_type"), + Field(name="lineType", alias="line_type"), + Field( + name="totalAmount", + alias="total_amount", + fields=[Field(name="shopMoney", alias="shop_money", fields=shop_money_fields)], + ), + Field( + name="totalDiscountAmountAfterTaxes", + alias="total_discount_amount_after_taxes", + fields=[Field(name="shopMoney", alias="shop_money", fields=shop_money_fields)], + ), + Field( + name="totalDiscountAmountBeforeTaxes", + alias="total_discount_amount_before_taxes", + fields=[Field(name="shopMoney", alias="shop_money", fields=shop_money_fields)], + ), + Field( + name="totalTaxAmount", + alias="total_tax_amount", + fields=[Field(name="shopMoney", alias="shop_money", fields=shop_money_fields)], + ), + InlineFragment( + type="ProductSale", + fields=[ + "id", + Field(name="lineItem", alias="line_item", fields=["id"]), + ], + ), + ], + ) + ], + ) + ] + + agreements_fields: List[Field] = [ + Field( + name="edges", + fields=[ + Field( + name="node", + fields=[ + "__typename", + "id", + Field(name="happenedAt", alias="happened_at"), + "reason", + Field(name="sales", fields=sales_fields), + ], + ) + ], + ) + ] + + query_nodes: List[Field] = [ + "__typename", + "id", + "createdAt", + "updatedAt", + Field(name="agreements", fields=agreements_fields), + ] + + sale_record_components = [ + # Each `OrderAgreement` could have one of the following sale component associated with it. + "AdditionalFeeSale", + "AdjustmentSale", + "DutySale", + "FeeSale", + "GiftCardSale", + "ProductSale", + "ShippingLineSale", + "TipSale", + "UnknownSale", + ] + + agreement_record_components = [ + # Each `Order` could have one of the following agreement component associated with it. + "OrderAgreement", + "OrderEditAgreement", + "RefundAgreement", + "ReturnAgreement", + ] + + record_composition = { + "new_record": "Order", + "record_components": agreement_record_components + sale_record_components, + } + + def _resolve_and_save_id(self, entity: MutableMapping[str, Any]) -> Mapping[str, Any]: + # save the id before it's resolved + entity["admin_graphql_api_id"] = entity.get("id") + entity["id"] = self.tools.resolve_str_id(entity.get("id")) + # remove leftovers + entity.pop("__parentId", None) + + return entity + + def process_agreement(self, agreement: MutableMapping[str, Any]) -> MutableMapping[str, Any]: + agreement = self._resolve_and_save_id(agreement) + # convert dates from ISO-8601 to RFC-3339 + agreement["happened_at"] = self.tools.from_iso8601_to_rfc3339(agreement, "happened_at") + + return agreement + + def cast_sale_amount_to_float(self, sale: MutableMapping[str, Any], entities: Iterable[str]) -> float: + # cast the `amount` from str to float + for entity in entities: + if sale.get(entity): + sale[entity]["shop_money"]["amount"] = float(sale.get(entity, {}).get("shop_money", {}).get("amount")) + return sale + + def process_sale(self, sale: MutableMapping[str, Any]) -> MutableMapping[str, Any]: + sale = self._resolve_and_save_id(sale) + sale_line_item = sale.get("line_item") + # `sale_line_item` could be None + if sale_line_item: + sale["line_item"]["admin_graphql_api_id"] = sale_line_item.get("id") + sale["line_item"]["id"] = self.tools.resolve_str_id(sale_line_item.get("id")) + # cast the `amout` for the number of entities provided from str to float + sale = self.cast_sale_amount_to_float( + sale, + ["total_amount", "total_discount_amount_after_taxes", "total_discount_amount_before_taxes", "total_tax_amount"], + ) + return sale + + def collect_sub_components( + self, collected_record_components: MutableMapping[str, Any], entities: List[str] + ) -> Optional[Iterable[MutableMapping[str, Any]]]: + collected_entities: List[MutableMapping[str, Any]] = [] + for component in entities: + _component: Optional[Iterable[Mapping[str, Any]]] = collected_record_components.get(component, []) + if _component: + for element in _component: + collected_entities.append(element) + + return collected_entities + + def join_agreements_with_sales( + self, collected_agreements: List[MutableMapping[str, Any]], collected_sales: List[Mapping[str, Any]] + ) -> Iterable[Mapping[str, Any]]: + # process each `agreement` collected by checking the related `sales` presence + for agreement in collected_agreements: + agreement_id = agreement.get("id") + agreement["sales"] = [] + # find the target `sale` record for each `agreement` collected + for sale in collected_sales: + sale_parent_id = sale.get("__parentId") + if sale_parent_id == agreement_id: + agreement["sales"].append(self.process_sale(sale)) + # process the final agreement element + self.process_agreement(agreement) + + return collected_agreements + + def record_process_components(self, record: MutableMapping[str, Any]) -> Optional[Iterable[MutableMapping[str, Any]]]: + """ + Defines how to process collected components. + """ + # get the joined record components collected for the record + record_components = record.get("record_components", {}) + if record_components: + collected_agreements = self.collect_sub_components(record_components, self.agreement_record_components) + collected_sales = self.collect_sub_components(record_components, self.sale_record_components) + if collected_agreements: + agreements_with_sales = self.join_agreements_with_sales(collected_agreements, collected_sales) + # remove leftovers + record.pop("record_components", None) + + # populate the record with the collected and joined `agreement + sales` data, if present + record["agreements"] = agreements_with_sales if agreements_with_sales else {} + + yield record diff --git a/airbyte-integrations/connectors/source-shopify/source_shopify/source.py b/airbyte-integrations/connectors/source-shopify/source_shopify/source.py index 7ef124811fc5bd..37c8c4c43db4b0 100644 --- a/airbyte-integrations/connectors/source-shopify/source_shopify/source.py +++ b/airbyte-integrations/connectors/source-shopify/source_shopify/source.py @@ -48,6 +48,7 @@ MetafieldProductVariants, MetafieldShops, MetafieldSmartCollections, + OrderAgreements, OrderRefunds, OrderRisks, Orders, @@ -206,6 +207,7 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]: MetafieldProductVariants(config), MetafieldShops(config), MetafieldSmartCollections(config), + OrderAgreements(config), OrderRefunds(config), OrderRisks(config), Orders(config), diff --git a/airbyte-integrations/connectors/source-shopify/source_shopify/streams/streams.py b/airbyte-integrations/connectors/source-shopify/source_shopify/streams/streams.py index d0028652607a71..5de98f1798eaa1 100644 --- a/airbyte-integrations/connectors/source-shopify/source_shopify/streams/streams.py +++ b/airbyte-integrations/connectors/source-shopify/source_shopify/streams/streams.py @@ -25,6 +25,7 @@ MetafieldProduct, MetafieldProductImage, MetafieldProductVariant, + OrderAgreement, OrderRisk, Product, ProductImage, @@ -260,6 +261,10 @@ def path(self, **kwargs) -> str: return f"shopify_payments/balance/{self.data_field}.json" +class OrderAgreements(IncrementalShopifyGraphQlBulkStream): + bulk_query: OrderAgreement = OrderAgreement + + class OrderRefunds(IncrementalShopifyNestedStream): parent_stream_class = Orders # override default cursor field @@ -269,7 +274,7 @@ class OrderRefunds(IncrementalShopifyNestedStream): class OrderRisks(IncrementalShopifyGraphQlBulkStream): bulk_query: OrderRisk = OrderRisk - # the updated stream work only with >= `2024-04` shopify api version + # the updated stream works only with >= `2024-04` shopify api version class Transactions(IncrementalShopifySubstream): diff --git a/airbyte-integrations/connectors/source-shopify/unit_tests/graphql_bulk/test_job.py b/airbyte-integrations/connectors/source-shopify/unit_tests/graphql_bulk/test_job.py index 8ce58ef3eae83b..1c82e2a67cf472 100644 --- a/airbyte-integrations/connectors/source-shopify/unit_tests/graphql_bulk/test_job.py +++ b/airbyte-integrations/connectors/source-shopify/unit_tests/graphql_bulk/test_job.py @@ -340,7 +340,7 @@ def test_stream_slices( @pytest.mark.parametrize( "stream, json_content_example, last_job_elapsed_time, previous_slice_size, adjusted_slice_size", [ - (CustomerAddress, "customer_address_jsonl_content_example", 10, 4, 5.5), + (CustomerAddress, "customer_address_jsonl_content_example", 20, 4, 5.5), ], ids=[ "Expand Slice Size", @@ -372,7 +372,6 @@ def test_expand_stream_slices_job_size( # fake `last job elapsed time` if last_job_elapsed_time: stream.job_manager._job_last_elapsed_time = last_job_elapsed_time - # parsing result from completed job first_slice = next(stream.stream_slices()) list(stream.read_records(SyncMode.incremental, stream_slice=first_slice)) diff --git a/airbyte-integrations/connectors/source-shopify/unit_tests/unit_test.py b/airbyte-integrations/connectors/source-shopify/unit_tests/unit_test.py index f999ea83b757c6..6af12a74b9c8a5 100644 --- a/airbyte-integrations/connectors/source-shopify/unit_tests/unit_test.py +++ b/airbyte-integrations/connectors/source-shopify/unit_tests/unit_test.py @@ -44,6 +44,7 @@ def test_get_next_page_token(requests_mock, auth_config): "fulfillments", "metafield_orders", "metafield_shops", + "order_agreements", "order_refunds", "order_risks", "orders", @@ -61,6 +62,7 @@ def test_get_next_page_token(requests_mock, auth_config): "fulfillments", "metafield_orders", "metafield_shops", + "order_agreements", "order_refunds", "order_risks", "orders", diff --git a/docs/integrations/sources/shopify.md b/docs/integrations/sources/shopify.md index 68e2fc7ac6d320..ed22526e5311fd 100644 --- a/docs/integrations/sources/shopify.md +++ b/docs/integrations/sources/shopify.md @@ -121,8 +121,8 @@ This source can sync data for the [Shopify REST API](https://shopify.dev/api/adm - [Countries](https://shopify.dev/docs/api/admin-rest/2024-04/resources/country) - [Custom Collections](https://shopify.dev/api/admin-rest/2024-04/resources/customcollection#top) - [Customers](https://shopify.dev/api/admin-rest/2024-04/resources/customer#top) -- [Customer Journey Summary](https://shopify.dev/docs/api/admin-graphql/2024-04/objects/customerjourneysummary) -- [Customer Address](https://shopify.dev/docs/api/admin-rest/2024-04/resources/customer-address) +- [Customer Journey Summary (GraphQL)](https://shopify.dev/docs/api/admin-graphql/2024-04/objects/customerjourneysummary) +- [Customer Address (GraphQL)](https://shopify.dev/docs/api/admin-graphql/2024-04/objects/Customer#field-customer-addresses) - [Customer Saved Search](https://shopify.dev/docs/api/admin-rest/2024-04/resources/customersavedsearch) - [Draft Orders](https://shopify.dev/api/admin-rest/2024-04/resources/draftorder#top) - [Discount Codes (GraphQL)](https://shopify.dev/docs/api/admin-graphql/2024-04/unions/DiscountCode) @@ -133,15 +133,15 @@ This source can sync data for the [Shopify REST API](https://shopify.dev/api/adm - [Inventory Levels (GraphQL)](https://shopify.dev/docs/api/admin-graphql/2024-04/objects/InventoryLevel) - [Locations](https://shopify.dev/api/admin-rest/2024-04/resources/location) - [Metafields (GraphQL)](https://shopify.dev/docs/api/admin-graphql/2024-04/objects/Metafield) +- [Order Agreements (GraphQL)](https://shopify.dev/docs/api/admin-graphql/2024-04/objects/OrderAgreement) - [Orders](https://shopify.dev/api/admin-rest/2024-04/resources/order#top) - [Order Refunds](https://shopify.dev/api/admin-rest/2024-04/resources/refund#top) -- [Order Risks](https://shopify.dev/api/admin-rest/2024-04/resources/order-risk#top) +- [Order Risks (GraphQL)](https://shopify.dev/api/admin-rest/2024-04/resources/order-risk#top) - [Pages](https://shopify.dev/api/admin-rest/2024-04/resources/page#top) - [Price Rules](https://shopify.dev/api/admin-rest/2024-04/resources/pricerule#top) -- [Products](https://shopify.dev/api/admin-rest/2024-04/resources/product#top) -- [Products (GraphQL)](https://shopify.dev/api/admin-graphql/2022-10/queries/products) -- [Product Images](https://shopify.dev/api/admin-rest/2024-04/resources/product-image) -- [Product Variants](https://shopify.dev/api/admin-rest/2024-04/resources/product-variant) +- [Products (GraphQL)](https://shopify.dev/docs/api/admin-graphql/2024-04/queries/products) +- [Product Images (GraphQL)](https://shopify.dev/docs/api/admin-graphql/2024-04/objects/Image) +- [Product Variants (GraphQL)](https://shopify.dev/docs/api/admin-graphql/2024-04/queries/productVariant) - [Shop](https://shopify.dev/api/admin-rest/2024-04/resources/shop) - [Smart Collections](https://shopify.dev/api/admin-rest/2024-04/resources/smartcollection) - [Transactions](https://shopify.dev/api/admin-rest/2024-04/resources/transaction#top) @@ -212,7 +212,9 @@ For all `Shopify GraphQL BULK` api requests these limitations are applied: https | Version | Date | Pull Request | Subject | | :------ |:-----------| :------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 2.4.0 | 2024-06-17 | [39527](https://github.com/airbytehq/airbyte/pull/39527) | Added new stream `Order Agreements` | | 2.3.0 | 2024-06-14 | [39487](https://github.com/airbytehq/airbyte/pull/39487) | Added new stream `Customer Journey Summary` | +| 2.4.3 | 2024-06-06 | [38084](https://github.com/airbytehq/airbyte/pull/38084) | add resiliency on some transient errors using the HttpClient | | 2.2.3 | 2024-06-06 | [38084](https://github.com/airbytehq/airbyte/pull/38084) | add resiliency on some transient errors using the HttpClient | | 2.2.2 | 2024-06-04 | [39019](https://github.com/airbytehq/airbyte/pull/39019) | [autopull] Upgrade base image to v1.2.1 | | 2.2.1 | 2024-05-30 | [38769](https://github.com/airbytehq/airbyte/pull/38769) | Have products stream return all the tags comma separated |