Discount code lookup 404 bug

Highlighted
Shopify Partner
23 0 1
I believe to have come across a bug in the discount code lookup, where the discount code with certain settings are not found.
 
Here is what happens when we make a GET request to the discount code lookup endpoint, only when the discount is set up to buy $50.00 from a specific collection, and get 1 specific product free.
 
 
{ 
   "headers":{ 
      "http_status_code":"404",
      "http_status_message":"Not Found",
      "date":"Wed, 13 Nov 2019 20:34:47 GMT",
      "content-type":"application\/json",
      "transfer-encoding":"chunked",
      "connection":"keep-alive",
      "set-cookie":"__cfduid=de715ab48afc6f26046883f934ebc4cfe1573677287; expires=Thu, 12-Nov-20 20:34:47 GMT; path=\/; domain=.myshopify.com; HttpOnly",
      "x-sorting-hat-podid":"63",
      "x-sorting-hat-shopid":"1634304064",
      "vary":"Accept-Encoding",
      "referrer-policy":"origin-when-cross-origin",
      "x-frame-options":"DENY",
      "x-shopid":"1634304064",
      "x-shardid":"63",
      "x-stats-userid":"",
      "x-stats-apiclientid":"1769413",
      "x-stats-apipermissionid":"183695736896",
      "http_x_shopify_shop_api_call_limit":"1\/40",
      "x-shopify-shop-api-call-limit":"1\/40",
      "x-shopify-api-version":"2019-04",
      "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.shopify.cn 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=lookup&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fprice_rules%2Fdiscount_codes&source%5Bsection%5D=admin_api&source%5Buuid%5D=ce0c6c56-b33a-497e-bd0b-7616900cb233",
      "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=lookup&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fprice_rules%2Fdiscount_codes&source%5Bsection%5D=admin_api&source%5Buuid%5D=ce0c6c56-b33a-497e-bd0b-7616900cb233",
      "x-dc":"gcp-us-east1,gcp-us-central1,gcp-us-central1",
      "x-request-id":"ce0c6c56-b33a-497e-bd0b-7616900cb233",
      "cf-cache-status":"DYNAMIC",
      "expect-ct":"max-age=604800, report-uri=\"https:\/\/report-uri.cloudflare.com\/cdn-cgi\/beacon\/expect-ct\"",
      "server":"cloudflare",
      "cf-ray":"535387447a23ce8f-LHR"
   },
   "body":""
}
 
If I adjust the discount code to any other situation, here is what I get:
 
{ 
   "headers":{ 
      "http_status_code":"303",
      "http_status_message":"See Other",
      "date":"Wed, 13 Nov 2019 20:36:57 GMT",
      "content-type":"text\/html; charset=utf-8",
      "transfer-encoding":"chunked",
      "connection":"keep-alive",
      "set-cookie":"__cfduid=d7bdd444040604a90f7f49e0a9c7904e61573677416; expires=Thu, 12-Nov-20 20:36:56 GMT; path=\/; domain=.myshopify.com; HttpOnly",
      "x-sorting-hat-podid":"63",
      "x-sorting-hat-shopid":"1634304064",
      "referrer-policy":"origin-when-cross-origin",
      "x-frame-options":"DENY",
      "x-shopid":"1634304064",
      "x-shardid":"63",
      "x-stats-userid":"",
      "x-stats-apiclientid":"1769413",
      "x-stats-apipermissionid":"183695736896",
      "http_x_shopify_shop_api_call_limit":"1\/40",
      "x-shopify-shop-api-call-limit":"1\/40",
      "x-shopify-api-version":"2019-04",
      "location":"https:\/\/concierge-cloud.myshopify.com\/admin\/price_rules\/594746507328\/discount_codes\/3931748008000",
      "strict-transport-security":"max-age=7889238",
      "x-request-id":"79675ba7-74a1-4d92-947c-d0fb04e96316",
      "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.shopify.cn 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=lookup&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fprice_rules%2Fdiscount_codes&source%5Bsection%5D=admin_api&source%5Buuid%5D=79675ba7-74a1-4d92-947c-d0fb04e96316",
      "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=lookup&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fprice_rules%2Fdiscount_codes&source%5Bsection%5D=admin_api&source%5Buuid%5D=79675ba7-74a1-4d92-947c-d0fb04e96316",
      "x-dc":"gcp-us-central1,gcp-us-central1",
      "nel":"{\"report_to\":\"network-errors\",\"max_age\":2592000,\"failure_fraction\":0.01,\"success_fraction\":0.0001}",
      "report-to":"{\"group\":\"network-errors\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https:\/\/monorail-edge.shopifycloud.com\/v1\/reports\/nel\/20190325\/shopify\"}]}",
      "cf-cache-status":"DYNAMIC",
      "expect-ct":"max-age=604800, report-uri=\"https:\/\/report-uri.cloudflare.com\/cdn-cgi\/beacon\/expect-ct\"",
      "server":"cloudflare",
      "cf-ray":"53538a703fbe35c4-LHR"
   },
   "body":"You are being redirected<\/a>.<\/body><\/html>"
}
Which, once redirected, provides the information needed to get the price rule:
 
{ 
   "discount_code":{ 
      "id":3931748008000,
      "price_rule_id":594746507328,
      "code":"nike",
      "usage_count":0,
      "created_at":"2019-11-13T14:03:58-05:00",
      "updated_at":"2019-11-13T14:57:11-05:00"
   }
}
0 Likes