Shopify / Shopify/shopify-api-ruby

CustomerAddress.all doesn't return results

Open
#970 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.1k
Forks
484
PR merge metrics
No merged PRs in 30d

Description

Issue summary

CustomerAddress.all doesn't return results, using Rest API with a private app.

Expected behavior

Returns list with customer's addresses.

Actual behavior

Returns empty list for a customer with an address.

Steps to reproduce the problem

  1. Create a customer with an address on Shopify.
  2. Initialise gem with private app config:
ShopifyAPI::Context.setup(
  api_key: "",
  host_name:"",
  scope: "",
  session_storage: ShopifyAPI::Auth::FileSessionStorage.new,
  is_embedded: false,
  is_private: true,
  api_version: Rails.application.credentials.shopify.api_version!,
  api_secret_key: Rails.application.credentials.shopify.password!,
  private_shop: "#{Rails.application.credentials.shopify.shop_name!}.myshopify.com"
)
  1. Perform ShopifyAPI::CustomerAddress.all(customer_id: x) and receive []
  2. Perform ShopifyAPI::Customer.find(id: x).addresses and confirm the customer actually has an address.

Specifications

  • shopify_api version: 10.1.0
  • Shopify API version used: 2022-04

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the discrepancy between ShopifyAPI::CustomerAddress.all(customer_id: x) and ShopifyAPI::Customer.find(id: x).addresses using the reported private-app configuration and API version. Trace the CustomerAddress.all request and compare it with the customer addresses response; done means the collection returns the customer's existing addresses, with a regression test covering the case.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.