My Products
Help
adrianm
PARTNER

The email address must be specified if 'Send invoices by email' is activated

by adrianm

I receive the error message "The email address must be specified if 'Send invoices by email' is activated" when posting a new customer.

 

What email address is the message referring to? The only email address I can find on the customer is on the main contact and on the invoice contact and have tried both.

 

POST: https://integration.visma.net/API/controller/api/v1/customer
Headers: {
    Accept: application/json
    Authorization: <hidden>
    ipp-application-type: Visma.net Financials
    ipp-company-id: 2344883
    Content-Type: application/json; charset=utf-8
    Content-Length: 574
}
{
	"number": {
		"value": "408378"
	},
	"name": {
		"value": "CustomerName"
	},
	"overrideWithClassValues": true,
	"creditTermsId": {
		"value": "20"
	},
	"printInvoices": {
		"value": false
	},
	"acceptAutoInvoices": {
		"value": false
	},
	"sendInvoicesByEmail": {
		"value": true
	},
	"corporateId": {
		"value": "555555-5555"
	},
	"mainAddress": {
		"addressLine1": {
			"value": ""
		},
		"addressLine2": {
			"value": "Street Name 9"
		},
		"addressLine3": {
			"value": ""
		},
		"postalCode": {
			"value": "26538"
		},
		"city": {
			"value": "City"
		}
	},
	"mainContact": {
		"name": {
			"value": "CustomerName"
		},
		"attention": {
			"value": "Some Person"
		},
		"email": {
			"value": "some.person@companyname.com"
		}
	}
}

Response

Response: 500 Internal Server Error
Headers: {
    Strict-Transport-Security: max-age=31536000; includeSubDomains    Strict-Transport-Security: max-age=31536000; includeSubDomains
    ipp-request-id: 964686b4-32b6-460f-ae9f-9471aca20154
    X-Content-Type-Options: application/json
    Pragma: no-cache
    X-Handled-By: Acumatica-PX.Export/AuthenticationManagerModule
    Referrer-Policy: origin-when-cross-origin
    VnfInstanceId: ERP_SE_DEMO_0009
    X-XSS-Protection: 1;mode=block
    Connection: close
    Transfer-Encoding: chunked
    Cache-Control: no-cache
    Date: Tue, 09 Nov 2021 15:24:46 GMT
    Set-Cookie: <crumbs>;  path=/;  secure;  expires=Mon, 08-Nov-2021 15:24:45 GMT;  HttpOnly
    Server: Apache/2.4.25    Server: (Debian)
    Content-Type: application/json; charset=utf-8
    Expires: -1
}
{
"message": "VismaId: a9ea4e7f-5b04-4355-9b20-144e31d98cdf. Error inserting the customer. Error: Inserting  'Customer' record raised at least one error. Please review the errors.\r\nThe email address must be specified if 'Send invoices by email' is activated.\r\n"
}

 

3 REPLIES 3
adrianm
PARTNER

by adrianm

Ah, I missed that extra indirection. Thank you for a quick response.

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

We found a missing field in the mainContact and mainAddress, please try to send this JSON:

{
	"number": {
		"value": "408378"
	},
	"name": {
		"value": "CustomerName"
	},
	"overrideWithClassValues": true,
	"creditTermsId": {
		"value": "20"
	},
	"printInvoices": {
		"value": false
	},
	"acceptAutoInvoices": {
		"value": false
	},
	"sendInvoicesByEmail": {
		"value": true
	},
	"corporateId": {
		"value": "555555-5555"
	},
	 "mainAddress": {
        "value": {
            "addressLine1": {
                "value": ""
            },
            "addressLine2": {
                "value": "Street Name 9"
            },
            "addressLine3": {
                "value": ""
            },
            "postalCode": {
                "value": "0021"
            },
            "city": {
                "value": "City"
            }
        }
    },
    "mainContact": {
        "value": {
            "name": {
                "value": "CustomerNameNoEmail2"
            },
            "attention": {
                "value": "Some Person"
            },
            "email": {
                "value": "some.person@companyname.com"
            }
        }
    }
}

by Magnus Johnsen

Hi,

That email should be enough, we'll have a look at this and get back to you.