From b34fc89a5044aa205288ed13919ee83bf528c9cf Mon Sep 17 00:00:00 2001 From: Jesse Evers Date: Mon, 24 Jul 2023 11:24:50 -0400 Subject: [PATCH] Add support for the CHANNEL.TYPE header where it is required (#5) --- README.md | 1 + docs/Apis/MP/CA/EventsApi.md | 8 +++ docs/Apis/MP/CA/FeedsApi.md | 3 + docs/Apis/MP/CA/InternationalShippingApi.md | 8 +++ docs/Apis/MP/CA/InventoryApi.md | 3 + docs/Apis/MP/CA/ItemsApi.md | 4 ++ docs/Apis/MP/CA/OrdersApi.md | 8 +++ docs/Apis/MP/CA/PricesApi.md | 2 + docs/Apis/MP/CA/PromotionsApi.md | 3 + docs/Apis/MP/CA/ReportsApi.md | 1 + resources/schemas/.gitkeep | 0 resources/schemas/ca/mp/cbt.json | 16 ++++- resources/schemas/ca/mp/events.json | 16 ++++- resources/schemas/ca/mp/feeds.json | 11 +++- resources/schemas/ca/mp/inventory.json | 11 +++- resources/schemas/ca/mp/items.json | 12 +++- resources/schemas/ca/mp/orders.json | 16 ++++- resources/schemas/ca/mp/price.json | 10 ++- resources/schemas/ca/mp/promotion.json | 11 +++- resources/schemas/ca/mp/reports.json | 9 ++- resources/templates/Configuration.hbs | 32 ++++++++- src/Apis/MP/CA/EventsApi.php | 72 +++++++++++++++++++++ src/Apis/MP/CA/FeedsApi.php | 27 ++++++++ src/Apis/MP/CA/InternationalShippingApi.php | 72 +++++++++++++++++++++ src/Apis/MP/CA/InventoryApi.php | 27 ++++++++ src/Apis/MP/CA/ItemsApi.php | 36 +++++++++++ src/Apis/MP/CA/OrdersApi.php | 72 +++++++++++++++++++++ src/Apis/MP/CA/PricesApi.php | 18 ++++++ src/Apis/MP/CA/PromotionsApi.php | 27 ++++++++ src/Apis/MP/CA/ReportsApi.php | 9 +++ src/Configuration.php | 32 ++++++++- src/Enums/SecurityScheme.php | 6 +- utils/constants.php | 3 +- utils/customize-schemas.php | 57 +++++++++------- utils/generate-apis.php | 2 + 35 files changed, 607 insertions(+), 38 deletions(-) delete mode 100644 resources/schemas/.gitkeep diff --git a/README.md b/README.md index 1231d4af..df92a37c 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ The `Configuration` class is used to configure the client library. It takes a si - `country`: The country you are selling in. Must be one of the values in `Walmart\Enums\Country`: `Country::US`, `Country::CA`, or `Country::MX`. Defaults to `Country::US`. - `consumerId`: Your Walmart Consumer ID. Required if you are making requests to endpoints that use signature-based auth (see the [Authorization](#authorization) section) - `privateKey`: Your Walmart private key. Ditto the requirements for the `consumerId` option. +- `channelType`: The channel type value you received during onboarding. Required in CA. - `accessToken`: An instance of `Walmart\AccessToken`, containing an access token and its expiration time. If provided, this will be used instead of the client ID and secret to authenticate API calls, until the token expires. This is useful if you want to reuse an access token that you've already retrieved from Walmart. More details on access token auth [below](#access-token-auth). If you try to instantiate an instance of an API class that is not supported in the country you've specified, an exception will be thrown. diff --git a/docs/Apis/MP/CA/EventsApi.md b/docs/Apis/MP/CA/EventsApi.md index 5043e642..a605d19e 100644 --- a/docs/Apis/MP/CA/EventsApi.md +++ b/docs/Apis/MP/CA/EventsApi.md @@ -66,6 +66,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -133,6 +134,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -192,6 +194,7 @@ void (empty response body) This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -255,6 +258,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -320,6 +324,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -380,6 +385,7 @@ This endpoint does not need any parameter. This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -444,6 +450,7 @@ void (empty response body) This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -507,6 +514,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. diff --git a/docs/Apis/MP/CA/FeedsApi.md b/docs/Apis/MP/CA/FeedsApi.md index 94e6fe6d..6cdd3f65 100644 --- a/docs/Apis/MP/CA/FeedsApi.md +++ b/docs/Apis/MP/CA/FeedsApi.md @@ -63,6 +63,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -130,6 +131,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -199,6 +201,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. diff --git a/docs/Apis/MP/CA/InternationalShippingApi.md b/docs/Apis/MP/CA/InternationalShippingApi.md index fe646e81..d31ec863 100644 --- a/docs/Apis/MP/CA/InternationalShippingApi.md +++ b/docs/Apis/MP/CA/InternationalShippingApi.md @@ -70,6 +70,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -139,6 +140,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -208,6 +210,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -275,6 +278,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -340,6 +344,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -409,6 +414,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -476,6 +482,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -545,6 +552,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. diff --git a/docs/Apis/MP/CA/InventoryApi.md b/docs/Apis/MP/CA/InventoryApi.md index e134c5d1..36bd000e 100644 --- a/docs/Apis/MP/CA/InventoryApi.md +++ b/docs/Apis/MP/CA/InventoryApi.md @@ -61,6 +61,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -126,6 +127,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -199,6 +201,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. diff --git a/docs/Apis/MP/CA/ItemsApi.md b/docs/Apis/MP/CA/ItemsApi.md index 3a1d4ad1..3a5a1518 100644 --- a/docs/Apis/MP/CA/ItemsApi.md +++ b/docs/Apis/MP/CA/ItemsApi.md @@ -64,6 +64,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -133,6 +134,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -196,6 +198,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -259,6 +262,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. diff --git a/docs/Apis/MP/CA/OrdersApi.md b/docs/Apis/MP/CA/OrdersApi.md index 062e00c6..35e5b657 100644 --- a/docs/Apis/MP/CA/OrdersApi.md +++ b/docs/Apis/MP/CA/OrdersApi.md @@ -66,6 +66,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -148,6 +149,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -229,6 +231,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -298,6 +301,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -371,6 +375,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -436,6 +441,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -554,6 +560,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -647,6 +654,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. diff --git a/docs/Apis/MP/CA/PricesApi.md b/docs/Apis/MP/CA/PricesApi.md index 3c28df1b..09993ddc 100644 --- a/docs/Apis/MP/CA/PricesApi.md +++ b/docs/Apis/MP/CA/PricesApi.md @@ -62,6 +62,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -136,6 +137,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. diff --git a/docs/Apis/MP/CA/PromotionsApi.md b/docs/Apis/MP/CA/PromotionsApi.md index baf3a08c..8710dbf6 100644 --- a/docs/Apis/MP/CA/PromotionsApi.md +++ b/docs/Apis/MP/CA/PromotionsApi.md @@ -61,6 +61,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -126,6 +127,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. @@ -212,6 +214,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. diff --git a/docs/Apis/MP/CA/ReportsApi.md b/docs/Apis/MP/CA/ReportsApi.md index 7b5beb65..689cf495 100644 --- a/docs/Apis/MP/CA/ReportsApi.md +++ b/docs/Apis/MP/CA/ReportsApi.md @@ -61,6 +61,7 @@ try { This endpoint requires the following authorization methods: +* `channelTypeScheme`: Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor. * `signatureScheme`: Request signature authentication. Request signatures are generated using a combination of request info, a timestamp, and your Walmart consumer ID and private key. The signature is passed in the WM_SEC.AUTH_SIGNATURE header. This is always used in tandem with consumer ID authentication (above). When using endpoints that require signature authentication, you must pass the `privateKey` and `consumerId` options to the `Configuration` constructor. * `consumerIdScheme`: Header authentication with your Walmart consumer ID, which is passed in the WM_CONSUMER.ID header. This is always used in tandem with signature authentication (below). When using endpoints that require consumer ID authentication, you must pass the `consumerId` option to the `Configuration` constructor. diff --git a/resources/schemas/.gitkeep b/resources/schemas/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/resources/schemas/ca/mp/cbt.json b/resources/schemas/ca/mp/cbt.json index dd223a3a..d2925856 100644 --- a/resources/schemas/ca/mp/cbt.json +++ b/resources/schemas/ca/mp/cbt.json @@ -3,7 +3,7 @@ "info": { "title": "International Shipping", "description": "The International Shipping API enables sellers to use the Ship with Walmart (SWW) International shipping programs to ship their goods from the US to Canada. These APIs provide support for two SWW Programs : SWW Express & SWW Ground", - "version": "0.3.0" + "version": "0.4.0" }, "servers": [ { @@ -134,6 +134,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -213,6 +214,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -289,6 +291,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -367,6 +370,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -426,6 +430,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -496,6 +501,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -565,6 +571,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -655,6 +662,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -1219,6 +1227,12 @@ } }, "securitySchemes": { + "channelTypeScheme": { + "type": "apiKey", + "in": "header", + "name": "WM_CONSUMER.CHANNEL.TYPE", + "description": "Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor." + }, "consumerIdScheme": { "type": "apiKey", "in": "header", diff --git a/resources/schemas/ca/mp/events.json b/resources/schemas/ca/mp/events.json index 7bb72ffd..16444f7c 100644 --- a/resources/schemas/ca/mp/events.json +++ b/resources/schemas/ca/mp/events.json @@ -3,7 +3,7 @@ "info": { "title": "Event Management", "description": "The Event Management APIs are built to enable sellers to participate in the Promotional Events hosted on Seller Center Canada Ecommerce Website. These events are set up by our Business Teams and sellers can participate voluntarily to promote their SKUs at a promotional price for certain time period.", - "version": "0.3.0" + "version": "0.4.0" }, "servers": [ { @@ -65,6 +65,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -107,6 +108,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -129,6 +131,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -179,6 +182,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -239,6 +243,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -281,6 +286,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -321,6 +327,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -391,6 +398,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -695,6 +703,12 @@ } }, "securitySchemes": { + "channelTypeScheme": { + "type": "apiKey", + "in": "header", + "name": "WM_CONSUMER.CHANNEL.TYPE", + "description": "Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor." + }, "consumerIdScheme": { "type": "apiKey", "in": "header", diff --git a/resources/schemas/ca/mp/feeds.json b/resources/schemas/ca/mp/feeds.json index b9fdc1c1..f7a46ae9 100644 --- a/resources/schemas/ca/mp/feeds.json +++ b/resources/schemas/ca/mp/feeds.json @@ -3,7 +3,7 @@ "info": { "title": "Feed Management", "description": "Feeds are constructed to handle bulk functions. A feed consists of an HTTP request with an attached file. The attached file contains the XML representing the objects that need to be created or updated.", - "version": "0.3.0" + "version": "0.4.0" }, "servers": [ { @@ -65,6 +65,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -128,6 +129,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -198,6 +200,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -707,6 +710,12 @@ } }, "securitySchemes": { + "channelTypeScheme": { + "type": "apiKey", + "in": "header", + "name": "WM_CONSUMER.CHANNEL.TYPE", + "description": "Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor." + }, "consumerIdScheme": { "type": "apiKey", "in": "header", diff --git a/resources/schemas/ca/mp/inventory.json b/resources/schemas/ca/mp/inventory.json index 38980981..ac77ef88 100644 --- a/resources/schemas/ca/mp/inventory.json +++ b/resources/schemas/ca/mp/inventory.json @@ -3,7 +3,7 @@ "info": { "title": "Inventory Management", "description": "Maintaining up-to-date inventory for your items on Walmart.com ensures a great experience for your customers and greater sales opportunities for you.", - "version": "0.3.0" + "version": "0.4.0" }, "servers": [ { @@ -46,6 +46,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -96,6 +97,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -161,6 +163,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -312,6 +315,12 @@ } }, "securitySchemes": { + "channelTypeScheme": { + "type": "apiKey", + "in": "header", + "name": "WM_CONSUMER.CHANNEL.TYPE", + "description": "Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor." + }, "consumerIdScheme": { "type": "apiKey", "in": "header", diff --git a/resources/schemas/ca/mp/items.json b/resources/schemas/ca/mp/items.json index 196386af..9c2bc803 100644 --- a/resources/schemas/ca/mp/items.json +++ b/resources/schemas/ca/mp/items.json @@ -3,7 +3,7 @@ "info": { "title": "Item Management", "description": "The Item Management APIs enable you to set up and manage items on Walmart.com. Once you have completed Registration and have access to your Consumer ID and Private Key, you can get started with the integration process", - "version": "0.3.0" + "version": "0.4.0" }, "servers": [ { @@ -128,6 +128,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -198,6 +199,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -238,6 +240,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -278,6 +281,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -774,6 +778,12 @@ } }, "securitySchemes": { + "channelTypeScheme": { + "type": "apiKey", + "in": "header", + "name": "WM_CONSUMER.CHANNEL.TYPE", + "description": "Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor." + }, "consumerIdScheme": { "type": "apiKey", "in": "header", diff --git a/resources/schemas/ca/mp/orders.json b/resources/schemas/ca/mp/orders.json index 9ad2c7a9..ccf109da 100644 --- a/resources/schemas/ca/mp/orders.json +++ b/resources/schemas/ca/mp/orders.json @@ -3,7 +3,7 @@ "info": { "title": "Order Management", "description": "The Walmart Order Management APIs help Sellers to manage customer\u2019s Sales Orders and to stay up-to-date on orders fulfillment, which orders to fulfill, and when to fulfill them.", - "version": "0.3.0" + "version": "0.4.0" }, "servers": [ { @@ -58,6 +58,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -110,6 +111,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -162,6 +164,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -202,6 +205,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -323,6 +327,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -372,6 +377,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -456,6 +462,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -524,6 +531,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -2133,6 +2141,12 @@ } }, "securitySchemes": { + "channelTypeScheme": { + "type": "apiKey", + "in": "header", + "name": "WM_CONSUMER.CHANNEL.TYPE", + "description": "Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor." + }, "consumerIdScheme": { "type": "apiKey", "in": "header", diff --git a/resources/schemas/ca/mp/price.json b/resources/schemas/ca/mp/price.json index f34e892f..f40d24f3 100644 --- a/resources/schemas/ca/mp/price.json +++ b/resources/schemas/ca/mp/price.json @@ -3,7 +3,7 @@ "info": { "title": "Price Management", "description": "The price is a fundamental building block for your listing on Walmart.com. You can use the price management APIs to set up and manage the price for a given item", - "version": "0.3.0" + "version": "0.4.0" }, "servers": [ { @@ -47,6 +47,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -111,6 +112,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -339,6 +341,12 @@ } }, "securitySchemes": { + "channelTypeScheme": { + "type": "apiKey", + "in": "header", + "name": "WM_CONSUMER.CHANNEL.TYPE", + "description": "Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor." + }, "consumerIdScheme": { "type": "apiKey", "in": "header", diff --git a/resources/schemas/ca/mp/promotion.json b/resources/schemas/ca/mp/promotion.json index ddd7877f..68811ac1 100644 --- a/resources/schemas/ca/mp/promotion.json +++ b/resources/schemas/ca/mp/promotion.json @@ -3,7 +3,7 @@ "info": { "title": "Promotion Management", "description": "Sellers can set regular or promotional prices for their items. Setting the Promotional prices is an option to create unique pricing for events such as clearance sales or to call out a comparison price", - "version": "0.3.0" + "version": "0.4.0" }, "servers": [ { @@ -66,6 +66,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -134,6 +135,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -175,6 +177,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -274,6 +277,12 @@ } }, "securitySchemes": { + "channelTypeScheme": { + "type": "apiKey", + "in": "header", + "name": "WM_CONSUMER.CHANNEL.TYPE", + "description": "Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor." + }, "consumerIdScheme": { "type": "apiKey", "in": "header", diff --git a/resources/schemas/ca/mp/reports.json b/resources/schemas/ca/mp/reports.json index 07da22e1..6021c601 100644 --- a/resources/schemas/ca/mp/reports.json +++ b/resources/schemas/ca/mp/reports.json @@ -3,7 +3,7 @@ "info": { "title": "Item report", "description": "Returns all the information associated with Seller's items that are set up on Walmart\u2019s platform.", - "version": "0.3.0" + "version": "0.4.0" }, "servers": [ { @@ -55,6 +55,7 @@ }, "security": [ { + "channelTypeScheme": [], "signatureScheme": [], "consumerIdScheme": [] } @@ -135,6 +136,12 @@ } }, "securitySchemes": { + "channelTypeScheme": { + "type": "apiKey", + "in": "header", + "name": "WM_CONSUMER.CHANNEL.TYPE", + "description": "Header authentication with your Walmart channel type, which is passed in the WM_CONSUMER.CHANNEL.TYPE header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor." + }, "consumerIdScheme": { "type": "apiKey", "in": "header", diff --git a/resources/templates/Configuration.hbs b/resources/templates/Configuration.hbs index e57b76b2..ac69597e 100644 --- a/resources/templates/Configuration.hbs +++ b/resources/templates/Configuration.hbs @@ -88,6 +88,13 @@ class Configuration */ protected string $consumerId; + /** + * The channel type to use in request headers + * + * @var string + */ + protected string $channelType; + /** * User agent of the HTTP request * @@ -327,6 +334,29 @@ class Configuration return $this->consumerId; } + /** + * Sets the channel type to use in request headers + * + * @param string $channelType The consumer ID + * + * @return $this + */ + public function setChannelType(string $channelType): static + { + $this->channelType = $channelType; + return $this; + } + + /** + * Gets the channel type to use in request headers + * + * @return string The channel type + */ + public function getChannelType(): string + { + return $this->channelType; + } + /** * Sets the host * @@ -462,7 +492,7 @@ class Configuration protected function validateOptions(array $options): void { $validKeys = [ - 'clientId', 'clientSecret', 'country', 'accessToken', 'privateKey', 'consumerId' + 'clientId', 'clientSecret', 'country', 'accessToken', 'privateKey', 'consumerId', 'channelType' ]; $invalid = array_diff(array_keys($options), $validKeys); diff --git a/src/Apis/MP/CA/EventsApi.php b/src/Apis/MP/CA/EventsApi.php index 55367368..06985ca6 100644 --- a/src/Apis/MP/CA/EventsApi.php +++ b/src/Apis/MP/CA/EventsApi.php @@ -329,6 +329,15 @@ protected function autoUploadPromoSpecRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -672,6 +681,15 @@ protected function bulkAddItemRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -902,6 +920,15 @@ protected function downloadTemplateRequest(): Request } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1206,6 +1233,15 @@ protected function getAPromoItemRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1528,6 +1564,15 @@ protected function getAllPromoItemsRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1799,6 +1844,15 @@ protected function getEventRequest(): Request } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -2080,6 +2134,15 @@ protected function getPromoSpecRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -2384,6 +2447,15 @@ protected function getTotalItemCountRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, diff --git a/src/Apis/MP/CA/FeedsApi.php b/src/Apis/MP/CA/FeedsApi.php index f15f8a20..1763cd6d 100644 --- a/src/Apis/MP/CA/FeedsApi.php +++ b/src/Apis/MP/CA/FeedsApi.php @@ -353,6 +353,15 @@ protected function bulkContentSetupRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -687,6 +696,15 @@ protected function getAllFeedStatusesRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1046,6 +1064,15 @@ protected function getFeedItemStatusRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, diff --git a/src/Apis/MP/CA/InternationalShippingApi.php b/src/Apis/MP/CA/InternationalShippingApi.php index 629611b6..a57b3b94 100644 --- a/src/Apis/MP/CA/InternationalShippingApi.php +++ b/src/Apis/MP/CA/InternationalShippingApi.php @@ -364,6 +364,15 @@ protected function createConsolidationRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -716,6 +725,15 @@ protected function createLabelRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1080,6 +1098,15 @@ protected function discardLabelRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1421,6 +1448,15 @@ protected function getCarrierPackageTypesRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1737,6 +1773,15 @@ protected function getCarriersRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -2105,6 +2150,15 @@ protected function getConsolidationRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -2446,6 +2500,15 @@ protected function getLabelRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -2810,6 +2873,15 @@ protected function getLabelByTrackingAndCarrierRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, diff --git a/src/Apis/MP/CA/InventoryApi.php b/src/Apis/MP/CA/InventoryApi.php index 90954152..f203cd5d 100644 --- a/src/Apis/MP/CA/InventoryApi.php +++ b/src/Apis/MP/CA/InventoryApi.php @@ -324,6 +324,15 @@ protected function getInventoryRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -657,6 +666,15 @@ protected function updateBulkInventoryRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -984,6 +1002,15 @@ protected function updateInventoryForAnItemCARequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, diff --git a/src/Apis/MP/CA/ItemsApi.php b/src/Apis/MP/CA/ItemsApi.php index da61a008..b9be6ff7 100644 --- a/src/Apis/MP/CA/ItemsApi.php +++ b/src/Apis/MP/CA/ItemsApi.php @@ -354,6 +354,15 @@ protected function bulkItemSetupCARequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -706,6 +715,15 @@ protected function getAllItemsRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1007,6 +1025,15 @@ protected function getAnItemRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1308,6 +1335,15 @@ protected function retireAnItemRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, diff --git a/src/Apis/MP/CA/OrdersApi.php b/src/Apis/MP/CA/OrdersApi.php index 4448e9a2..84e930dc 100644 --- a/src/Apis/MP/CA/OrdersApi.php +++ b/src/Apis/MP/CA/OrdersApi.php @@ -326,6 +326,15 @@ protected function acknowledgeOrdersCARequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -650,6 +659,15 @@ protected function cancelOrderLinesCARequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1116,6 +1134,15 @@ protected function getAllOrdersRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1468,6 +1495,15 @@ protected function getAllReleasedOrdersRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -1862,6 +1898,15 @@ protected function getAllWFSOrdersRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -2185,6 +2230,15 @@ protected function getAnOrderRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -2509,6 +2563,15 @@ protected function refundOrderLinesCARequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -2833,6 +2896,15 @@ protected function shippingUpdatesCARequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, diff --git a/src/Apis/MP/CA/PricesApi.php b/src/Apis/MP/CA/PricesApi.php index 3566a1ab..44d23595 100644 --- a/src/Apis/MP/CA/PricesApi.php +++ b/src/Apis/MP/CA/PricesApi.php @@ -352,6 +352,15 @@ protected function priceBulkUploadsRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -651,6 +660,15 @@ protected function updatePriceCARequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, diff --git a/src/Apis/MP/CA/PromotionsApi.php b/src/Apis/MP/CA/PromotionsApi.php index cdd1356b..f8e591f1 100644 --- a/src/Apis/MP/CA/PromotionsApi.php +++ b/src/Apis/MP/CA/PromotionsApi.php @@ -321,6 +321,15 @@ protected function getPromotionalPricesRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -654,6 +663,15 @@ protected function updateBulkPromotionalPriceRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, @@ -981,6 +999,15 @@ protected function updatePromotionalPricesCARequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, diff --git a/src/Apis/MP/CA/ReportsApi.php b/src/Apis/MP/CA/ReportsApi.php index 7a212a3b..7d5a63ac 100644 --- a/src/Apis/MP/CA/ReportsApi.php +++ b/src/Apis/MP/CA/ReportsApi.php @@ -340,6 +340,15 @@ protected function getItemReportRequest( } } + $channelTypeSchemeApiKey = $this->config->getApiKey('channelTypeScheme', [ + 'path' => $resourcePath, + 'method' => $method, + 'timestamp' => $defaultHeaders['WM_TIMESTAMP'], + ]); + if ($channelTypeSchemeApiKey !== null) { + $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeSchemeApiKey; + } + $signatureSchemeApiKey = $this->config->getApiKey('signatureScheme', [ 'path' => $resourcePath, 'method' => $method, diff --git a/src/Configuration.php b/src/Configuration.php index 1e4c16b6..80e24302 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -93,6 +93,13 @@ class Configuration */ protected string $consumerId; + /** + * The channel type to use in request headers + * + * @var string + */ + protected string $channelType; + /** * User agent of the HTTP request * @@ -332,6 +339,29 @@ public function getConsumerId(): string return $this->consumerId; } + /** + * Sets the channel type to use in request headers + * + * @param string $channelType The consumer ID + * + * @return $this + */ + public function setChannelType(string $channelType): static + { + $this->channelType = $channelType; + return $this; + } + + /** + * Gets the channel type to use in request headers + * + * @return string The channel type + */ + public function getChannelType(): string + { + return $this->channelType; + } + /** * Sets the host * @@ -467,7 +497,7 @@ public static function getTempFolderPath() protected function validateOptions(array $options): void { $validKeys = [ - 'clientId', 'clientSecret', 'country', 'accessToken', 'privateKey', 'consumerId' + 'clientId', 'clientSecret', 'country', 'accessToken', 'privateKey', 'consumerId', 'channelType' ]; $invalid = array_diff(array_keys($options), $validKeys); diff --git a/src/Enums/SecurityScheme.php b/src/Enums/SecurityScheme.php index 5fedf7c7..212920ed 100644 --- a/src/Enums/SecurityScheme.php +++ b/src/Enums/SecurityScheme.php @@ -5,8 +5,10 @@ // This is basically an enum, but since this library supports PHP 7.4 we can't use a literal enum final class SecurityScheme extends AbstractEnum { - public const BASIC = 'basicScheme'; public const ACCESS_TOKEN = 'accessTokenScheme'; - public const SIGNATURE = 'signatureScheme'; + public const BASIC = 'basicScheme'; + public const CHANNEL_TYPE = 'channelTypeScheme'; public const CONSUMER_ID = 'consumerIdScheme'; + public const MARKET = 'marketScheme'; + public const SIGNATURE = 'signatureScheme'; } diff --git a/utils/constants.php b/utils/constants.php index 5906ba4f..8ca95d28 100644 --- a/utils/constants.php +++ b/utils/constants.php @@ -15,8 +15,9 @@ const LOGFILE = __DIR__ . '/../generate.log'; const SCHEMA_FIXES_FILE = RESOURCE_DIR . '/schema-corrections.json'; -const BASIC_SCHEME_HEADER = 'Authorization'; const ACCESS_TOKEN_HEADER = 'WM_SEC.ACCESS_TOKEN'; const AUTH_SIG_HEADER = 'WM_SEC.AUTH_SIGNATURE'; +const BASIC_SCHEME_HEADER = 'Authorization'; +const CHANNEL_TYPE_HEADER = 'WM_CONSUMER.CHANNEL.TYPE'; const CONSUMER_ID_HEADER = 'WM_CONSUMER.ID'; const MARKET_HEADER = 'WM_MARKET'; diff --git a/utils/customize-schemas.php b/utils/customize-schemas.php index a6df278d..32a20550 100644 --- a/utils/customize-schemas.php +++ b/utils/customize-schemas.php @@ -44,15 +44,21 @@ function customizeSchema( $schema['info']['version'] = libVersion(); $allSecuritySchemes = [ + SecurityScheme::ACCESS_TOKEN => [ + 'type' => 'http', + 'scheme' => 'bearer', + 'description' => 'Header authentication with a Walmart access token, which is automatically generated using your Client ID and Client Secret. The token is valid for 15 minutes, and will be passed in the ' . ACCESS_TOKEN_HEADER . ' header', + ], SecurityScheme::BASIC => [ 'type' => 'http', 'scheme' => 'basic', 'description' => 'Basic authentication with a Walmart Client ID and Client Secret', ], - SecurityScheme::ACCESS_TOKEN => [ - 'type' => 'http', - 'scheme' => 'bearer', - 'description' => 'Header authentication with a Walmart access token, which is automatically generated using your Client ID and Client Secret. The token is valid for 15 minutes, and will be passed in the ' . ACCESS_TOKEN_HEADER . ' header', + SecurityScheme::CHANNEL_TYPE => [ + 'type' => 'apiKey', + 'in' => 'header', + 'name' => CHANNEL_TYPE_HEADER, + 'description' => 'Header authentication with your Walmart channel type, which is passed in the ' . CHANNEL_TYPE_HEADER . ' header. When using endpoints that require channel type authentication, you must pass the `channelType` option to the `Configuration` constructor.', ], SecurityScheme::CONSUMER_ID => [ 'type' => 'apiKey', @@ -90,26 +96,29 @@ function customizeSchema( // Update each operation's parameters and auth information foreach ($verb['parameters'] as $i => $parameter) { if ($parameter['in'] === 'header' && in_array($parameter['name'], $ignoreHeaders, true)) { - - // Apply all relevant security schemes to the endpoint - $schemeName = match ($parameter['name']) { - BASIC_SCHEME_HEADER => SecurityScheme::BASIC, - ACCESS_TOKEN_HEADER => SecurityScheme::ACCESS_TOKEN, - CONSUMER_ID_HEADER => SecurityScheme::CONSUMER_ID, - AUTH_SIG_HEADER => SecurityScheme::SIGNATURE, - default => false, - }; - if ($schemeName !== false) { - // The JSON structure we're using for the security objects implies that if there are - // multiple security schemes, they are ALL required. This AND relationship, rather than - // an OR relationship, is indicated by a small syntactical difference in the security key's - // JSON structure. See here for more info: https://swagger.io/docs/specification/authentication - $security[$schemeName] = []; - - // Track which security schemes have been used so we can add them to the overall schema - if (!in_array($schemeName, $usedSecuritySchemes, true)) { - $usedSecuritySchemes[] = $schemeName; - } + if (isset($parameter['required']) && $parameter['required']) { + // Apply all relevant security schemes to the endpoint + $schemeName = match ($parameter['name']) { + ACCESS_TOKEN_HEADER => SecurityScheme::ACCESS_TOKEN, + AUTH_SIG_HEADER => SecurityScheme::SIGNATURE, + BASIC_SCHEME_HEADER => SecurityScheme::BASIC, + CHANNEL_TYPE_HEADER => SecurityScheme::CHANNEL_TYPE, + CONSUMER_ID_HEADER => SecurityScheme::CONSUMER_ID, + default => false, + }; + + if ($schemeName !== false) { + // The JSON structure we're using for the security objects implies that if there are + // multiple security schemes, they are ALL required. This AND relationship, rather than + // an OR relationship, is indicated by a small syntactical difference in the security key's + // JSON structure. See here for more info: https://swagger.io/docs/specification/authentication + $security[$schemeName] = []; + + // Track which security schemes have been used so we can add them to the overall schema + if (!in_array($schemeName, $usedSecuritySchemes, true)) { + $usedSecuritySchemes[] = $schemeName; + } + } } unset($verb['parameters'][$i]); diff --git a/utils/generate-apis.php b/utils/generate-apis.php index 33b79233..ca928c50 100644 --- a/utils/generate-apis.php +++ b/utils/generate-apis.php @@ -19,7 +19,9 @@ function generateApis(array $categories, array $countries, array $apiCodes): voi $schemas = schemas($categories, $countries, $apiCodes); foreach ($schemas as $schema) { + echo "Generating SDK for {$schema['api']['name']} in category {$schema['category']}/country {$schema['country']}..."; openApiGenerator($schema['api']['code'], $schema['api']['name'], $schema['category'], $schema['country']); + echo "done\n"; } generateSupportingFiles();