POST api/subscription/create/campaign/search
Creates a new subscription, with all related billing data, in SiteWit and returns all necessary data for linking in the Partner's internal systems. The currency parameter should match the currency on file for the account. If no subscriptions have been purchased yet the currency can be different and will set the account currency.
Note: This is an Explicit endpoint that will only allow the subscription to be created if no other subscription has been created for this campaign previously. It requires the use of the Upgrade, Downgrade, and Reinstate endpoints for further modification to the subscription. This is the preferred method as it validates the correct intent for each action.
Request Information
Authentication Method
Partner/Account AuthenticationURI Parameters
None.
Body Parameters
Search Campaign Subscription (Create)Name | Description | Type | Additional information |
---|---|---|---|
billingType |
Type of billing |
BillingType |
|
googleCoupon |
Google coupon information if applicable |
Google Coupon (Create) |
|
chargedSpend |
Amount of money whith which the campaign is being funded today. This amount in conjuction with the budget will determine how long the campaign can run assuming the normal budget amount is spread evenly over 30 days. For example a campaign with a budget of 100 and initialFunds of 300 should run for 90 days before neededing to be replenished. |
decimal number |
Range: inclusive between 0 and 999999999 |
chargedFee |
If the fee is to be prorated then specify the prorated amount here. It should be proportional to the spend. If not passed then the fee will be calculated based on on the ratio of initial spend to the budget amount. |
decimal number |
Range: inclusive between 0 and 999999999 |
nextCharge |
Date when the campaign is expected to be charged next. For subscriptions with a type of Automatic this will be the date the spend is refilled and the partner is invoiced. For subscriptions with a type of Triggered this will represent the date when the spend is expected to be refilled. If not passed the date will be calculated based on the ratio of initial spend to the budget amount. Expected format is yyyy-MM-dd HH:mm:ssK. |
string |
|
budget |
Desired 30 Day spend budget |
decimal number |
Required Range: inclusive between 1 and 999999999 |
campaignId |
Id of campaign tied to this subscription |
integer |
Required |
currency |
Currency in which spend will be charged/reported |
Currency |
Required |
partnerSKUs |
A list of partner skus for auditng purposes |
Collection of PartnerSku |
|
Request Formats
application/json, text/json
{ "billingType": "Automatic", "googleCoupon": { "code": "XYZ1234", "amount": 150.0 }, "chargedSpend": 150.0, "chargedFee": 50.0, "nextCharge": "2025-07-30 02:49:26+00:00", "budget": 1500.0, "campaignId": 111, "currency": "USD", "partnerSKUs": null }
application/xml, text/xml
<SearchCampaignSubscription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.CreateModels"> <budget xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.DTOBaseModels">1500</budget> <campaignId xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.DTOBaseModels">111</campaignId> <currency xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.DTOBaseModels">USD</currency> <partnerSKUs i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.DTOBaseModels" /> <chargedFee xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.DTOBaseModels">50</chargedFee> <chargedSpend xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.DTOBaseModels">150</chargedSpend> <nextCharge xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.DTOBaseModels">2025-07-30 02:49:26+00:00</nextCharge> <billingType>Automatic</billingType> <googleCoupon> <amount xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.DTOBaseModels">150</amount> <code xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.DTOBaseModels">XYZ1234</code> </googleCoupon> </SearchCampaignSubscription>
Response Information
Successful Response:Resource Description
Campaign Subscription ChargeName | Description | Type | Additional information |
---|---|---|---|
charge | Campaign Charge Detail |
|
|
googleCoupon | Google Coupon |
|
|
id | integer |
|
|
name | string |
|
|
status | string |
|
|
type | string |
|
|
endDate | date |
|
|
subscription | Subscription Detail |
|
|
partnerSKUs | Collection of Partner Sku |
|
|
budgetLockExpiration | date |
|
|
subscriptionExpiration | date |
|
Response Formats
application/json, text/json
{ "charge": { "items": [ { "name": "Silver Spend", "price": 1500.0, "currency": "USD", "type": "SearchCampaignFee", "partnerSKU": null, "exchangeRate": 0.071008 }, { "name": "Silver Fee", "price": 100.0, "currency": "USD", "type": "SearchCampaignSpend", "partnerSKU": null, "exchangeRate": 0.071008 } ], "termRatio": 1.0 }, "googleCoupon": null, "id": 111, "name": "My campaign", "status": "Active", "type": "Search", "endDate": null, "subscription": { "budget": 1500.0, "currency": "USD", "active": true, "type": "SearchCampaign", "billingType": "Automatic", "nextCharge": "2025-07-30T02:49:26.5580935+00:00" }, "partnerSKUs": null, "budgetLockExpiration": null, "subscriptionExpiration": null }
application/xml, text/xml
<CampaignSubscriptionCharge xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SiteWit.PartnerAPI.Models.ReturnModels"> <budgetLockExpiration i:nil="true" /> <endDate i:nil="true" /> <id>111</id> <name>My campaign</name> <partnerSKUs i:nil="true" /> <status>Active</status> <subscription> <active>true</active> <billingType>Automatic</billingType> <budget>1500</budget> <currency>USD</currency> <nextCharge>2025-07-30T02:49:26.5580935+00:00</nextCharge> <type>SearchCampaign</type> </subscription> <subscriptionExpiration i:nil="true" /> <type>Search</type> <charge> <items> <ChargeItem> <currency>USD</currency> <exchangeRate>0.071008</exchangeRate> <name>Silver Spend</name> <partnerSKU i:nil="true" /> <price>1500</price> <type>SearchCampaignFee</type> </ChargeItem> <ChargeItem> <currency>USD</currency> <exchangeRate>0.071008</exchangeRate> <name>Silver Fee</name> <partnerSKU i:nil="true" /> <price>100</price> <type>SearchCampaignSpend</type> </ChargeItem> </items> <termRatio>1</termRatio> </charge> <googleCoupon i:nil="true" /> </CampaignSubscriptionCharge>