Product List API
The Product List API allows you to retrieve a complete product list for your vendor account. Possible use cases include product lists on your webiste.
The data must be cached on your side, we reserve the right to restrict the retrieval of data via API with throttling before too many requests
1. Requirements
Definition of a Secret Key in the account settings in the MY-Area
A secret key must be used to authenticate the request to the API. You can generate this in your MY area by clicking on your Vendor Name → Account Settings → API → Secret Key → Generate.
2. Call
The call to the Product List API is a simple GET request:
https://secure.affilibank.de/[vendor name]/getproducts
In the HEAD of the request the secret key above must be supplied:
X-API-KEY=[ihr api key]
3. Example code
The following code shows an example of the call via Curl and PHP
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://secure.affilibank.de/demo-account-affilicon/getproducts', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'X-API-KEY: DEMO_API_KEY' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
4. Response
The JSON response then looks like this, for example, depending on the configured products:
{ "13987": { "price": 19.899999999999999, "pricing_net": false, "image_url": "https://fd897.s3-eu-central-1.amazonaws.com/images/jtw9celoug0ggcog4ccccsggscw4go0.jpg", "texts": { "de_DE": { "title": "Physical product simple (e.g. book, coffee cup)", "description": "This is a physical product that is sent to the customer by mail. " } }, "shipping": { "europe1": { "base": 3.8999999999999999 } } }, "13988": { "price": 24.899999999999999, "pricing_net": false, "image_url": "https://fd897.s3-eu-central-1.amazonaws.com/images/r36uo2ly85wo08oso8gkcswcgwkogso.jpg", "texts": { "de_DE": { "title": "Digital Product (z.B. eBook, PDF)", "description": "This is a digital product that is made available to customers via download. The customer can access the product immediately after purchase." } } }, "13989": { "price": 198, "pricing_net": false, "image_url": "https://fd897.s3-eu-central-1.amazonaws.com/images/bmtfodbaoi880cg4c80ck04ck0go4sg.jpg", "texts": { "de_DE": { "title": "Seminar with ticket delivery (e.g. business coaching)", "description": "This is a seminar, coaching or other event. Following the purchase, the customer immediately receives his eTicket to the event by email. You can customize the design of the ticket according to your preferences." } } } }