Create an API data source
create_data_sourceCreate an API data source in Merchant Center, required for inserting or updating products and promotions via the API.
Instructions
Creates an API (generic) data source — the target that insert_product_input / update_product_input / insert_promotion need as data_source. Only API sources can be created through the API (file, UI and autofeed sources are set up in Merchant Center). For product sources content_language and feed_label must be both set or both omitted; countries applies to primary sources only. A promotions source requires target_country and content_language. Returns the created DataSource with its dataSourceId.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Data source type: primary_products (main product feed), supplemental_products (overrides/extra attributes) or promotions. | |
| account | No | Merchant Center account ID (digits, e.g. "123456"). Omit to use the GOOGLE_MERCHANTS_ACCOUNT_ID default. | |
| countries | No | CLDR country codes the products target. Primary product sources only. | |
| feed_label | No | Feed label, e.g. "US". Product sources only; set together with content_language. | |
| display_name | Yes | Human-readable data source name shown in Merchant Center. | |
| target_country | No | CLDR country code, e.g. "US". Required for (and only used by) promotions sources. | |
| content_language | No | Two-letter ISO 639-1 language, e.g. "en". Product sources: set together with feed_label or not at all. Required for promotions sources. |