From 91d9f30f28f8b0579618351919eb617b2c483639 Mon Sep 17 00:00:00 2001 From: Nisheal John Date: Tue, 7 Sep 2021 18:00:41 +0530 Subject: [PATCH] fix: adds advertising to India marketplace (#422) BREAKING CHANGE: adds advertising to India marketplace --- src/amazon-marketplace.ts | 2 ++ src/marketplaces/in.ts | 18 +++++++++++++++++ test/__snapshots__/marketplaces.test.ts.snap | 21 ++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/src/amazon-marketplace.ts b/src/amazon-marketplace.ts index c27710e7..82b262c1 100644 --- a/src/amazon-marketplace.ts +++ b/src/amazon-marketplace.ts @@ -64,6 +64,7 @@ export enum AmazonMarketplaceAdvertisingCountryCode { DE = 'DE', ES = 'ES', FR = 'FR', + IN = 'IN', IT = 'IT', JP = 'JP', MX = 'MX', @@ -80,6 +81,7 @@ export enum AmazonMarketplaceAdvertisingTimeZone { AMERICA_LOS_ANGELES = 'America/Los_Angeles', AMERICA_SAO_PAULO = 'America/Sao_Paulo', ASIA_DUBAI = 'Asia/Dubai', + ASIA_INDIA = 'Asia/Kolkata', ASIA_SINGAPORE = 'Asia/Singapore', ASIA_TOKYO = 'Asia/Tokyo', AUSTRALIA_SYDNEY = 'Australia/Sydney', diff --git a/src/marketplaces/in.ts b/src/marketplaces/in.ts index 81900e06..b32a13ce 100644 --- a/src/marketplaces/in.ts +++ b/src/marketplaces/in.ts @@ -1,8 +1,11 @@ import { AmazonMarketplace, + AmazonMarketplaceAdvertisingCountryCode, AmazonMarketplaceAdvertisingCurrency, + AmazonMarketplaceAdvertisingTimeZone, AmazonMarketplaceCountryCode, } from '../amazon-marketplace' +import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions' import { sellingPartnerRegions } from '../selling-partner-api-regions' export const IN = new AmazonMarketplace({ @@ -14,6 +17,21 @@ export const IN = new AmazonMarketplace({ sellerCentralUri: 'https://sellercentral.amazon.in', vendorCentralUri: 'https://www.vendorcentral.in', webServiceUri: 'https://mws.amazonservices.in', + advertising: { + countryCode: AmazonMarketplaceAdvertisingCountryCode.IN, + region: marketplaceAdvertisingRegions.EU, + bids: { + sponsoredBrands: { + min: 1, + max: 2000, + }, + sponsoredProducts: { + min: 1, + max: 5000, + }, + }, + timeZone: AmazonMarketplaceAdvertisingTimeZone.ASIA_INDIA, + }, sellingPartner: { region: sellingPartnerRegions.EU, }, diff --git a/test/__snapshots__/marketplaces.test.ts.snap b/test/__snapshots__/marketplaces.test.ts.snap index 0ebb18b8..507f1105 100644 --- a/test/__snapshots__/marketplaces.test.ts.snap +++ b/test/__snapshots__/marketplaces.test.ts.snap @@ -386,6 +386,27 @@ AmazonMarketplace { exports[`marketplace IN should match snapshot 1`] = ` AmazonMarketplace { + "advertising": Object { + "bids": Object { + "sponsoredBrands": Object { + "max": 2000, + "min": 1, + }, + "sponsoredProducts": Object { + "max": 5000, + "min": 1, + }, + }, + "countryCode": "IN", + "region": AmazonMarketplaceAdvertisingRegion { + "accessTokenUri": "https://api.amazon.co.uk/auth/o2/token", + "authorizationUri": "https://eu.account.amazon.com/ap/oa", + "code": "EU", + "endpoint": "https://advertising-api-eu.amazon.com", + "name": "Europe", + }, + "timeZone": "Asia/Kolkata", + }, "countryCode": "IN", "currency": "INR", "id": "A21TJRUUN4KGV",