importing and verifying (exporting) products

186 views
Skip to first unread message

Rob Koberg

unread,
Sep 8, 2016, 10:51:16 AM9/8/16
to Stripe API Discussion
I have tried searching the stripe site and this list, but having trouble finding any information. I want to import existing products and then verify they were all imported. It is difficult to believe there is no information about stripe import and export coming up in a google search. What am I missing?

I see that I should use a feed in a google or link share format. However, it is not clear what is all required. For a google product feed, google says a GTIN (number under the bar code) is required. The products I am dealing with are fine wines from around the world and they do not consistently have any globally unique identifiers. So I tried the stripe node module's create method. That worked (and I blasted stripe servers with around 1000 products). I am able to get a list using the stripe node module (stripe.products.list()), which returns 10 items. I can see I can request up to 100. I suppose I can keep looping through until an empty array is returned, but there has to be a more convenient way, right?

Rasmus

unread,
Sep 8, 2016, 11:50:02 AM9/8/16
to Stripe API Discussion
Hi Rob,

Thanks for getting in touch! I realize that our documentation around what is and isn't required when importing product feeds can be confusing, especially when different feed consumers around the web have their own requirements. The fields that we care about are mostly the ones we're going to expose directly in the API, so if you've looked at the Product/SKU API you should be familiar with most of them. In particular:

- We use the `item_group_id` column in your feed as the ID of each product and fall back to the `id` column if the former is not specified. The `item_group_id` would be useful to have if you're specifying several variants of the same wine. If each row in your feed corresponds to a different wine, however, you can probably rely on just the `id` column. Google's documentation for this value is quite helpful: https://support.google.com/merchants/answer/188494?hl=en
- The feed columns `title`, `description`, `image_link`, `link` correspond to the `"name"`, `"description", `"images"` array, and `"url"` attributes of a Stripe Product object (https://stripe.com/docs/api#product_object).
- The field columns `id`, `price`,  and `availability` correspond to the `"id"`, `"price"`, and `"inventory"` attributes of a Stripe SKU.
- We attempt to read the columns `gender`, `color`, and `size` from your feed and create attributes (https://stripe.com/docs/api#product_object-attributes) for them if they are specified. Note that this might not be applicable if you are selling wines.

When you import a product feed to Stripe through the Dashboard, you should be able to see how many products and SKUs were imported from that feed. If you run into any issues feel free to get in touch with me and I can look into what might be going wrong when we import the feed. 

Using the automated product feed imports might be easier than retrieving each page of products through our API libraries, especially since our node.js bindings currently do not support automatic pagination. By default the API returns 10 results though via the parameter `limit` you can increase that up to 100. You can then call `list()` once, get 100 results, see if you have `has_more: true` and if so you call the API again and pass the last id in the `starting_after` field. There is official documentation of how our pagination works here: https://stripe.com/docs/api/node#pagination.

Hope that helps, please don't hesitate to reach out if there is anything I can help clarify.

Rasmus

Rob Koberg

unread,
Sep 8, 2016, 12:46:57 PM9/8/16
to Stripe API Discussion
OK. After I imported/created using the node api, I went to the dashboard and it said "around 0 result" though I was able to page through several pages of result. At some point later the count updated to say "around 600 results". So it does not show a precise count and I don't know if my create script created the same number as my source list. I have looped through the results, 100 at a time, and next step is to verify the import... There should be an easier way to get an export, though.

Rasmus Rygaard

unread,
Sep 8, 2016, 12:59:36 PM9/8/16
to api-d...@lists.stripe.com
Unfortunately the counts in the dashboard can be approximate and
slightly delayed relative to when you created your products. This is
definitely a pain point if you are trying to verify the exact count,
and I'm sorry to hear that you're running up against that issue. One
solution here would be to count the number of products returned by
your `list()` calls as you iterate through each page of products. You
are also welcome to get in touch with me directly at
rasmus....@stripe.com and I can help verify what got imported. In
general, if you successfully created each product without seeing any
errors from the Stripe API, you should have imported everything you
sent.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Stripe API Discussion" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/a/lists.stripe.com/d/topic/api-discuss/cCJqN9UFbkM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> api-discuss...@lists.stripe.com.
> To post to this group, send email to api-d...@lists.stripe.com.
> Visit this group at
> https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

Rob Koberg

unread,
Sep 8, 2016, 1:24:42 PM9/8/16
to Stripe API Discussion
ufff... bummer:

viewWines.length 649

importedWines.length 642


Then in the dashboard logs I filtered "request failed" and method "POST/PUT/DELETE" and did not see any failures at the time my POSTs went up.

Rob Koberg

unread,
Sep 8, 2016, 1:24:42 PM9/8/16
to Stripe API Discussion
Just saw your latest response. The email is being obfuscated, so I can't use it to contact you directly.

Rob Koberg

unread,
Sep 8, 2016, 1:37:13 PM9/8/16
to Stripe API Discussion
Figured out how to unobfuscate your email :) and sent a mail to you directly.
Reply all
Reply to author
Forward
0 new messages