Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸŽ‰ Source Amazon Seller Partner: add FBA Reimbursement Report stream #23605

Merged
merged 16 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
- name: Amazon Seller Partner
sourceDefinitionId: e55879a8-0ef8-4557-abcf-ab34c53ec460
dockerRepository: airbyte/source-amazon-seller-partner
dockerImageTag: 1.0.1
dockerImageTag: 1.1.0
sourceType: api
documentationUrl: https://docs.airbyte.com/integrations/sources/amazon-seller-partner
icon: amazonsellerpartner.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@
type: "string"
path_in_connector_config:
- "client_secret"
- dockerImage: "airbyte/source-amazon-seller-partner:1.0.1"
- dockerImage: "airbyte/source-amazon-seller-partner:1.1.0"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/amazon-seller-partner"
changelogUrl: "https://docs.airbyte.com/integrations/sources/amazon-seller-partner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]


LABEL io.airbyte.version=1.0.1
LABEL io.airbyte.version=1.1.0
LABEL io.airbyte.name=airbyte/source-amazon-seller-partner
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ acceptance_tests:
bypass_reason: "no records"
- name: ListFinancialEvents
bypass_reason: "no records"
- name: GET_FBA_REIMBURSEMENTS_DATA
bypass_reason: "no records"
incremental:
tests:
- config_path: "secrets/config_old_data.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
"streams": [
{
"stream": {
"name": "GET_FBA_REIMBURSEMENTS_DATA",
"json_schema": {
"title": "FBA Reimbursements Data",
"description": "FBA Reimbursements Data Reports",
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"approval-date": {
"type": [
"null",
"string"
]
},
"reimbursement-id": {
"type": [
"null",
"string"
]
},
"case-id": {
"type": [
"null",
"string"
]
},
"amazon-order-id": {
"type": [
"null",
"string"
]
},
"reason": {
"type": [
"null",
"string"
]
},
"sku": {
"type": [
"null",
"string"
]
},
"fnsku": {
"type": [
"null",
"string"
]
},
"asin": {
"type": [
"null",
"string"
]
},
"product-name": {
"type": [
"null",
"string"
]
},
"condition": {
"type": [
"null",
"string"
]
},
"currency-unit": {
"type": [
"null",
"string"
]
},
"amount-per-unit": {
"type": [
"null",
"string"
]
},
"quantity-reimbursed-cash": {
"type": [
"null",
"string"
]
},
"amount-total": {
"type": [
"null",
"string"
]
},
"quantity-reimbursed-inventory": {
"type": [
"null",
"string"
]
},
"quantity-reimbursed-total": {
"type": [
"null",
"string"
]
},
"original-reimbursement-id": {
"type": [
"null",
"string"
]
},
"original-reimbursement-type": {
"type": [
"null",
"string"
]
}
}
},
"supported_sync_modes": [
"full_refresh"
]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"title" : "FBA Reimbursements Data",
"description" : "FBA Reimbursements Data Reports",
"type" : "object",
"$schema" : "http://json-schema.org/draft-07/schema#",
"additionalProperties": true,
"properties" : {
"approval-date": {
"type": [
"null",
"string"
]
},
"reimbursement-id": {
"type": [
"null",
"string"
]
},
"case-id": {
"type": [
"null",
"string"
]
},
"amazon-order-id": {
"type": [
"null",
"string"
]
},
"reason": {
"type": [
"null",
"string"
]
},
"sku": {
"type": [
"null",
"string"
]
},
"fnsku": {
"type": [
"null",
"string"
]
},
"asin": {
"type": [
"null",
"string"
]
},
"product-name": {
"type": [
"null",
"string"
]
},
"condition": {
"type": [
"null",
"string"
]
},
"currency-unit": {
"type": [
"null",
"string"
]
},
"amount-per-unit": {
"type": [
"null",
"string"
]
},
"quantity-reimbursed-cash": {
"type": [
"null",
"string"
]
},
"amount-total": {
"type": [
"null",
"string"
]
},
"quantity-reimbursed-inventory": {
"type": [
"null",
"string"
]
},
"quantity-reimbursed-total": {
"type": [
"null",
"string"
]
},
"original-reimbursement-id": {
"type": [
"null",
"string"
]
},
"original-reimbursement-type": {
"type": [
"null",
"string"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
FbaInventoryPlaningReport,
FbaMyiUnsuppressedInventoryReport,
FbaOrdersReports,
FbaReimbursementsReports,
FbaReplacementsReports,
FbaShipmentsReports,
FbaSnsForecastReport,
Expand Down Expand Up @@ -205,6 +206,7 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
FlatFileReturnsDataByReturnDate(**stream_kwargs),
FbaInventoryPlaningReport(**stream_kwargs),
LedgerSummaryViewReport(**stream_kwargs),
FbaReimbursementsReports(**stream_kwargs),
]

def spec(self, *args, **kwargs) -> ConnectorSpecification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1126,3 +1126,11 @@ def stream_slices(
params = {"nextToken": next_value}
if not next_value:
complete = True


class FbaReimbursementsReports(ReportsAmazonSPStream):
"""
Field definitions: https://sellercentral.amazon.com/help/hub/reference/G200732720
"""

name = "GET_FBA_REIMBURSEMENTS_DATA"
2 changes: 2 additions & 0 deletions docs/integrations/sources/amazon-seller-partner.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ This source is capable of syncing the following tables and their data:
- [Inventory Ledger Report - Detailed View](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference)
- [FBA Manage Inventory Health Report](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference)
- [Inventory Ledger Report - Summary View](https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-reference)
- [FBA Reimbursements Report](https://sellercentral.amazon.com/help/hub/reference/G200732720)

## Report options

Expand All @@ -123,6 +124,7 @@ So, for any value that exceeds the limit, the `period_in_days` will be automatic

| Version | Date | Pull Request | Subject |
|:---------|:-----------|:-----------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `1.1.0` | 2023-04-21 | [\#23605](https://github.com/airbytehq/airbyte/pull/23605) | Add FBA Reimbursement Report stream |
| `1.0.1` | 2023-03-15 | [\#24098](https://github.com/airbytehq/airbyte/pull/24098) | Add Belgium Marketplace |
| `1.0.0` | 2023-03-13 | [\#23980](https://github.com/airbytehq/airbyte/pull/23980) | Make `app_id` required. Increase `end_date` gap up to 5 minutes from now for Finance streams. Fix connection check failure when trying to connect to Amazon Vendor Central accounts |
| `0.2.33` | 2023-03-01 | [\#23606](https://github.com/airbytehq/airbyte/pull/23606) | Implement reportOptions for all missing reports and refactor |
Expand Down