ADDEDIT Affiliate API V2
Updated on 2014-04-28
Current Version: Version 2
Deprecated Version: V1
Requests Allowed: GET&SOAP
Summary:
Returns "Affiliate ### Created" or "Affiliate ### Updated"
Resource/WSDL Page:
http://<your_domain_here>/api/2/addedit.asmx?op=Affiliate
Parameters
Example Values:
api_key Required Type: STRING Length (Max/Min): 50 | Must be a valid API key (existing and Not expired) Example Values: Fo35NRAqvFLXoZxqB4aVMhh | ||
affiliate_id Required Type: INT Length (Max/Min): NA | 0 creates, > 0 edits Example Values: 123456 | ||
affiliate_name Required Type: STRING Length (Max/Min): 50 | Example Values: AffilateName | ||
third_party_name Required Type: STRING Length (Max/Min): 50 | NULL or empty skips on edit Example Values: ThirdPartyName | ||
account_status_id Required Type: BYTE Length (Max/Min): NA | Affiliate Account Status ID {See get.asmx > AccountStatuses} Example Values: 1 | ||
inactive_reason_id Required Type: BYTE Length (Max/Min): NA | 0 to skip Example Values: 0 | ||
affiliate_tier_id Required Type: BYTE Length (Max/Min): NA | Affiliate Tier ID {See get.asmx > AffiliateTiers} 0 to skip Example Values: 1 | ||
account_manager_id Required Type: INT Length (Max/Min): NA | 0 to auto select account manager on creation, 0 to skip on edit Example Values: 1234 | ||
hide_offers Required Type: BOOL Length (Max/Min): NA | Hide Offers with no Campaigns in the Affiliate Portal? ["TRUE", "FALSE"] Example Values: True | ||
website Optional | Affiliate Website Example Values: www.affiliatewebsite.com | ||
tax_class | Tax Class ["Corporation", "Individual/Sole Proprietor", "Partners/LLC/LLP", "Other"] Example Values: Corporation | ||
ssn_tax_id | SSN or Tax ID Example Values: 132456789 | ||
vat_tax_required | VAT Tax Required? ["True", "False"] Example Values: True | ||
swift_iban | Swift/IBAN ID. Not used if tipalti is enabled Example Values: swift | ||
payment_to Required Type: BYTE Length (Max/Min): NA | Payment Entity ["0" = Company Name, "1" = Main Contact]. Not used if tipalti is enabled Example Values: 1 | ||
payment_fee Required Type: DECIMAL Length (Max/Min): NA | < 0 to clear setting value Example Values: 20.05 | ||
payment_min_threshold Required Type: DECIMAL Length (Max/Min): NA | < 0 to use the global setting Example Values: 20.05 | ||
currency_id Required Type: BYTE Length (Max/Min): NA | 0 to skip, used only for currency enabled clients Example Values: 1 | ||
payment_setting_id Required Type: BYTE Length (Max/Min): NA | Use GET PaymentSettings API. 0 to skip Example Values: 1 | ||
billing_cycle_id Required Type: BYTE Length (Max/Min): NA | 0 to skip Example Values: 1 | ||
payment_type_id Required Type: BYTE Length (Max/Min): NA | If tipalti is enabled it uses tipalti else 0 to skip Example Values: 1 | ||
payment_type_info Required Type: STRING Length (Max/Min): 100 | Not used if tipalti is enabled Example Values: payment type info | ||
address_street Required Type: STRING Length (Max/Min): 60 | Only used if all address fields are non-NULL and non-empty Example Values: pacific coast highway | ||
address_street2 Required Type: STRING Length (Max/Min): 60 | Only used if all address fields are non-NULL and non-empty Example Values: macarthur | ||
address_city Required Type: STRING Length (Max/Min): 30 | Only used if all address fields are non-NULL and non-empty Example Values: Newport Beach | ||
address_state Required Type: STRING Length (Max/Min): 20 | Only used if all address fields are non-NULL and non-empty Example Values: California | ||
address_zip_code Required Type: STRING Length (Max/Min): 10 | Only used if all address fields are non-NULL and non-empty Example Values: 92660 | ||
address_country Required Type: STRING Length (Max/Min): 30 | Only used if all address fields are non-null and non-empty Example Values: United States | ||
media_type_ids Required Type: STRING Length (Max/Min): NA | This should be a comma separated list of media type IDs. Use Get Media ID API Example Values: Media types | ||
price_format_ids Required Type: STRING Length (Max/Min): NA | This should be a comma separated list of price format IDs. Use Get Price Format API. Example Values: price format | ||
vertical_category_ids Required Type: STRING Length (Max/Min): NA | Not currently available via API. Example Values: vertical category | ||
country_codes Required Type: STRING Length (Max/Min): NA | This should be a comma separated list of country codes Use GETCountries API Example Values: US,CA,MX | ||
tags Required Type: STRING Length (Max/Min): NA | This should be a comma separated list of tag names, each tag name cannot exceed 50 characters Example Values: tag1,tag2 | ||
pixel_html Required Type: STRING Length (Max/Min): NA | The HTML pixel that will be used for the Affiliate global pixel [Leaving this field blank will not update an existing pixel_html]. Used on creation, NULL or empty skips on edit Example Values: | ||
postback_url Required Type: STRING Length (Max/Min): 400 | The URL that will be used for the Affiliate global postback URL [Leaving this field blank will not update an existing postback_url]. Used on creation, NULL or empty skips on edit Example Values: | ||
postback_delay_ms Required Type: INT Length (Max/Min): NA | Amount of time( in MS) the postback URL will wait before its fired. Example Values: 1 | ||
fire_global_pixel Required Type: BOOL Length (Max/Min): NA | Fire the global pixel? Example Values: True | ||
date_added Required Type: DateTime Length (Max/Min): NA | Date Added [MM/DD/YYYY HH:MM:SS] Example Values: 04/28/2014 12:45:24 | ||
online_signup Required Type: BOOL Length (Max/Min): NA | Example Values: True | ||
signup_ip_address Required Type: STRING Length (Max/Min): 15 | Required if online_signup is true Example Values: 12.34.567.89 | ||
referral_affiliate_id Required Type: INT Length (Max/Min): NA | Referral Affiliate ID {See export.asmx > Affiliates}. 0 to skip on edit Example Values: 123456 | ||
referral_notes Required Type: STRING Length (Max/Min): 50 | Used on creation, NULL or empty skips on edit Example Values: Notes | ||
terms_and_conditions_agreed Required Type: BOOL Length (Max/Min): NA | Agreed to the Terms and Conditions? ["TRUE", "FALSE"] Example Values: True | ||
notes Required Type: STRING Length (Max/Min): NA | Used on creation, NULL or empty skips on edit Example Values: Notes |
**Note all optional parameters still need to be passed through in the actual call. These parameters do not need a value (therefore you can use a null value).
Example Request
Sample XML Response:
<?xml version="1.0" encoding="utf-8"?> <affiliate_addedit_response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://cakemarketing.com/api/2/"> <success>true</success> <message>Affiliate 1111318 Created</message> <affiliate_id>1111318</affiliate_id> </affiliate_addedit_response>
Example Error Messages:
Error Message | Likely Cause |
Invalid API Key | API Key does not exist or is expired |
Invalid Affiliate Name | affiliate_name is NULL or empty or exceeds 50 characters on create |
Invalid Third Party Name | third_party_name exceeds 50 characters on create |
Invalid Account Status | account_status_id equals 0 or it does not match an account status in the database on create |
Invalid Inactive Reason | inactive_reason_id does not match an inactive reason in the database on create. |
Invalid Affiliate Tier | affiliate_tier_id does not match an affiliate tier in the database on create |
Invalid Website | website exceeds 100 characters on create |
Invalid Tax Class | tax_class exceeds 30 characters on create |
Invalid SSN/Tax ID | ssn_tax_id exceeds 20 characters on create |
Invalid Swift IBAN | tipalti is not enabled and swift_iban exceeds 50 characters on create |
Invalid Payment To | tipalti is not enabled and payment_to <0 or payment_to > 1 on create |
Invalid Currency | the client has currency enabled and currency_id does not match a currency in the database on create |
Invalid Payment Setting | payment_setting_id does not match a currency payment setting in the database on create |
Invalid Billing Cycle | billing_cycle_id does not match a billing cycle in the database on create |
Invalid Payment Type | payment_type_id does not match a payment_type in our database and tipalti is not enabled on create |
Invalid Payment Type Info | payment_type_info exceeds 100 characters and tipalti is not enabled on create |
Invalid Account Manager ID | account_manager_id does not match a contact in the database on create |
Invalid Address Street | address_street exceeds 60 characters on create |
Invalid Address Street 2 | address_street2 exceeds 60 characters on create |
Invalid Address City | address_city exceeds 30 characters on create |
Invalid Address State | address_state exceeds 20 characters on create |
Invalid Address Zip Code | address_zip_code exceeds 10 characters on create |
Invalid Address Country | address_country exceeds 30 characters on create |
Invalid Postback URL | postback_url exceeds 400 characters on create |
Invalid Signup IP Address | online_signup is true and signup_up_address is NULL or empty or exceeds 15 characters on create |
Invalid Referral Affiliate | referral_affiliate_id doesn't match an affiliate in the database on create |
Invalid Referral Notes | referral_notes exceeds 50 characters on create |
Invalid Affiliate ID | affiliate_id doesn't match an affiliate in the database |
Invalid Account Manager ID | account_manager_id doesn't match a contact in the database |
Invalid Contact ID | account_manager_id doesn't match a valid contact in the database |
An error occured, please contact support@cakemarketing.com | General error if anything fails |