Endpoint:
/finances/2024-06-19/transactions
Model File:
finances_2024-06-19.json
Location:
#/definitions/ItemRelatedIdentifierName
Description:
The Finances API (v2024-06-19) returns "SETTLEMENT_ID" as a value for the itemRelatedIdentifierName field within the ItemRelatedIdentifier object. However, this value is missing from the enum definition in the official Swagger/OpenAPI model.
When using a strictly typed SDK (such as C# with Newtonsoft.Json), this causes a Deserialization Error, preventing the processing of any transaction batch that contains a settlement-related adjustment.
Stack Trace (Scrubbed)
C# Code
Custom Gem
C# Code said
This is a textbook case of a missing enum in a strictly typed SDK. Your log provides the "smoking gun" that Amazon’s production API is returning data that their own Swagger model doesn't account for.
I have scrubbed your local file paths and specific project names. Here is the clean, professional report you can use for the Amazon Selling Partner API GitHub Issues or a Seller Central Support Ticket.
Bug Report: Missing Enum "SETTLEMENT_ID" in Finances API v2024-06-19
Endpoint: /finances/2024-06-19/transactions
Model File: finances_2024-06-19.json
Location: #/definitions/ItemRelatedIdentifierName
Description
The Finances API (v2024-06-19) returns "SETTLEMENT_ID" as a value for the itemRelatedIdentifierName field within the ItemRelatedIdentifier object. However, this value is missing from the enum definition in the official Swagger/OpenAPI model.
When using a strictly typed SDK (such as C# with Newtonsoft.Json), this causes a Deserialization Error, preventing the processing of any transaction batch that contains a settlement-related adjustment.
Stack Trace (Scrubbed)
Plaintext
ERROR - Exception: ApiException: Error converting value "SETTLEMENT_ID" to type 'ItemRelatedIdentifierNameEnum'.
Path 'payload.transactions[57].items[0].relatedIdentifiers[1].itemRelatedIdentifierName'
at Client.ApiClient.Deserialize(RestResponse response, Type type)
at FinancesApi.ListTransactionsWithHttpInfo(...)
at Business.Amazon.FinancesMiner.HandleTransactions(...)
Evidence in Model
In the current finances_2024-06-19.json file, the enum is defined as follows:
"ItemRelatedIdentifierName": {
"type": "string",
"enum": [
"ORDER_ADJUSTMENT_ITEM_ID",
"COUPON_ID",
"REMOVAL_SHIPMENT_ITEM_ID",
"TRANSACTION_ID"
]
}
Expected:
The enum should include "SETTLEMENT_ID".
Impact:
Any SDK generated using this Swagger file (C#, Java, etc.) throws a Deserialization Exception when it encounters "SETTLEMENT_ID", making it impossible to process certain financial events.
Current Workaround
To maintain production stability, I have been forced to manually inject the missing enum value into the generated SDK code. However, this is not sustainable as it will be overwritten upon any subsequent client regeneration.
PS:
I can confirm this is also happening with INVOICE_ID. When processing transactions via the Finances v2024-06-19 API, I encountered a deserialization error because INVOICE_ID is being returned at the item level but is missing from the ItemRelatedIdentifierNameEnum definition.
Error log:
Error converting value "INVOICE_ID" to type 'ItemRelatedIdentifierNameEnum'. Path 'payload.transactions[x].items[0].relatedIdentifiers[0].itemRelatedIdentifierName'
Endpoint:
/finances/2024-06-19/transactions
Model File:
finances_2024-06-19.json
Location:
#/definitions/ItemRelatedIdentifierName
Description:
The Finances API (v2024-06-19) returns "SETTLEMENT_ID" as a value for the itemRelatedIdentifierName field within the ItemRelatedIdentifier object. However, this value is missing from the enum definition in the official Swagger/OpenAPI model.
When using a strictly typed SDK (such as C# with Newtonsoft.Json), this causes a Deserialization Error, preventing the processing of any transaction batch that contains a settlement-related adjustment.
Stack Trace (Scrubbed)
C# Code
Custom Gem
C# Code said
This is a textbook case of a missing enum in a strictly typed SDK. Your log provides the "smoking gun" that Amazon’s production API is returning data that their own Swagger model doesn't account for.
I have scrubbed your local file paths and specific project names. Here is the clean, professional report you can use for the Amazon Selling Partner API GitHub Issues or a Seller Central Support Ticket.
Bug Report: Missing Enum "SETTLEMENT_ID" in Finances API v2024-06-19
Endpoint: /finances/2024-06-19/transactions
Model File: finances_2024-06-19.json
Location: #/definitions/ItemRelatedIdentifierName
Description
The Finances API (v2024-06-19) returns "SETTLEMENT_ID" as a value for the itemRelatedIdentifierName field within the ItemRelatedIdentifier object. However, this value is missing from the enum definition in the official Swagger/OpenAPI model.
When using a strictly typed SDK (such as C# with Newtonsoft.Json), this causes a Deserialization Error, preventing the processing of any transaction batch that contains a settlement-related adjustment.
Stack Trace (Scrubbed)
Plaintext
ERROR - Exception: ApiException: Error converting value "SETTLEMENT_ID" to type 'ItemRelatedIdentifierNameEnum'.
Path 'payload.transactions[57].items[0].relatedIdentifiers[1].itemRelatedIdentifierName'
at Client.ApiClient.Deserialize(RestResponse response, Type type)
at FinancesApi.ListTransactionsWithHttpInfo(...)
at Business.Amazon.FinancesMiner.HandleTransactions(...)
Evidence in Model
Expected:
The enum should include "SETTLEMENT_ID".
Impact:
Any SDK generated using this Swagger file (C#, Java, etc.) throws a Deserialization Exception when it encounters "SETTLEMENT_ID", making it impossible to process certain financial events.
Current Workaround
To maintain production stability, I have been forced to manually inject the missing enum value into the generated SDK code. However, this is not sustainable as it will be overwritten upon any subsequent client regeneration.
PS:
I can confirm this is also happening with INVOICE_ID. When processing transactions via the Finances v2024-06-19 API, I encountered a deserialization error because INVOICE_ID is being returned at the item level but is missing from the ItemRelatedIdentifierNameEnum definition.
Error log:
Error converting value "INVOICE_ID" to type 'ItemRelatedIdentifierNameEnum'. Path 'payload.transactions[x].items[0].relatedIdentifiers[0].itemRelatedIdentifierName'