Generate an affiliate link
1 min
POST
https://api.sandbox.tripleup.dev/affiliate-link-api
Body Parameters
- bodyAffiliateLinkRequestBodyrequired
- card_account_external_idstringrequiredDescription
- card_program_external_idstringrequiredDescription
- offer_idstringrequiredDescription
- publisher_external_idstringDescription
Responses
200
- AffiliateSuccessExample
{ "url": "https://example.com/affiliate-link-consumer?id=long-unique-id" }- urlstringDescription
400
401
404
- AffiliateFailureExample
{ "message": "merchant_id AcmeWidgets does not exist." }- messagestringDescription
500
curl
curl --request POST \
--url https://api.sandbox.tripleup.dev/affiliate-link-api \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"card_account_external_id": "",
"card_program_external_id": "",
"offer_id": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"card_account_external_id": "",
"card_program_external_id": "",
"offer_id": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.sandbox.tripleup.dev/affiliate-link-api", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.sandbox.tripleup.dev/affiliate-link-api")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"card_account_external_id": "",
"card_program_external_id": "",
"offer_id": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.sandbox.tripleup.dev/affiliate-link-api"
payload = json.dumps({
"card_account_external_id": "",
"card_program_external_id": "",
"offer_id": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// OK
{
"url": ""
}400
// Bad request
401
// Unauthorized
404
// Merchant not found
{
"message": ""
}500
// Internal server error
Generate a link for an (online) affiliate Offer. The link is specific to a single Card Account (cardholder), in order to attribute the purchase to the correct account.