diff --git a/README.md b/README.md index 1cf88798..8b0c1e00 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,10 @@ $sellerConnector = SellingPartnerApi::seller(/* ... */); ```php $amazonWarehousingAndDistributionApi = $sellerConnector->amazonWarehousingAndDistributionV20240509(); ``` +* **App Integrations API (v2024-04-01)** ([docs](https://developer-docs.amazon.com/sp-api/docs/app-integrations-api-v2024-04-01-reference)) + ```php + $appIntegrationsApi = $sellerConnector->appIntegrationsV20240401(); + ``` * **Application Management API (v2023-11-30)** ([docs](https://developer-docs.amazon.com/sp-api/docs/application-management-api-v2023-11-30-reference)) ```php $applicationManagementApi = $sellerConnector->applicationManagementV20231130(); diff --git a/resources/apis.json b/resources/apis.json index 89a5c377..8e29c66d 100644 --- a/resources/apis.json +++ b/resources/apis.json @@ -9,6 +9,15 @@ } ] }, + "app-integrations": { + "name": "App Integrations", + "versions": [ + { + "version": "2024-04-01", + "url": "https://raw.githubusercontent.com/amzn/selling-partner-api-models/refs/heads/main/models/application-integrations-api-model/appIntegrations-2024-04-01.json" + } + ] + }, "application-management": { "name": "Application Management", "versions": [ diff --git a/resources/models/raw/seller/app-integrations/v2024-04-01.json b/resources/models/raw/seller/app-integrations/v2024-04-01.json new file mode 100644 index 00000000..8de25c1c --- /dev/null +++ b/resources/models/raw/seller/app-integrations/v2024-04-01.json @@ -0,0 +1,968 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "The Selling Partner API for third party application integrations.", + "description": "With the AppIntegrations API v2024-04-01, you can send notifications to Amazon Selling Partners and display the notifications in Seller Central.", + "contact": { + "name": "Selling Partner API Developer Support", + "url": "https://sellercentral.amazon.com/gp/mws/contactus.html" + }, + "license": { + "name": "Apache License 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + }, + "version": "2024-04-01" + }, + "servers": [ + { + "url": "https://sellingpartnerapi-na.amazon.com/" + } + ], + "paths": { + "/appIntegrations/2024-04-01/notifications": { + "post": { + "tags": [ + "appIntegrations" + ], + "description": "Create a notification for sellers in Seller Central.\n\n**Usage Plan:**\n\n| Rate (requests per second) | Burst |\n| ---- | ---- |\n| 1 | 5 |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "createNotification", + "requestBody": { + "description": "The request body for the `createNotification` operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateNotificationRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful creation of notification with the identifier captured in response.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateNotificationResponse" + }, + "example": { + "notificationId": "0cf25616-f68c-4eba-a5d3-6823b61506c0" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "body": { + "value": { + "templateId": "PRICE_CHANGE", + "marketplaceId": "ATVPDKIKX0DER", + "notificationParameters": {} + } + } + } + }, + "response": { + "notificationId": "0cf25616-f68c-4eba-a5d3-6823b61506c0" + } + } + ] + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "body": { + "value": { + "templateId": "BAD_TEMPLATE_ID", + "marketplaceId": "ATVPDKIKX0DER", + "notificationParameters": {} + } + } + } + }, + "response": { + "errors": [ + { + "code": "InvalidInput", + "message": "Invalid Template Identifier(templateId)", + "details": "'BAD_TEMPLATE_ID' is an invalid templateId" + } + ] + } + } + ] + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/appIntegrations/2024-04-01/notifications/deletion": { + "post": { + "tags": [ + "appIntegrations" + ], + "description": "Remove your application's notifications from the Appstore notifications dashboard.\n\n**Usage Plan:**\n\n| Rate (requests per second) | Burst |\n| ---- | ---- |\n| 1 | 5 |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "deleteNotifications", + "requestBody": { + "description": "The request body for the `deleteNotifications` operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteNotificationsRequest" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Successfully processed the deleteNotifications request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "example": { + "templateId": "PRICE_CHANGE", + "deletionReason": "INCORRECT_RECIPIENT" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "body": { + "value": { + "templateId": "PRICE_CHANGE", + "deletionReason": "INCORRECT_RECIPIENT" + } + } + } + } + } + ] + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "body": { + "value": { + "templateId": "PRICE_CHANGE_INVALID", + "deletionReason": "INCORRECT_RECIPIENT" + } + } + } + }, + "response": { + "errors": [ + { + "code": "InvalidInput", + "message": "Invalid Template Id(templateId)", + "details": "'PRICE_CHANGE_INVALID' is an invalid templateId" + } + ] + } + } + ] + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/appIntegrations/2024-04-01/notifications/{notificationId}/feedback": { + "post": { + "tags": [ + "appIntegrations" + ], + "description": "Records the seller's response to a notification.\n\n**Usage Plan:**\n\n| Rate (requests per second) | Burst |\n| ---- | ---- |\n| 1 | 5 |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "recordActionFeedback", + "parameters": [ + { + "name": "notificationId", + "in": "path", + "description": "A `notificationId` uniquely identifies a notification.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The request body for the `recordActionFeedback` operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecordActionFeedbackRequest" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Successfully processed the recordActionFeedback request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "example": { + "feedbackActionCode": "SELLER_ACTION_COMPLETED" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "notificationId": { + "value": "0cf25616-f68c-1234-a5d3-6823b61506c0" + }, + "body": { + "value": { + "feedbackActionCode": "SELLER_ACTION_COMPLETED" + } + } + } + }, + "response": {} + } + ] + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "notificationId": { + "value": "0cf25616-f68c-a5d3-6823b61506c0" + }, + "body": { + "value": { + "feedbackActionCode": "SELLER_ACTION_COMPLETED" + } + } + } + }, + "response": { + "errors": [ + { + "code": "InvalidInput", + "message": "Invalid notificationId", + "details": "'0cf25616-f68c-a5d3-6823b61506c0' is an invalid notificationId" + } + ] + } + } + ] + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + } + }, + "components": { + "schemas": { + "Error": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "An error code that identifies the type of error that occurred." + }, + "message": { + "type": "string", + "description": "A message that describes the error condition." + }, + "details": { + "type": "string", + "description": "Additional details that can help the caller understand or fix the issue." + } + }, + "description": "Error response returned when the request is unsuccessful." + }, + "ErrorList": { + "required": [ + "errors" + ], + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "Error response returned when the request is unsuccessful.", + "items": { + "$ref": "#/components/schemas/Error" + } + } + }, + "description": "A list of error responses returned when a request is unsuccessful." + }, + "CreateNotificationRequest": { + "required": [ + "notificationParameters", + "templateId" + ], + "type": "object", + "properties": { + "templateId": { + "type": "string", + "description": "The unique identifier of the notification template you used to onboard your application." + }, + "notificationParameters": { + "$ref": "#/components/schemas/NotificationParameters" + }, + "marketplaceId": { + "type": "string", + "description": "An encrypted marketplace identifier for the posted notification." + } + }, + "description": "The request for the `createNotification` operation.", + "example": { + "templateId": "PRICE_CHANGE", + "marketplaceId": "ATVPDKIKX0DER", + "notificationParameters": { + "priceValue": "200" + } + } + }, + "NotificationParameters": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "description": "The dynamic parameters required by the notification templated specified by `templateId`.", + "example": { + "priceValue": "200" + } + }, + "CreateNotificationResponse": { + "type": "object", + "properties": { + "notificationId": { + "type": "string", + "description": "The unique identifier assigned to each notification." + } + }, + "description": "The response for the `createNotification` operation." + }, + "DeleteNotificationsRequest": { + "required": [ + "deletionReason", + "templateId" + ], + "type": "object", + "properties": { + "templateId": { + "type": "string", + "description": "The unique identifier of the notification template you used to onboard your application." + }, + "deletionReason": { + "type": "string", + "description": "The unique identifier that maps each notification status to a reason code.", + "enum": [ + "INCORRECT_CONTENT", + "INCORRECT_RECIPIENT" + ], + "x-docgen-enum-table-extension": [ + { + "value": "INCORRECT_CONTENT", + "description": "The notification's content is recognized to be incorrect." + }, + { + "value": "INCORRECT_RECIPIENT", + "description": "The notification was sent to incorrect seller." + } + ] + } + }, + "description": "The request for the `deleteNotifications` operation.", + "example": { + "templateId": "PRICE_CHANGE", + "deletionReason": "INCORRECT_CONTENT" + } + }, + "RecordActionFeedbackRequest": { + "required": [ + "feedbackActionCode" + ], + "type": "object", + "properties": { + "feedbackActionCode": { + "type": "string", + "description": "The unique identifier for each notification status.", + "enum": [ + "SELLER_ACTION_COMPLETED" + ], + "x-docgen-enum-table-extension": [ + { + "value": "SELLER_ACTION_COMPLETED", + "description": "The seller completed the action attached to the posted notification." + } + ] + } + }, + "description": "The request for the `recordActionFeedback` operation.", + "example": { + "feedbackActionCode": "SELLER_ACTION_COMPLETED" + } + } + } + }, + "x-original-swagger-version": "2.0" +} \ No newline at end of file diff --git a/resources/models/seller/app-integrations/v2024-04-01.json b/resources/models/seller/app-integrations/v2024-04-01.json new file mode 100644 index 00000000..64784eac --- /dev/null +++ b/resources/models/seller/app-integrations/v2024-04-01.json @@ -0,0 +1,968 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "The Selling Partner API for third party application integrations.", + "description": "With the AppIntegrations API v2024-04-01, you can send notifications to Amazon Selling Partners and display the notifications in Seller Central.", + "contact": { + "name": "Selling Partner API Developer Support", + "url": "https://sellercentral.amazon.com/gp/mws/contactus.html" + }, + "license": { + "name": "Apache License 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + }, + "version": "2024-04-01" + }, + "servers": [ + { + "url": "https://sellingpartnerapi-na.amazon.com/" + } + ], + "paths": { + "/appIntegrations/2024-04-01/notifications": { + "post": { + "tags": [ + "AppIntegrationsV20240401" + ], + "description": "Create a notification for sellers in Seller Central.\n\n**Usage Plan:**\n\n| Rate (requests per second) | Burst |\n| ---- | ---- |\n| 1 | 5 |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "createNotification", + "requestBody": { + "description": "The request body for the `createNotification` operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateNotificationRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful creation of notification with the identifier captured in response.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateNotificationResponse" + }, + "example": { + "notificationId": "0cf25616-f68c-4eba-a5d3-6823b61506c0" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "body": { + "value": { + "templateId": "PRICE_CHANGE", + "marketplaceId": "ATVPDKIKX0DER", + "notificationParameters": {} + } + } + } + }, + "response": { + "notificationId": "0cf25616-f68c-4eba-a5d3-6823b61506c0" + } + } + ] + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "body": { + "value": { + "templateId": "BAD_TEMPLATE_ID", + "marketplaceId": "ATVPDKIKX0DER", + "notificationParameters": {} + } + } + } + }, + "response": { + "errors": [ + { + "code": "InvalidInput", + "message": "Invalid Template Identifier(templateId)", + "details": "'BAD_TEMPLATE_ID' is an invalid templateId" + } + ] + } + } + ] + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/appIntegrations/2024-04-01/notifications/deletion": { + "post": { + "tags": [ + "AppIntegrationsV20240401" + ], + "description": "Remove your application's notifications from the Appstore notifications dashboard.\n\n**Usage Plan:**\n\n| Rate (requests per second) | Burst |\n| ---- | ---- |\n| 1 | 5 |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "deleteNotifications", + "requestBody": { + "description": "The request body for the `deleteNotifications` operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteNotificationsRequest" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Successfully processed the deleteNotifications request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "example": { + "templateId": "PRICE_CHANGE", + "deletionReason": "INCORRECT_RECIPIENT" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "body": { + "value": { + "templateId": "PRICE_CHANGE", + "deletionReason": "INCORRECT_RECIPIENT" + } + } + } + } + } + ] + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "body": { + "value": { + "templateId": "PRICE_CHANGE_INVALID", + "deletionReason": "INCORRECT_RECIPIENT" + } + } + } + }, + "response": { + "errors": [ + { + "code": "InvalidInput", + "message": "Invalid Template Id(templateId)", + "details": "'PRICE_CHANGE_INVALID' is an invalid templateId" + } + ] + } + } + ] + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + }, + "/appIntegrations/2024-04-01/notifications/{notificationId}/feedback": { + "post": { + "tags": [ + "AppIntegrationsV20240401" + ], + "description": "Records the seller's response to a notification.\n\n**Usage Plan:**\n\n| Rate (requests per second) | Burst |\n| ---- | ---- |\n| 1 | 5 |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Sellers whose business demands require higher throughput may have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "recordActionFeedback", + "parameters": [ + { + "name": "notificationId", + "in": "path", + "description": "A `notificationId` uniquely identifies a notification.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The request body for the `recordActionFeedback` operation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecordActionFeedbackRequest" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Successfully processed the recordActionFeedback request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "example": { + "feedbackActionCode": "SELLER_ACTION_COMPLETED" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "notificationId": { + "value": "0cf25616-f68c-1234-a5d3-6823b61506c0" + }, + "body": { + "value": { + "feedbackActionCode": "SELLER_ACTION_COMPLETED" + } + } + } + }, + "response": {} + } + ] + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "notificationId": { + "value": "0cf25616-f68c-a5d3-6823b61506c0" + }, + "body": { + "value": { + "feedbackActionCode": "SELLER_ACTION_COMPLETED" + } + } + } + }, + "response": { + "errors": [ + { + "code": "InvalidInput", + "message": "Invalid notificationId", + "details": "'0cf25616-f68c-a5d3-6823b61506c0' is an invalid notificationId" + } + ] + } + } + ] + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + } + } + } + } + }, + "x-codegen-request-body-name": "body" + } + } + }, + "components": { + "schemas": { + "Error": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "An error code that identifies the type of error that occurred." + }, + "message": { + "type": "string", + "description": "A message that describes the error condition." + }, + "details": { + "type": "string", + "description": "Additional details that can help the caller understand or fix the issue." + } + }, + "description": "Error response returned when the request is unsuccessful." + }, + "ErrorList": { + "required": [ + "errors" + ], + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "Error response returned when the request is unsuccessful.", + "items": { + "$ref": "#/components/schemas/Error" + } + } + }, + "description": "A list of error responses returned when a request is unsuccessful." + }, + "CreateNotificationRequest": { + "required": [ + "notificationParameters", + "templateId" + ], + "type": "object", + "properties": { + "templateId": { + "type": "string", + "description": "The unique identifier of the notification template you used to onboard your application." + }, + "notificationParameters": { + "$ref": "#/components/schemas/NotificationParameters" + }, + "marketplaceId": { + "type": "string", + "description": "An encrypted marketplace identifier for the posted notification." + } + }, + "description": "The request for the `createNotification` operation.", + "example": { + "templateId": "PRICE_CHANGE", + "marketplaceId": "ATVPDKIKX0DER", + "notificationParameters": { + "priceValue": "200" + } + } + }, + "NotificationParameters": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "description": "The dynamic parameters required by the notification templated specified by `templateId`.", + "example": { + "priceValue": "200" + } + }, + "CreateNotificationResponse": { + "type": "object", + "properties": { + "notificationId": { + "type": "string", + "description": "The unique identifier assigned to each notification." + } + }, + "description": "The response for the `createNotification` operation." + }, + "DeleteNotificationsRequest": { + "required": [ + "deletionReason", + "templateId" + ], + "type": "object", + "properties": { + "templateId": { + "type": "string", + "description": "The unique identifier of the notification template you used to onboard your application." + }, + "deletionReason": { + "type": "string", + "description": "The unique identifier that maps each notification status to a reason code.", + "enum": [ + "INCORRECT_CONTENT", + "INCORRECT_RECIPIENT" + ], + "x-docgen-enum-table-extension": [ + { + "value": "INCORRECT_CONTENT", + "description": "The notification's content is recognized to be incorrect." + }, + { + "value": "INCORRECT_RECIPIENT", + "description": "The notification was sent to incorrect seller." + } + ] + } + }, + "description": "The request for the `deleteNotifications` operation.", + "example": { + "templateId": "PRICE_CHANGE", + "deletionReason": "INCORRECT_CONTENT" + } + }, + "RecordActionFeedbackRequest": { + "required": [ + "feedbackActionCode" + ], + "type": "object", + "properties": { + "feedbackActionCode": { + "type": "string", + "description": "The unique identifier for each notification status.", + "enum": [ + "SELLER_ACTION_COMPLETED" + ], + "x-docgen-enum-table-extension": [ + { + "value": "SELLER_ACTION_COMPLETED", + "description": "The seller completed the action attached to the posted notification." + } + ] + } + }, + "description": "The request for the `recordActionFeedback` operation.", + "example": { + "feedbackActionCode": "SELLER_ACTION_COMPLETED" + } + } + } + }, + "x-original-swagger-version": "2.0" +} \ No newline at end of file diff --git a/src/Seller/AppIntegrationsV20240401/Api.php b/src/Seller/AppIntegrationsV20240401/Api.php new file mode 100644 index 00000000..00d743f6 --- /dev/null +++ b/src/Seller/AppIntegrationsV20240401/Api.php @@ -0,0 +1,48 @@ +connector->send($request); + } + + /** + * @param DeleteNotificationsRequest $deleteNotificationsRequest The request for the `deleteNotifications` operation. + */ + public function deleteNotifications(DeleteNotificationsRequest $deleteNotificationsRequest): Response + { + $request = new DeleteNotifications($deleteNotificationsRequest); + + return $this->connector->send($request); + } + + /** + * @param string $notificationId A `notificationId` uniquely identifies a notification. + * @param RecordActionFeedbackRequest $recordActionFeedbackRequest The request for the `recordActionFeedback` operation. + */ + public function recordActionFeedback( + string $notificationId, + RecordActionFeedbackRequest $recordActionFeedbackRequest, + ): Response { + $request = new RecordActionFeedback($notificationId, $recordActionFeedbackRequest); + + return $this->connector->send($request); + } +} diff --git a/src/Seller/AppIntegrationsV20240401/Dto/CreateNotificationRequest.php b/src/Seller/AppIntegrationsV20240401/Dto/CreateNotificationRequest.php new file mode 100644 index 00000000..a7af43e9 --- /dev/null +++ b/src/Seller/AppIntegrationsV20240401/Dto/CreateNotificationRequest.php @@ -0,0 +1,27 @@ +status(); + $responseCls = match ($status) { + 200 => CreateNotificationResponse::class, + 400, 401, 403, 404, 413, 415, 429, 500, 503 => ErrorList::class, + default => throw new Exception("Unhandled response status: {$status}") + }; + + return $responseCls::deserialize($response->json()); + } + + public function defaultBody(): array + { + return $this->createNotificationRequest->toArray(); + } +} diff --git a/src/Seller/AppIntegrationsV20240401/Requests/DeleteNotifications.php b/src/Seller/AppIntegrationsV20240401/Requests/DeleteNotifications.php new file mode 100644 index 00000000..6d478035 --- /dev/null +++ b/src/Seller/AppIntegrationsV20240401/Requests/DeleteNotifications.php @@ -0,0 +1,60 @@ +status(); + $responseCls = match ($status) { + 204 => EmptyResponse::class, + 400, 413, 403, 404, 415, 429, 500, 503 => ErrorList::class, + default => throw new Exception("Unhandled response status: {$status}") + }; + + return $responseCls::deserialize($response->json()); + } + + public function defaultBody(): array + { + return $this->deleteNotificationsRequest->toArray(); + } +} diff --git a/src/Seller/AppIntegrationsV20240401/Requests/RecordActionFeedback.php b/src/Seller/AppIntegrationsV20240401/Requests/RecordActionFeedback.php new file mode 100644 index 00000000..cd561409 --- /dev/null +++ b/src/Seller/AppIntegrationsV20240401/Requests/RecordActionFeedback.php @@ -0,0 +1,62 @@ +notificationId}/feedback"; + } + + public function createDtoFromResponse(Response $response): EmptyResponse|ErrorList + { + $status = $response->status(); + $responseCls = match ($status) { + 204 => EmptyResponse::class, + 400, 413, 401, 403, 404, 415, 429, 500, 503 => ErrorList::class, + default => throw new Exception("Unhandled response status: {$status}") + }; + + return $responseCls::deserialize($response->json()); + } + + public function defaultBody(): array + { + return $this->recordActionFeedbackRequest->toArray(); + } +} diff --git a/src/Seller/AppIntegrationsV20240401/Responses/CreateNotificationResponse.php b/src/Seller/AppIntegrationsV20240401/Responses/CreateNotificationResponse.php new file mode 100644 index 00000000..9bc0a1e9 --- /dev/null +++ b/src/Seller/AppIntegrationsV20240401/Responses/CreateNotificationResponse.php @@ -0,0 +1,23 @@ + Error::class]; + + /** + * @param Error[] $errors Error response returned when the request is unsuccessful. + */ + public function __construct( + public readonly array $errors, + ) {} +} diff --git a/src/Seller/SellerConnector.php b/src/Seller/SellerConnector.php index 1329a2ab..e628ca58 100644 --- a/src/Seller/SellerConnector.php +++ b/src/Seller/SellerConnector.php @@ -14,6 +14,16 @@ public function amazonWarehousingAndDistributionV20240509(): AmazonWarehousingAn return new AmazonWarehousingAndDistributionV20240509\Api($this); } + public function appIntegrationsV20240401(): AppIntegrationsV20240401\Api + { + return new AppIntegrationsV20240401\Api($this); + } + + public function applicationManagementV20231130(): ApplicationManagementV20231130\Api + { + return new ApplicationManagementV20231130\Api($this); + } + public function aPlusContentV20201101(): APlusContentV20201101\Api { return new APlusContentV20201101\Api($this);