Litiun Connect organization addresses

Hi,

I’m helping a customer import Organizations through Litium Connect 2.0 (litium 7.6.1).
After fixing some other issues in the json payload… I get stuck on addresses

Documentation here: Api

When I add more than one address in the list, it fails to import.

This works:

			        "addresses": [
        				{
        					"id": "30927-Billing",
        					"firstName": "xxxxxx/xxx",
        					"lastName": "xxxxx",
        					"address1": "xxxxx 9",
        					"city": "xxxxx",
        					"country": "NO",
        					"email": "xxx@xxx.no",
        					"fax": "12 34 45 78",
        					"phone": "12 34 56 78",
        					"zip": "1234",
        					"type": "Billing"
        				}
        			]

This does not

			"addresses": [
				{
					"id": "30927-Billing",
					"firstName": "xxxxxx/xxx",
					"lastName": "xxxxx",
					"address1": "xxxxx 9",
					"city": "xxxxx",
					"country": "NO",
					"email": "xxx@xxx.no",
					"fax": "12 34 45 78",
					"phone": "12 34 56 78",
					"zip": "1234",
					"type": "Billing"
				},
				{
					"id": "30927-Delivery",
					"firstName": "xxxxxx/xxx",
					"lastName": "xxxxx",
					"address1": "xxxxx 9",
					"city": "xxxxx",
					"country": "NO",
					"email": "xxx@xxx.no",
					"fax": "12 34 45 78",
					"phone": "12 34 56 78",
					"zip": "1234",
					"type": "Delivery"
				}
			]

Bug? Or are we missing something obvious?

    "errorMessage": "Unexpected character encountered while parsing value: s. Path '', line 0, position 0."

As we tested it seems you are using wrong AddressType.
It should be Shipping and not Delivery.

Documentation.

Create and update addresses. The adresses are included with the organizations or persons when importing them. The address types must match the address types in Litium. It is possible to define an address type mapping in *OrganizationSettings* or *PersonSetting* when importing organizations or persons.

Code we used:

"organizationSettings": 
    {
        "vatRegistrationNumberFieldDefinitionId":"VatRegistrationNumber",
        "legalRegistrationNumberFieldDefinitionId":"LegalRegistrationNumber",
        "fieldTemplateId":"OrganizationTemplate",
        "addressTypeMapping": {
            "billing":"billing",
            "BillingAndShipping":"billinganddelivery",
            "shipping":"delivery"
        }
    },
1 Like

Thanks, i could not figure out how addressTypeMapping worked from the documentation.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.