Ryan
Ryan

Reputation: 6057

Is it possible to get the order referral code with the Shopify API?

If I use a buy it now link with a ref parameter like this:

https://my-site.myshopify.com/4589944918/checkouts/875eeab0d9826de7f83241e07d930339?ref=xxx34

then I can see they used referral code xxx34 in the Shopify admin if I go to the order and then view conversion details > view full session.

However, this referral code value doesn't appear to show up in the order data that is returned by the admin/orders.json API endpoint.

Is there anyway to get the referral code using the Shopify API?

Upvotes: 1

Views: 785

Answers (2)

David Lazar
David Lazar

Reputation: 11427

There are lots of small attributes an order has, you should check them all out:

  • landing_site_ref: "abc"
  • reference: "fhwdgads"
  • referring_site: "http://www.otherexample.com"
  • landing_site: "http://www.example.com?source=abc"

Probably the one you want is the first one in this small list.

Upvotes: 1

Alba Herrerías
Alba Herrerías

Reputation: 181

The ref value is stored in the landing_site_ref property.

Upvotes: 0

Related Questions