> ## Documentation Index
> Fetch the complete documentation index at: https://docs.interchange.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Ensure GAM advertiser

> Create or find a Google Ad Manager advertiser by name for an ESA

`POST /api/v2/storefront/esa/{esaId}/gam/advertisers/ensure`

Creates or finds a Google Ad Manager advertiser by name on a GAM-backed embedded sales agent. Use it to provision a catch-all advertiser before setting the default, or to mint a per-buyer advertiser. The returned `advertiser.id` can be passed straight to the default-advertiser or buyer-mapping endpoints. Set `dryRun` to preview without creating.

## Request

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.interchange.io/api/v2/storefront/esa/123/gam/advertisers/ensure \
    -H "Authorization: Bearer $SCOPE3_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "name": "Interchange Catch-All" }'
  ```

  ```json Dry run theme={null}
  {
    "name": "Acme Beverages",
    "dryRun": true
  }
  ```
</CodeGroup>

## Parameters

| Field    | Type    | Required | Notes                                                                       |
| -------- | ------- | -------- | --------------------------------------------------------------------------- |
| `esaId`  | integer | Yes      | Path. Embedded sales-agent connection id                                    |
| `name`   | string  | Yes      | Advertiser name to create or match, 1–255 chars                             |
| `dryRun` | boolean | No       | When `true`, report what would happen without creating. Defaults to `false` |

## Response

```json theme={null}
{
  "advertiser": {
    "id": "4567890123",
    "name": "Interchange Catch-All",
    "status": "ACTIVE",
    "currencyCode": "USD"
  },
  "created": true,
  "dryRun": false
}
```

`created` is `true` when a new advertiser was created and `false` when an existing one was matched by name. `dryRun` echoes whether the call was a preview. Pass `advertiser.id` as `gamAdvertiserId` to the default-advertiser or buyer-mapping endpoints.

## Errors

* `400 VALIDATION_ERROR` — `name` is empty or over 255 chars, `esaId` is not a positive integer, or the ESA is not Google Ad Manager-backed.

See [Errors](/v2/reference/errors) for the full error contract.

## Related

<CardGroup cols={2}>
  <Card title="Buyer routing tasks" href="/v2/storefront/buyer-routing/tasks" icon="list-check">
    All buyer-routing operations
  </Card>

  <Card title="List GAM advertisers" href="/v2/storefront/buyer-routing/tasks/list-gam-advertisers" icon="list">
    Browse cached advertiser records
  </Card>

  <Card title="Set default advertiser" href="/v2/storefront/buyer-routing/tasks/set-default-advertiser" icon="star">
    Use this advertiser as the catch-all
  </Card>

  <Card title="Create buyer mapping" href="/v2/storefront/buyer-routing/tasks/create-buyer-mapping" icon="link">
    Route a buyer to this advertiser
  </Card>
</CardGroup>
