My Products
Help
Lindstromer
CONTRIBUTOR **

Customers created sometimes get invoice by email set to false

by Lindstromer

When creating customers to the endpoint below, it sometimes shows the customer with the checkbox "Skicka fakturor per e-post" (Send Invoices By Email in English UI I assume?).

 https://integration.visma.net/API/controller/api/v1/customer 

 

The JSON sent in the request looks somethine like below, the "sendInvoicesByEmail" is hardcoded to true in all cases. It seems random when the checkbox is selected or not.

 

{
   "name":{
      "value":"Name Namesson"
   },
   "corporateId":{
      "value":"20000101-1234"
   },
   "mainAddress":{
      "value":{
         "addressLine1":{
            "value":"c/o Name Namesson"
         },
         "addressLine2":{
            "value":"Street 123"
         },
         "postalCode":{
            "value":"12345"
         },
         "city":{
            "value":"City"
         },
         "countryId":{
            "value":"se"
         }
      }
   },
   "mainContact":{
      "value":{
         "name":{
            "value":"Name Namesson"
         },
         "email":{
            "value":"name.namesson@email.se"
         },
         "phone_1":{
            "value":"070-123 45 67"
         }
      }
   },
   "invoiceAddress":{
      "value":{
         "addressLine1":{
            "value":"c/o Name Namesson"
         },
         "addressLine2":{
            "value":"Street 123"
         },
         "postalCode":{
            "value":"12345"
         },
         "city":{
            "value":"City"
         },
         "countryId":{
            "value":"se"
         }
      }
   },
   "invoiceContact":{
      "value":{
         "name":{
            "value":"Name Namesson"
         },
         "email":{
            "value":"name.namesson@email.se"
         },
         "phone_1":{
            "value":"070-123 45 67"
         }
      }
   },
   "deliveryAddress":{
      "value":{
         "addressLine1":{
            "value":"Name Namesson"
         },
         "addressLine2":{
            "value":"Street 123"
         },
         "postalCode":{
            "value":"12345"
         },
         "city":{
            "value":"City"
         },
         "countryId":{
            "value":"se"
         }
      }
   },
   "deliveryContact":{
      "value":{
         "addressLine1":{
            "value":"c/o Name Namesson"
         },
         "addressLine2":{
            "value":"Street 123"
         },
         "postalCode":{
            "value":"12345"
         },
         "city":{
            "value":"City"
         },
         "countryId":{
            "value":"se"
         }
      }
   },
   "location":{
      "countryId":"se"
   },
   "currencyId":{
      "value":"SEK"
   },
   "sendInvoicesByEmail":{
      "value":true
   },
   "attributeLines":[
      {
         "attributeId":{
            "value":"AR100"
         },
         "attributeValue":{
            "value":"name.namesson@email.se"
         }
      },
      {
         "attributeId":{
            "value":"AR101"
         },
         "attributeValue":{
            "value":"name2.namesson2@email.se"
         }
      }
   ]
}

 

Examples in the UI:

https://pasteboard.co/ZW7h5OUBO7Q9.png 

https://pasteboard.co/HYFU7u8JQ5qj.png 

 

 

 

 

3 REPLIES 3
Yıldırım
VISMA

by Yıldırım

Hello Lind, this can be related to 

 

a) Customer Class Override

Customer classes.jpg

 

b) Missing email address on the customer card

Customers.jpg

Lindstromer
CONTRIBUTOR **

by Lindstromer

Hi. Yes, the issue is that the customers have email addresses but sometimes it doesn't check the send invoice by email checkbox, even with that value hardcoded to true in the integration. 😅

 

It ends up looking like in the attached image, where some have the e-mail invoice button checked, and some don't. All have the email address and it seems valid, I can manually save them again with "send invoice by email" checked. 😊

 

https://i.postimg.cc/fyPgR9FS/Screenshot-2023-05-23-at-12-25-26.png 

Yıldırım
VISMA

by Yıldırım

Unfortunately I don't have idea atm why some of them are not checked even though payload contains 

 "sendInvoicesByEmail":{
      "value":true
   },

so next time please keep an eye on the specific instance and store the payload and check that customerCard in the UI. Perhaps you can try sending PUT request to try updating that value to see whether it helps.