My Products
Help
Flashnode-developers
CONTRIBUTOR *

Creating payment error: the specified combination of the order type and order number cannot be found

by Flashnode-developers

I don't get it, the orderNumber and the orderType are in the system

 

Screenshot 2023-01-11 at 15.11.16.png

 And this is the payload I am using with endpoint /API/controller/api/v1/customerPayment

{
"type": {
"value": "Payment"
},
"hold": {
"value": true
},
"customer": {
"value": "10001"
},
"paymentMethod": {
"value": "Paytrail"
},
"currency": {
"value": "EUR"
},
"paymentAmount": {
"value": 99
},
"invoiceText": {
"value": "invoicetext"
},

"ordersToApply": [
{
"operation": "Insert",
"orderType": {
"value": "SO"
},
"orderNumber": {
"value": "005230"
},
"appliedToOrder": {
"value": 99
}
}
]
4 REPLIES 4
Yıldırım
VISMA

by Yıldırım (Updated ‎11-01-2023 15:45 by Yıldırım VISMA )

Hi, the most convenient way to troubleshoot this operation is trying the same process in the Financials ERP UI so that you can review if the order is available for the payment in the look-up table. 


There are certain workflow logics in the Financials ERP,
E.g Customer Payment > OrdersToApply can fetch the document before SO is invoiced. 
Customer payments.jpg

Flashnode-developers
CONTRIBUTOR *

Ok now I got the Customer payment via UI to work. I sorted out some errors and seem to be stuck on the same issue basically as before.

 

I try adding the payment, error says: 

Error: 'Cash account' cannot be empty.

Even it is not empty anymore. The account does exist as I took the example data from the payment I created via UI...

 

This is the payload

{
"type": {
"value": "Payment"
},
"hold": {
"value": true
},
"customer": {
"value": "10012"
},
"paymentMethod": {
"value": "Paytrail"
},
"cashAccount": {
"value": "1910"
},
"currency": {
"value": "EUR"
},
"paymentAmount": {
"value": 122,76
},
"invoiceText": {
"value": "invoicetext"
},

"ordersToApply": [
{
"operation": "Insert",
"orderType": {
"value": "SO"
},
"orderNumber": {
"value": "005230"
},
"appliedToOrder": {
"value": 122,76
}
}
]
}

  

Accepted solution
Yıldırım
VISMA

by Yıldırım (Updated ‎16-01-2023 12:46 by Yıldırım VISMA )

Hi, 

 

Please correct the syntax in your payload by replacing "," with "."

  "paymentAmount": {
"value": 122,76
},

 

 

  "paymentAmount": {
    "value": 122.76
  },

 

 

Then please also try the transaction without 

  "paymentMethod": {
"value": "Paytrail"
},
"cashAccount": {
"value": "1910"
},

to see what default values system assigns. 

Flashnode-developers
CONTRIBUTOR *

Thanks, I don't really get it. I can't add payments to orders, they have to be invoices first? (I tried to add the payment manually on the order via UI but there was some other error I couldn't figure out what it meant.)