-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- application integrations 2024-04-01 - finances 2024-06-19 - invoices 2024-06-19
- Loading branch information
1 parent
8295149
commit 56a5421
Showing
7 changed files
with
345 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# frozen_string_literal: true | ||
|
||
require "peddler/api" | ||
|
||
module Peddler | ||
class << self | ||
def application_integrations_2024_04_01(...) | ||
API::ApplicationIntegrations20240401.new(...) | ||
end | ||
end | ||
|
||
class API | ||
# The Selling Partner API for third party application integrations. | ||
# | ||
# With the AppIntegrations API v2024-04-01, you can send notifications to Amazon Selling Partners and display the | ||
# notifications in Seller Central. | ||
class ApplicationIntegrations20240401 < API | ||
# Create a notification for sellers in Seller Central. | ||
# | ||
# @note This operation can make a static sandbox call. | ||
# @param body [Hash] The request body for the `createNotification` operation. | ||
# @param rate_limit [Float] Requests per second | ||
# @return [Hash] The API response | ||
def create_notification(body, rate_limit: 1.0) | ||
path = "/appIntegrations/2024-04-01/notifications" | ||
|
||
meter(rate_limit).post(path, body:) | ||
end | ||
|
||
# Remove your application's notifications from the Appstore notifications dashboard. | ||
# | ||
# @note This operation can make a static sandbox call. | ||
# @param body [Hash] The request body for the `deleteNotifications` operation. | ||
# @param rate_limit [Float] Requests per second | ||
# @return [Hash] The API response | ||
def delete_notifications(body, rate_limit: 1.0) | ||
path = "/appIntegrations/2024-04-01/notifications/deletion" | ||
|
||
meter(rate_limit).post(path, body:) | ||
end | ||
|
||
# Records the seller's response to a notification. | ||
# | ||
# @note This operation can make a static sandbox call. | ||
# @param notification_id [String] A `notificationId` uniquely identifies a notification. | ||
# @param body [Hash] The request body for the `recordActionFeedback` operation. | ||
# @param rate_limit [Float] Requests per second | ||
# @return [Hash] The API response | ||
def record_action_feedback(notification_id, body, rate_limit: 1.0) | ||
path = "/appIntegrations/2024-04-01/notifications/#{notification_id}/feedback" | ||
|
||
meter(rate_limit).post(path, body:) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# frozen_string_literal: true | ||
|
||
require "peddler/api" | ||
|
||
module Peddler | ||
class << self | ||
def finances_2024_06_19(...) | ||
API::Finances20240619.new(...) | ||
end | ||
end | ||
|
||
class API | ||
# The Selling Partner API for Finances | ||
# | ||
# The Selling Partner API for Finances provides financial information relevant to a seller's business. You can | ||
# obtain financial events for a given order or date range without having to wait until a statement period closes. | ||
class Finances20240619 < API | ||
# Returns transactions for the given parameters. Orders from the last 48 hours might not be included in financial | ||
# events. | ||
# | ||
# @note This operation can make a static sandbox call. | ||
# @param posted_after [String] The response includes financial events posted after (or on) this date. This date | ||
# must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time | ||
# must be more than two minutes before the time of the request. | ||
# @param posted_before [String] The response includes financial events posted before (but not on) this date. This | ||
# date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The | ||
# date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If | ||
# `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes | ||
# before the time of the request. | ||
# @param marketplace_id [String] The ID of the marketplace from which you want to retrieve transactions. | ||
# @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified | ||
# `pageSize` value. To get the next page of results, call the operation with this token and include the same | ||
# arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` | ||
# is null. Note that this operation can return empty pages. | ||
# @param rate_limit [Float] Requests per second | ||
# @return [Hash] The API response | ||
def list_transactions(posted_after, posted_before: nil, marketplace_id: nil, next_token: nil, rate_limit: 0.5) | ||
path = "/finances/2024-06-19/transactions" | ||
params = { | ||
"postedAfter" => posted_after, | ||
"postedBefore" => posted_before, | ||
"marketplaceId" => marketplace_id, | ||
"nextToken" => next_token, | ||
}.compact | ||
|
||
meter(rate_limit).get(path, params:) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.