Skip to content

Commit

Permalink
feat: adds advertising fox Mexico marketplace
Browse files Browse the repository at this point in the history
Mexico marketplace is not documented, but it does exist from experience.
  • Loading branch information
moltar committed Sep 2, 2020
1 parent cfcf2c1 commit 5cb3bbe
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/amazon-marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export enum AmazonMarketplaceAdvertisingCountryCode {
FR = 'FR',
IT = 'IT',
JP = 'JP',
MX = 'MX',
UK = 'UK', // Not a real country code, but such is life. See https://github.com/ScaleLeap/amazon-marketplaces/issues/122
US = 'US',
}
Expand Down
19 changes: 19 additions & 0 deletions src/marketplaces/mx.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import {
AmazonMarketplace,
AmazonMarketplaceAdvertisingCountryCode,
AmazonMarketplaceAdvertisingCurrency,
AmazonMarketplaceAdvertisingTimeZone,
AmazonMarketplaceCountryCode,
} from '../amazon-marketplace'
import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions'

export const MX = new AmazonMarketplace({
countryCode: AmazonMarketplaceCountryCode.MX,
Expand All @@ -11,4 +14,20 @@ export const MX = new AmazonMarketplace({
name: 'Mexico',
uri: 'https://www.amazon.com.mx',
webServiceUri: 'https://mws.amazonservices.com.mx',
advertising: {
countryCode: AmazonMarketplaceAdvertisingCountryCode.MX,
region: marketplaceAdvertisingRegions.NA,
// TODO: don't know for sure about the bids as there is no official documentation for that
bids: {
sponsoredBrands: {
min: 10,
max: 4900,
},
sponsoredProducts: {
min: 2,
max: 100000,
},
},
timeZone: AmazonMarketplaceAdvertisingTimeZone.AMERICA_LOS_ANGELES,
},
})
21 changes: 21 additions & 0 deletions test/__snapshots__/marketplaces.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,27 @@ AmazonMarketplace {

exports[`marketplace MX should match snapshot 1`] = `
AmazonMarketplace {
"advertising": Object {
"bids": Object {
"sponsoredBrands": Object {
"max": 4900,
"min": 10,
},
"sponsoredProducts": Object {
"max": 100000,
"min": 2,
},
},
"countryCode": "MX",
"region": AmazonMarketplaceAdvertisingRegion {
"accessTokenUri": "https://api.amazon.com/auth/o2/token",
"authorizationUri": "https://www.amazon.com/ap/oa",
"code": "NA",
"endpoint": "https://advertising-api.amazon.com",
"name": "North America",
},
"timeZone": "America/Los_Angeles",
},
"countryCode": "MX",
"currency": "MXN",
"id": "A1AM78C64UM0Y8",
Expand Down

0 comments on commit 5cb3bbe

Please sign in to comment.