Search code examples
javascriptpluginse-commercexssaffiliate

Programmatially add items to a users basket on third party


I apologise in advance if this is not a typical Stack Overflow question.

I'm building a website that sells products via an affiliate network. This means people click on a product link from my site then get redirected to the sellers site where they need to add the product to their basket and then purchase it.

My question is, is there a way I can programmatically (batch) add the products to the users website? I.E. Have a card on my site, and when they click "buy" all products are added to the third party site automatically.

I suspect this might not be possible via JavaScript due on my site due to XSS restrictions (I'm hoping someone will say it is actually possible): p Alternatively, would this be possible with a browser plugin?

Sorry again for asking the question on here, but I'm really at a loss for what terms I should even search for to find what I'm looking for. Any leads for finding the feasibility or technical approach I could take would be greatly appreciated:)


Solution

  • As I'am understand you right, this could only be done by the third party themself. They have to provide a way to add items to their cart on which outside services (like from your side) could connect to.

    On third-party side there are options for this, like:

    • API calls
    • Links to use from outside with maybe URL-GET parameters (like the sku or some other tokens)

    But of course without such options provided by the third party, I'm pretty sure its not really possible.