I want to connect the customer_id in foxycart with userid in my website

The case is that I will have a user on my website. I want to sell him a product. I will present him with the form that will trigger a payment on the foxycart. After successful payment I want to store the credits to the user on my website.

1. Is this a valid case for Foxycart?
2. How can i connect the user on my website with the transaction on the foxycart.

I am able to successfully retrieve the datafeed xml from the foxycart but which field in it gives me info about the user who made the payment? Or how to pass the userinfo to the foxycart so that it gets returned along with the datafeed xml.

Will be very thankful for any help.
  • fc_adamfc_adam FoxyCart Team

    Yes, that's definitely a valid use for FoxyCart. We would recommend using our webhooks to receive information about each successful transaction for your store, and saving any details you need on your side.

    You mention that you're making use of the datafeed, which would achieve that. If you're specifically referring to our XML datafeed, it'd be worth noting that we have a new webhook feature that supports a JSON payload and a number of other improvements. If you're not already integrated with the XML datafeed yet, we'd recommend switching to our new webhook functionality if you can work with JSON.

    In terms of what identifying data you can use - if you're just wanting to get the customers ID, that is included in the payload you receive. In our XML datafeed it's available within the customer_id node, and in our JSON webhook you'll see it as id within the fx:customer object in the payload. You can see examples of both payloads on their respective wiki pages.

    In terms of connecting the two, a common recommendation would be to add an additional column to your user table, and save the Foxy customer ID against your user. If you already know who the user is on your side before they start their purchase, you could make use of our single sign on functionality. You could create a corresponding FoxyCart customer record for your user before they reach the checkout, save their new customer ID in your database and then send them to the checkout already logged in. You can see more details about setting up SSO on our wiki here: http://wiki.foxycart.com/static/redirect/sso

    Alternatively, if you didn't know anything about the user before they completed their purchase, you can use the webhook to create the user on your side from the details it sent.

    Does that help answer your question? Let us know if we can assist with anything else!
Sign In or Register to comment.