On checkout page not redirecting on payment block

identix
Shopify Partner
23 0 1

store_name: tejash-patel-iw.myshopify.com 

We are placing new order from the thank you page of Shopify. When placing new order taking all details from the existing original orders like customer and shipping details.

My issue is when I am placing new order then sending all the current and proper details and but Shopify not redirecting on the payment page and keeping me on shipping details.

My actual case is here:
=> Shipping method name: Standard Shipping 
 > (This method rule is if the product is more than Rs.100 then shipping is free)

Creating a draft order with the following details:

Array
(
    [draft_order] => Array
        (
            [line_items] => Array
                (
                    [0] => Array
                        (
                            [variant_id] => 37770189930659
                            [quantity] => 1
                        )

                )

            [note] => Order from Feature Product
            [note_attributes] => Array
                (
                    [0] => Array
                        (
                            [name] => RCT-Revenue
                            [value] => Section_name: Product upsell
Template_name: Pre madte abc
Original_order_name: #1006
Original_order_id: 3745921204387
Section_id: 24
Template_id: 5060
Action: Purchased upsell: test
                        )

                )

            [shipping_line] => Array
                (
                    [title] => Standard Shipping
                    [handle] => shopify-Standard%20Shipping-0.0
                    [price] => 0.0
                )

            [applied_discount] => Array
                (
                    [title] => thanks-jEZRkKK9mJHhiO6
                    [description] => Description
                    [value] => 10
                    [value_type] => fixed_amount
                    [amount] => 10
                )

            [customer] => Array
                (
                    [id] => 5202502287523
                )

            [shipping_address] => Array
                (
                    [address1] => 40
                    [address2] => 
                    [city] => Surat
                    [company] => 
                    [country] => India
                    [country_code] => IN
                    [first_name] => Puja
                    [last_name] => Savani
                    [name] => Puja Savani
                    [phone] => 
                    [province] => Gujarat
                    [province_code] => GJ
                    [zip] => 395006
                )

            [billing_address] => Array
                (
                    [address1] => 40
                    [address2] => 
                    [city] => Surat
                    [company] => 
                    [country] => India
                    [country_code] => IN
                    [first_name] => Puja
                    [last_name] => Savani
                    [name] => Puja Savani
                    [phone] => 
                    [province] => Gujarat
                    [province_code] => GJ
                    [zip] => 395006
                )

        )

)

 

=> Getting this response in Draft order API:

Array
(
    [headers] => Array
        (
            [status] => HTTP/2 202 
            [date] => Fri, 16 Apr 2021 05:13:05 GMT
            [content-type] => application/json; charset=utf-8
            [x-sorting-hat-podid] => 162
            [x-sorting-hat-shopid] => 53185806499
            [referrer-policy] => origin-when-cross-origin
            [x-frame-options] => DENY
            [x-shopid] => 53185806499
            [x-shardid] => 162
            [x-stats-userid] => 
            [x-stats-apiclientid] => 3140135
            [x-stats-apipermissionid] => 307382157475
            [http_x_shopify_shop_api_call_limit] => 1/40
            [x-shopify-shop-api-call-limit] => 1/40
            [x-shopify-api-version] => 2021-01
            [location] => https://tejash-patel-iw.myshopify.com/admin/draft_orders/844981108899
            [retry-after] => 1
            [strict-transport-security] => max-age=7889238
            [x-shopify-stage] => production
            [content-security-policy] => default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://js-agent.newrelic.com https://bam.nr-data.net https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=create&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fdraft_orders&source%5Bsection%5D=admin_api&source%5Buuid%5D=93560344-3213-4dd4-a8f3-35618ac611d3
            [x-content-type-options] => nosniff
            [x-download-options] => noopen
            [x-permitted-cross-domain-policies] => none
            [x-xss-protection] => 1; mode=block; report=/xss-report?source%5Baction%5D=create&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fdraft_orders&source%5Bsection%5D=admin_api&source%5Buuid%5D=93560344-3213-4dd4-a8f3-35618ac611d3
            [x-dc] => gcp-asia-southeast1,gcp-us-central1,gcp-us-central1
            [x-request-id] => 93560344-3213-4dd4-a8f3-35618ac611d3
            [set-cookie] => _shopify_fs=2021-04-16T05%3A13%3A05Z; Expires=Sat, 16-Apr-22 05:13:05 GMT; Domain=tejash-patel-iw.myshopify.com; Path=/; SameSite=Lax
            [cf-cache-status] => DYNAMIC
            [cf-request-id] => 097ab1e5c200003212fab95000000001
            [expect-ct] => max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
            [server] => cloudflare
            [cf-ray] => 640aec1c68903212-BOM
            [alt-svc] => h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
        )

    [response] => {"draft_order":{"id":844981108899,"note":"Order from Feature Product","email":"puja.savani@identixweb.in","taxes_included":false,"currency":"INR","invoice_sent_at":null,"created_at":"2021-04-16T10:43:05+05:30","updated_at":"2021-04-16T10:43:05+05:30","tax_exempt":false,"completed_at":null,"name":"#D125","status":"open","line_items":[{"variant_id":37770189930659,"product_id":6084061855907,"title":"Camouflage V-Hem Crop Top with Legging Set","variant_title":"Camouflage \/ S","sku":"UNG82429CMFLGS","vendor":"Collectivefab","quantity":1,"requires_shipping":true,"taxable":true,"gift_card":false,"fulfillment_service":"manual","grams":454,"tax_lines":[{"rate":0.18,"title":"IGST","price":"10326.60"}],"applied_discount":null,"name":"Camouflage V-Hem Crop Top with Legging Set - Camouflage \/ S","properties":[],"custom":false,"price":"57380.00","admin_graphql_api_id":"gid:\/\/shopify\/DraftOrderLineItem\/57114564722851"}],"shipping_address":{"first_name":"Puja","address1":"40","phone":null,"city":"Surat","zip":"395006","province":"Gujarat","country":"India","last_name":"Savani","address2":"","company":null,"latitude":null,"longitude":null,"name":"Puja Savani","country_code":"IN","province_code":"GJ"},"billing_address":{"first_name":"Puja","address1":"40","phone":null,"city":"Surat","zip":"395006","province":"Gujarat","country":"India","last_name":"Savani","address2":"","company":null,"latitude":null,"longitude":null,"name":"Puja Savani","country_code":"IN","province_code":"GJ"},"invoice_url":"https:\/\/tejash-patel-iw.myshopify.com\/53185806499\/invoices\/2dd41721a548c49ed9df203b9f81b4c7","applied_discount":{"description":"Description","value":"10.0","title":"thanks-I1xIrhvUhhdlFnv","amount":"10.00","value_type":"fixed_amount"},"order_id":null,"shipping_line":null,"tax_lines":[{"rate":0.18,"title":"IGST","price":"10326.60"}],"tags":"","note_attributes":[{"name":"RCT-Revenue","value":"Section_name: Product upsell\nTemplate_name: Pre madte abc\nOriginal_order_name: #1006\nOriginal_order_id: 3745921204387\nSection_id: 24\nTemplate_id: 5060\nAction: Purchased upsell: test"}],"total_price":"67696.60","subtotal_price":"57370.00","total_tax":"10326.60","admin_graphql_api_id":"gid:\/\/shopify\/DraftOrder\/844981108899","customer":{"id":5202502287523,"email":"puja.savani@identixweb.in","accepts_marketing":false,"created_at":"2021-04-16T09:34:41+05:30","updated_at":"2021-04-16T10:38:19+05:30","first_name":"Puja","last_name":"Savani","orders_count":0,"state":"enabled","total_spent":"0.00","last_order_id":null,"note":null,"verified_email":false,"multipass_identifier":null,"tax_exempt":false,"phone":null,"tags":"","last_order_name":null,"currency":"INR","accepts_marketing_updated_at":"2021-04-16T09:34:41+05:30","marketing_opt_in_level":null,"tax_exemptions":[],"admin_graphql_api_id":"gid:\/\/shopify\/Customer\/5202502287523","default_address":{"id":6370141372579,"customer_id":5202502287523,"first_name":"Puja","last_name":"Savani","company":null,"address1":"40","address2":"","city":"Surat","province":"Gujarat","country":"India","zip":"395006","phone":null,"name":"Puja Savani","province_code":"GJ","country_code":"IN","country_name":"India","default":true}}}}
)

 

As you can see here, I am getting shipping_line null ("shipping_line":null) in response.

So, please check this case and update me want I'm doing wrong and what is the issue here.

Thanks,

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
310 42 53

Hey @identix 

Just want to confirm that is the correct handle. From our docs: 

You can use the DraftOrder resource to send orders with custom shipping lines. A custom shipping line includes a title and price with handle set to Nil. A shipping line with a carrier provided shipping rate (currently set via the Shopify admin) includes the shipping rate handle.

Kevin_A | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
identix
Shopify Partner
23 0 1

We have tried different ways but it's not working can you please give me an example of what and how I need to send the request.

 

1) Create draft order with full handle:
Request array:
Array(
    [draft_order] => Array        (
            [line_items] => Array                (
                    [0] => Array                        (
                            [variant_id] => 38135180329152
                            [quantity] => 1
                        )                )
            [note] => Order from Feature Product
            [note_attributes] => Array                (
                    [0] => Array                        (
                            [name] => RCT-Revenue
                            [value] => Section_name: Product upsell
Template_name: Pre madte abc
Original_order_name: #1026
Original_order_id: 3761634443456
Section_id: 24
Template_id: 5060
Action: Purchased upsell: Cololight - WiFi Smart LED Light
                        )                )
            [shipping_line] => Array                (
                    [title] => Standard
                    [handle] => shopify-Standard-65.0
                    [price] => 65.0
                )
            [customer] => Array                (
                    [id] => 5042144018624
                )
            [shipping_address] => Array                (
                    [address1] => test
                    [address2] => test
                    [city] => test
                    [company] => 
                    [country] => India
                    [country_code] => IN
                    [first_name] => test
                    [last_name] => test
                    [name] => test test
                    [phone] => 
                    [province] => Gujarat
                    [province_code] => GJ
                    [zip] => 394545
                )
            [billing_address] => Array                (
                    [address1] => test
                    [address2] => test
                    [city] => test
                    [company] => 
                    [country] => India
                    [country_code] => IN
                    [first_name] => test
                    [last_name] => test
                    [name] => test test
                    [phone] => 
                    [province] => Gujarat
                    [province_code] => GJ
                    [zip] => 394545                )        ) )
API response:
stdClass Object(
    [draft_order] => stdClass Object        (
            [id] => 845962903744
            [note] => Order from Feature Product
            [email] => test@gmail.com
            [taxes_included] => 
            [currency] => ILS
            [invoice_sent_at] => 
            [created_at] => 2021-05-07T11:45:43+05:30
            [updated_at] => 2021-05-07T11:45:43+05:30
            [tax_exempt] => 
            [completed_at] => 
            [name] => #D50
            [status] => open
            [line_items] => Array                (
                    [0] => stdClass Object                        (
                            [id] => 57118741102784
                            [variant_id] => 38135180329152
                            [product_id] => 6203115077824
                            [title] => Dark Denim Top
                            [variant_title] => L
                            [sku] => 
                            [vendor] => partners-demo
                            [quantity] => 1
                            [requires_shipping] => 1
                            [taxable] => 1
                            [gift_card] => 
                            [fulfillment_service] => manual
                            [grams] => 907
                            [tax_lines] => Array                                (
                                )
                            [applied_discount] => 
                            [name] => Dark Denim Top - L
                            [properties] => Array                                (
                                )
                            [custom] => 
                            [price] => 60.00
                            [admin_graphql_api_id] => gid://shopify/DraftOrderLineItem/57118741102784
                        )                )
            [shipping_address] => stdClass Object                (
                    [first_name] => test
                    [address1] => test
                    [phone] => 
                    [city] => test
                    [zip] => 394545
                    [province] => Gujarat
                    [country] => India
                    [last_name] => test
                    [address2] => test
                    [company] => 
                    [latitude] => 
                    [longitude] => 
                    [name] => test test
                    [country_code] => IN
                    [province_code] => GJ                )
            [billing_address] => stdClass Object                (
                    [first_name] => test
                    [address1] => test
                    [phone] => 
                    [city] => test
                    [zip] => 394545
                    [province] => Gujarat
                    [country] => India
                    [last_name] => test
                    [address2] => test
                    [company] => 
                    [latitude] => 
                    [longitude] => 
                    [name] => test test
                    [country_code] => IN
                    [province_code] => GJ
                )
            [applied_discount] => 
            [order_id] => 
            [shipping_line] => 
            [tax_lines] => Array                (
                )
            [tags] => 
            [note_attributes] => Array                (
                    [0] => stdClass Object                        (
                            [name] => RCT-Revenue
                            [value] => Section_name: Product upsell
Template_name: Pre madte abc
Original_order_name: #1026
Original_order_id: 3761634443456
Section_id: 24
Template_id: 5060
Action: Purchased upsell: Cololight - WiFi Smart LED Light
                        )
                )
            [total_price] => 60.00
            [subtotal_price] => 60.00
            [total_tax] => 0.00
            [admin_graphql_api_id] => gid://shopify/DraftOrder/845962903744
            [customer] => stdClass Object                (
                    [id] => 5042144018624
                    [email] => test@gmail.com
                    [accepts_marketing] => 
                    [created_at] => 2021-03-05T18:53:51+05:30
                    [updated_at] => 2021-05-05T13:23:12+05:30
                    [first_name] => test
                    [last_name] => test
                    [orders_count] => 0
                    [state] => disabled
                    [total_spent] => 0.00
                    [last_order_id] => 
                    [note] => 
                    [verified_email] => 1
                    [multipass_identifier] => 
                    [tax_exempt] => 
                    [phone] => 
                    [tags] => 
                    [last_order_name] => 
                    [currency] => ILS
                    [accepts_marketing_updated_at] => 2021-03-05T18:53:51+05:30
                    [marketing_opt_in_level] => 
                    [tax_exemptions] => Array                        (
                        )
                    [admin_graphql_api_id] => gid://shopify/Customer/5042144018624
                    [default_address] => stdClass Object                        (
                            [id] => 6291708248256
                            [customer_id] => 5042144018624
                            [first_name] => test
                            [last_name] => test
                            [company] => 
                            [address1] => test
                            [address2] => test
                            [city] => test
                            [province] => Gujarat
                            [country] => India
                            [zip] => 394545
                            [phone] => 
                            [name] => test test
                            [province_code] => GJ
                            [country_code] => IN
                            [country_name] => India
                            [default] => 1
                        )                )        ))
 
2) Create draft order with pass full handle in custom parameter of shipping line object:
Request array:
[shipping_line] => Array(
[title] => Standard
[custom] => shopify-Standard-65.0
[handle] => shopify-Standard-65.0
[price] => 65.0
)
API response:
[shipping_line] => 
 
3) Pass true in custom parameter with full handle:
Request array:
[shipping_line] => Array(
[title] => Standard
[handle] => shopify-Standard-65.0
[custom] => true
[price] => 65.0
)
 
API response:
[shipping_line] => 
 
4) Pass false in custom parameter with full handle:
Request array:
[shipping_line] => Array(
[title] => Standard
[handle] => shopify-Standard-65.0
[custom] => false
[price] => 65.0
)
API response:
[shipping_line] => 
0 Likes