My Products
Help
KonsultVn
CHAMPION ***

Error when updating paymentmethod on suppliers

by KonsultVn

Hi,

 

We have an issue with updating the PaymentMethodId, AccountUsedForPayment and the SupplierPaymentMethodDetails. As an example we have a supplier that already has PaymentMethodId = 01, AccountUsedForPayment = Bank transfer (Bankgiro in swedish) and a giro number in the payment method details. If we then try to update this supplier with a new PaymentMethodId, lets say 04, and AccountUsedForPayment to IBAN and set new SupplierPaymentMethodDetails, we get an error saying that the giro number doesn't exist. Why do we get this error and shouldn't it be possible to change all this information at once?

 

5 REPLIES 5
Accepted solution
Yıldırım
VISMA

by Yıldırım

Hello, 

 

since updating the payment method forces "PaymentMethod-ScreenId=CA204000" related fields to be updated accordingly in the Supplier Card(as it can be seen in the UI), we should first update the Payment Method, then we can set the value of the connected SupplierPaymentDetails in the consecutive PUT request. 

1) PUT

{
    "paymentMethodId": {
        "value": "01"
    },
    "cashAccount": {
        "value": "1930"
    },
    "accountUsedForPayment": {
        "value": "BANKGIRO"
    },

    "attributeLines": [
        {
            "attributeId": {
                "value": "MOMSKAT"
            },
            "attributeValue": {
                "value": "40"
            }
        }
    ]
}

 

2) PUT - SupplierPaymentMethodDetails

{
    "supplierPaymentMethodDetails": [{
        "paymentMethodDetailDescription": "BANKGIRO",
        "paymentMethodDetailValue": {
            "value": "1234-1234"
        }
    }]
}
KonsultVn
CHAMPION ***

by KonsultVn

Okay, then it was as I suspected.

Thank you!

KonsultVn
CHAMPION ***

by KonsultVn

And we aren't sending any other requests other than the update request with this type of content.

KonsultVn
CHAMPION ***

by KonsultVn

Hi,

 

This is an example of how the request can look lite that we send to visma:

{
    "name":{"value":"TEST"},
    "status":{"value":"Active"},
    "supplierClassId":{"value":"10"},
    "creditTermsId":{"value":"30"},
    "currencyId":{"value":"SEK"},
    "paymentMethodId":{"value":"01"},
    "cashAccount":{"value":"1930"},
    "vatRegistrationId":{},
    "corporateId":{},
    "vatZoneId":{"value":"01"},
    "accountUsedForPayment":{"value":"BANKGIRO"},
    "mainAddress":{
        "value":{
            "addressLine1":{},
            "addressLine2":{},
            "addressLine3":{},
            "postalCode":{},
            "city":{},
            "countryId":{"value":"SE"}
        }
    },
    "supplierPaymentMethodDetails":
    [
        {
            "paymentMethodDetailDescription":"Bankgironummer",
            "paymentMethodDetailValue":{"value":"1234-1234"}
        },
        {
            "paymentMethodDetailDescription":"Plusgironummer",
            "paymentMethodDetailValue":{}
        }
    ],
    "attributeLines":
    [
        {
            "attributeId":{"value":"MOMSKAT"},
            "attributeValue":{"value":"40"}
        }
    ]
}
 
We don't have any issues with creating or updating suppliers otherwise. We only have issues when we try to change the payment method.

by Yıldırım (Updated ‎31-08-2022 11:32 by Yıldırım VISMA )

Hello, 

 

please share the used JSON and specify the transaction steps (if there are any additional requests), so we can check the scenario to be able to confirm whether there is any issue.

 

Thanks.