Documentation
Feedback
Guides
API Reference

Guides
Guides

Integrating VTEX Ads with external marketplaces

Learn how to integrate VTEX Ads with external marketplaces through authentication, catalog management, campaign operations, and SSO implementation.

This document describes how to integrate VTEX Ads with external marketplaces through bidirectional authentication, catalog synchronization, and unified campaign management.

Authentication

Authentication occurs bidirectionally, both from the marketplace to VTEX Ads and from VTEX Ads to the marketplace.

Marketplace to VTEX Ads

The connection requires adding two parameters in the request headers sent to VTEX Ads.

HeaderDescription
x-app-idThe App ID identifies the API user
x-api-keyThe API Key identifies the API "password"

Access credentials must be requested from our Support team.

VTEX Ads to marketplace

In this scenario, the connection will be from VTEX Ads to the marketplace. To standardize this integration, we will use Basic Authentication format in the request.

AuthenticationDescription
usernameUsername for authentication
passwordUser password

For more information about Basic Authentication functionality, see the RFC 7617 specification.

Catalog

The catalog API enables product synchronization between marketplaces and VTEX Ads. All product data must include the following attributes:

AttributeDescriptionTypeRequired
product_skuUnique identifier of the parent productStringYes
nameProduct titleStringYes
image_urlPublic product image URL, can be just a thumbnailStringNo
categoriesList of categoriesStringYes
brandProduct brand nameStringYes
gtinsList of EANsArrayNo
urlsProduct URL informationArrayYes
urls.siteSite brand nameStringNo
urls.urlProduct URLStringYes
stocksProduct stock informationArrayYes
stocks.siteSite brand nameStringNo
stocks.seller_idSeller ID identifierStringNo
stocks.quantityStock quantityFloatYes
metadataInformation returned during ad queries without modificationObject<String, String>No

For this step, we need an API to query the retailer's catalog, and this catalog must contain:

AttributeDescription
seller_idFilter by seller identifier.
namePartial search by product name.
skusFilter by a list of SKUs.
eansFilter by a list of EANs.
quantityNumber of items that should be returned.
pageCurrent page number. Starts at 0 (zero).
GET PREFIX/search?name=&seller_id=&skus=sku1,sku2,...,skuN&eans=ean1,ean2,...,eanN&quantity=&page=  

Response example - Status 200

[
  {
    "product_sku": "sku123",
    "name": "Red Sneakers",
    "image_url": "https://example.com/image.jpg",
    "categories": "Sports/Shoes",
    "brand": "Nike",
    "gtins": ["1234567890123"],
    "urls": [
      {
        "site": "example-store",
        "url": "https://example.com/product/red-sneakers"
      }
    ],
    "stocks": [
      {
        "site": "example-store",
        "seller_id": "seller123",
        "quantity": 10
      }
    ],
    "metadata": {
      "color": "red",
      "size": "42"
    }
  }
]

Any status other than 200 is considered an error.

Advertiser (seller)

The Advertiser entity manages sellers and their associated data.

EndpointsDescriptionFilters
GET /api/v1/advertisersSearch advertisersquantity, page, name, seller_id
POST /api/v1/advertisersCreate advertiser-
GET /api/v1/advertisers/:seller_idGet advertiser by seller ID-
PATCH /api/v1/advertisers/:seller_idUpdate advertiser by seller ID-

Campaigns

The Campaigns entity manages advertising campaign creation and updates.

EndpointsDescriptionFilters
GET /api/v1/campaignsList campaignsseller_id, page, quantity, name, status, ad_type
POST /api/v1/campaignsCreate campaign-
GET /api/v1/campaigns/:campaign_idGet campaign by ID-
PATCH /api/v1/campaigns/:campaign_idUpdate campaign by ID-

Metrics

The Metrics entity provides macro and historical performance data for campaigns.

EndpointsDescriptionFilters
GET /api/v1/metrics/macro/campaignsGet macro metricsstart_at, end_at, campaign_id, seller_id
GET /api/v1/metrics/history/campaignsGet historical metricsstart_at, end_at, campaign_id, seller_id

Credits

The Credits entity manages advertiser account balances and transactions.

EndpointsDescriptionFilters
GET /api/v1/checking_accountsList advertiser credit accountsseller_id, page, quantity
GET /api/v1/checking_accounts/:seller_id/transactionsList credits for an accountpage, quantity
POST /api/v1/checking_accounts/:seller_id/transactionsAdd credits to an account-

Credit purchase with credit card/PIX

EndpointsDescriptionFilters
GET /api/v1/paymentsList paymentsseller_id, page, quantity
POST /api/v1/payments/:payment_typeCreate a new payment that will add credits-
GET /api/v1/payments/:payment_idQuery a payment-

SSO (VTEX Ads authentication)

The goal is that once the customer is connected to the marketplace platform, they can reuse that login when connecting to the Retail Media platform.

Any status other than 200 is considered an error.

Login

Authentication uses a JWT token with a shared secret. The token must contain:

  • publisher_id: Retailer ID on VTEX Ads.
  • seller_id: Seller ID in the marketplace.
  • user_id: User ID in the marketplace.
  • 24h expiration time
GET https://app.ads.vtex.com/login/marketplace?sso=JWT

User information query

The marketplace must provide an endpoint to query user information by user ID that returns the following fields:

  • name
  • email
GET PREFIX/users/:user_id?seller_id=&publisher_id=

Seller information query

The marketplace must provide an endpoint to query seller information that returns the following fields:

  • name
  • cnpj (tax ID)
GET PREFIX/sellers/:seller_id?publisher_id=

SSO v2 (VTEX Ads authentication)

SSO v2 allows retailers to send seller and user information to the VTEX Ads authentication API. VTEX Ads returns a redirect URL for the end user.

Authentication follows the same model described in the Authentication section.

POST https://api-retail-media.newtail.com.br/sso/marketplace

For the full request and response specification, see Generate seller single sign-on URL in the VTEX Ads API reference.

Request example

{
  "sso_token": "user-identification-token",
  "email": "user@example.com",
  "user_id": "user123",
  "name": "User Name",
  "marketplace_name": "Marketplace Name"
}

Response examples

Success - Status 200

{
  "url_redirect": "https://app.ads.vtex.com/login/marketplace?token=JWT"
}

Failure

  • Status 400 - Validation error

    {
      "message": "ValidationError",
      "errors": []
    }
    
  • Status 500 - Internal application error

    {
      "message": "InternalServerError"
    }
    
Contributors
1
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
1
Photo of the contributor
Was this helpful?
Suggest edits (GitHub)
On this page