amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
612 stars 739 forks source link

[BUG] financesV0.json - FinancialEventGroups missing MarketplaceName #956

Closed gregoks closed 2 years ago

gregoks commented 3 years ago

FinancialEventGroupList (/finances/v0/financialEventGroups) response object doesnt have MarketplaceName:

"FinancialEventGroup": {
      "description": "Information related to a financial event group.",
      "type": "object",
      "properties": {
        "FinancialEventGroupId": {
          "description": "A unique identifier for the financial event group.",
          "type": "string"
        },
        "ProcessingStatus": {
          "description": "The processing status of the financial event group indicates whether the balance of the financial event group is settled.\n\nPossible values:\n\n* Open\n\n* Closed",
          "type": "string"
        },
        "FundTransferStatus": {
          "description": "The status of the fund transfer.",
          "type": "string"
        },
        "OriginalTotal": {
          "description": "The total amount in the currency of the marketplace in which the transactions occurred.",
          "$ref": "#/definitions/Currency"
        },
        "ConvertedTotal": {
          "description": "The total amount in the currency of the marketplace in which the funds were disbursed.",
          "$ref": "#/definitions/Currency"
        },
        "FundTransferDate": {
          "description": "The date and time when the disbursement or charge was initiated. Only present for closed settlements. In ISO 8601 date time format.",
          "$ref": "#/definitions/Date"
        },
        "TraceId": {
          "description": "The trace identifier used by sellers to look up transactions externally.",
          "type": "string"
        },
        "AccountTail": {
          "description": "The account tail of the payment instrument.",
          "type": "string"
        },
        "BeginningBalance": {
          "description": "The balance at the beginning of the settlement period.",
          "$ref": "#/definitions/Currency"
        },
        "FinancialEventGroupStart": {
          "description": "The date and time at which the financial event group is opened. In ISO 8601 date time format.",
          "$ref": "#/definitions/Date"
        },
        "FinancialEventGroupEnd": {
          "description": "The date and time at which the financial event group is closed. In ISO 8601 date time format.",
          "$ref": "#/definitions/Date"
        }
      }
    }

If we want to know from which marketplace the financial event group came from, we need to call FinancialEvents API (/finances/v0/financialEventGroups/{eventGroupId}/financialEvents) by a given FinancialEventGroupdId and make assumption that a marketplace that appears in the shipment event is also the same marketplace of the financial event group:

"ShipmentEvent": {
      "description": "A shipment, refund, guarantee claim, or chargeback.",
      "type": "object",
      "properties": {
        "AmazonOrderId": {
          "description": "An Amazon-defined identifier for an order.",
          "type": "string"
        },
        "SellerOrderId": {
          "description": "A seller-defined identifier for an order.",
          "type": "string"
        },
        **"MarketplaceName": {
          "description": "The name of the marketplace where the event occurred.",
          "type": "string"
        },**
        "OrderChargeList": {
          "description": "A list of order-level charges. These charges are applicable to Multi-Channel Fulfillment COD orders.",
          "$ref": "#/definitions/ChargeComponentList"
        },
        "OrderChargeAdjustmentList": {
          "description": "A list of order-level charge adjustments. These adjustments are applicable to Multi-Channel Fulfillment COD orders.",
          "$ref": "#/definitions/ChargeComponentList"
        },
        "ShipmentFeeList": {
          "description": "A list of shipment-level fees.",
          "$ref": "#/definitions/FeeComponentList"
        },
        "ShipmentFeeAdjustmentList": {
          "description": "A list of shipment-level fee adjustments.",
          "$ref": "#/definitions/FeeComponentList"
        },
        "OrderFeeList": {
          "description": "A list of order-level fees. These charges are applicable to Multi-Channel Fulfillment orders.",
          "$ref": "#/definitions/FeeComponentList"
        },
        "OrderFeeAdjustmentList": {
          "description": "A list of order-level fee adjustments. These adjustments are applicable to Multi-Channel Fulfillment orders.",
          "$ref": "#/definitions/FeeComponentList"
        },
        "DirectPaymentList": {
          "description": "A list of transactions where buyers pay Amazon through one of the credit cards offered by Amazon or where buyers pay a seller directly through COD.",
          "$ref": "#/definitions/DirectPaymentList"
        },
        "PostedDate": {
          "description": "The date and time when the financial event was posted.",
          "$ref": "#/definitions/Date"
        },
        "ShipmentItemList": {
          "$ref": "#/definitions/ShipmentItemList"
        },
        "ShipmentItemAdjustmentList": {
          "description": "A list of shipment item adjustments.",
          "$ref": "#/definitions/ShipmentItemList"
        }
      }
    }

Is there a reason why marketplaceName not part of the FinancialEventGroup object? is it possible to add it?

https://github.com/amzn/selling-partner-api-models/blob/main/models/finances-api-model/financesV0.json

llxdxwd commented 3 years ago

I have the same problem...

fernlop commented 3 years ago

This is the same as with the old MWS API. I had to get the single events for the group and get the marketplace from those single events. If there are only events that are not related to an order you can't get the marketplace. So this should be improved, but as i said, this has always been this way, its not SP-API related.

gregoks commented 3 years ago

Yes thats the only solution that I know of. There is also no option to filter specific marketplace in the request, its really frustrating to call financial events api for each financial event group especially because of the low throttling bucket for these api’s.

I wish Amazon could add the marketplace to the financial event groups api.

github-actions[bot] commented 2 years ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.