Jump to content

Error creating Other Payment


 Share

Recommended Posts

Hello,

I am trying to create a Other Payment with several payment lines (concepts of the invoice in my case). Sending the payload below, I get the errors that you can find under the payload, related to fields that do not even appear in the POST Other Payment documentation (https://developer.sage.com/accounting/reference/payments/#tag/Other-Payments/operation/postOtherPayments). Any help is highly appreciated.

PAYLOAD

{
   "other_payment":{
      "transaction_type_id":"OTHER_PAYMENT",
      "date":"23/07/13",
      "total_amount":166.8,
      "payment_method_id":"CREDIT_DEBIT",
      "contact_id":"2e302e9dfc794f5197d8aa8781153aea",
      "bank_account_id":"8c16489b539c4e9590ec591284d118cd",
      "reference":"123123",
      "payment_lines":[
         {
            "ledger_account_id":"3607ff21f31b11edb4ce0693aa603842",
            "total_amount":10.0,
            "tax_rate_id":"ES_NO_TAX"
         },
         {
            "ledger_account_id":"3607ff21f31b11edb4ce0693aa603842",
            "total_amount":20.8,
            "tax_rate_id":"ES_LOWER_2"
         },
         {
            "ledger_account_id":"3607ff21f31b11edb4ce0693aa603842",
            "total_amount":31.5,
            "tax_rate_id":"ES_LOWER_3"
         },
         {
            "ledger_account_id":"3607ff21f31b11edb4ce0693aa603842",
            "total_amount":44.0,
            "tax_rate_id":"ES_LOWER_1"
         },
         {
            "ledger_account_id":"3607ff21f31b11edb4ce0693aa603842",
            "total_amount":60.5,
            "tax_rate_id":"ES_STANDARD"
         }
      ]
   }
}

 

ERRORS

[
   {
      "$severity":"error",
      "$dataCode":"RecordInvalid",
      "$message":"is not included in the list",
      "$source":"line_items.tax_rate"
   },
   {
      "$severity":"error",
      "$dataCode":"RecordInvalid",
      "$message":"This field must be zero before saving the record.",
      "$source":"left_to_allocate"
   }
]

Link to comment
Share on other sites

Hi Xavier,

The tax_rate_id ES _LOWER_3 is no longer valid in Spain. 

You can clarify if a tax_rate has expired or confirm the dates when it was in use by returning the percentages attribute in your request to tax_rates. The to_date returned for ES _LOWER_3 = 2023-12-31, if the transaction date provided was on this date or before, the tax_rate would have been valid.

GET https://api.accounting.sage.com/v3.1/tax_rates?attributes=percentages

{
            "id": "ES_LOWER_3",
            "displayed_as": "Reducido 5,00%",
            "$path": "/tax_rates/ES_LOWER_3",
            "percentages": [
                {
                    "percentage": "5.0",
                    "from_date": "2022-07-01",
                    "to_date": "2023-12-31"
                }
            ]
        },

Thanks

Mark

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...