- that the content is an advertisement;
- on whose behalf the ad is presented;
- who paid for the ad, when that is someone different;
- the main parameters used to decide who sees the ad.
This guide covers the data Topsort stores and how to get it to your storefront. Your legal team decides which details you must display and how. For ad labeling, see Going Live.
How It Works
1
Create billing contacts
Your marketplace creates one billing contact per advertiser and payer combination, using the Billing API.
2
Link contacts to vendors
Each billing contact is linked to the vendors it can be used for. Only linked contacts appear in the vendor’s campaign forms.
3
Assign a contact to each campaign
Advertisers select a billing contact when they create a campaign in the Topsort UI. Campaigns created through the API get one assigned with a separate call.
4
Show the disclosure with the ad
Auction winners include a
campaignId. When a shopper clicks to see the ad’s details, for example an “About this ad” link, your backend fetches that campaign’s billing contact on demand and your storefront displays it.The Billing Contact
A billing contact has an ID and three required text fields:
How billing contacts relate to vendors and campaigns:
- You choose the ID. IDs are unique within your marketplace and case-sensitive. Sending a request with an existing ID updates that contact.
- Contacts and vendors are many-to-many. One contact can be linked to several vendors, for example an agency that buys ads for more than one seller. One vendor can have several contacts, for example one per brand it sells.
- A campaign has one billing contact at a time. Assigning a new one replaces the previous one.
Step 1: Create Billing Contacts
Call Upsert Billing Contact with the ID you want to use:204 No Content. Every call must include all three fields, because the request replaces the stored contact.
Step 2: Link Contacts to Vendors
Call Upsert Vendor Billing Contact once for each vendor that can use the contact:vendorIdis your vendor ID, the same one you send in your catalog.- The billing contact must already exist. Otherwise the call returns
404. - Linking a contact that is already linked does nothing, so retries are safe.
external_vendor_id to list every billing contact in your marketplace. Results come in pages of up to 100 (50 by default). When hasMore is true, send the nextPage value as the next_page query parameter to get the next page.
Step 3: Assign a Billing Contact to Each Campaign
- Topsort UI
- Campaign API
When a vendor has at least one linked billing contact, the campaign creation form shows a Billing Contact field in the launch step. The list contains only that vendor’s contacts, labeled by
advertiserName.- Sponsored Listings campaigns require a billing contact once the vendor has one.
- On other campaign types the field can be left empty. Use Step 5 to find campaigns without one.
Step 4: Show the Disclosure With Each Ad
Sponsored Listings and banner winners in the auction response include thecampaignId of the winning campaign. Keep it with each ad you render.
You don’t need the billing contact to render the ad. Fetch it on demand: when a shopper clicks to see the ad’s details, for example through an “About this ad” link, your backend calls Get Campaign Billing Contact with that campaignId:
Sponsored · Advertiser: BrightSmile · Paid by: BrightSmile Europe GmbHBuild the lookup with these rules:
- Fetch on demand. Call the endpoint when the shopper opens the ad’s details, not while you render ads or for every impression.
- Call it from your backend. The Advanced API key must never reach a browser or mobile app. Your storefront calls your own backend endpoint, which calls Topsort.
- Cache by campaign ID (optional). Many shoppers may open details for ads from the same campaign. A short cache, a few minutes, avoids repeat calls and keeps the details current. Don’t cache
404responses, so a contact you assign later shows up right away. - Handle
404. A404means the campaign has no billing contact. Show a fallback, such as the vendor name, and fix the campaign as described in Step 5.
Sponsored Brands winners do not include a
campaignId. If you run Sponsored Brands in the EU, contact your Topsort account team.Step 5: Check Coverage
Before you go live in the EU, and periodically after that, make sure every active campaign has a billing contact:- List your campaigns with Get Campaigns.
- For each campaign, call Get Campaign Billing Contact.
- For every
404, assign a contact with Upsert Campaign Billing Contact.
billingContacts list means the vendor needs a contact linked (Step 2).
Managing Billing Contacts Over Time
Correcting a contact. Send Upsert Billing Contact again with the same ID. The change applies immediately to every campaign that uses the contact. When the advertiser or payer changes. Create a new billing contact and assign it to the affected campaigns, instead of editing the existing one. Editing would change the details shown for every campaign that still uses the old contact. Unlinking a contact from a vendor. Call Delete Vendor Billing Contact:Billing contacts can’t be deleted, and a campaign’s billing contact can’t be removed, only replaced.
Endpoint Reference
All paths are relative to
https://api.topsort.com/public/v1/billing-service.
Troubleshooting
The Billing Contact field doesn't appear in the campaign form
The Billing Contact field doesn't appear in the campaign form
The vendor has no linked billing contacts. Check with Get Billing Contacts and the vendor’s ID, then link a contact (Step 2). If the vendor has contacts and the field still doesn’t appear, contact your Topsort account team.
404: Billing contact not found
404: Billing contact not found
The billing contact ID doesn’t exist in your marketplace. IDs are case-sensitive and must match the ID used in Step 1 exactly. Create the contact before linking or assigning it.
404 when linking a contact to a vendor
404 when linking a contact to a vendor
If the billing contact exists, the vendor ID wasn’t found. Use your own vendor ID, the same one you send in your catalog, not a Topsort internal ID.
404: Campaign not found
404: Campaign not found
campaignId must be the Topsort campaign ID of a campaign in your marketplace.422: Validation error
422: Validation error
A required field is missing or empty. Upsert Billing Contact needs
advertiserName, brandName and invoiceTo on every call.