I have successfully created the customer and the response I am getting is this
{
'@odata.context': 'https://api.businesscentral.dynamics.com/v2.0/3d32adac-7e5f-408d-9a7c-58ceceab2992/Production/api/v2.0/$metadata#companies(b1f1d8e7-0569-ee11-8def-6045bd92d4b1)/customers/$entity',
'@odata.etag': 'W/"JzE5OzEwMDgyODYyMjQyODI3OTU1NzcxOzAwOyc="',
id: 'XXXYYYZZZ',
number: 'XXXYYYYZZZZ',
displayName: 'Skriware',
type: 'Company',
addressLine1: '',
addressLine2: '',
city: '',
state: '',
country: '',
postalCode: '',
phoneNumber: 'XXXYYYZZZZ',
email: '',
website: '',
salespersonCode: '',
balanceDue: 0,
creditLimit: 0,
taxLiable: false,
taxAreaId: '00000000-0000-0000-0000-000000000000',
taxAreaDisplayName: '',
taxRegistrationNumber: '',
currencyId: 'XXXXYYYYZZZZZ',
currencyCode: 'CAD',
paymentTermsId: 'XXXXYYYYYZZZZZ',
shipmentMethodId: '00000000-0000-0000-0000-000000000000',
paymentMethodId: '00000000-0000-0000-0000-000000000000',
blocked: '_x0020_',
lastModifiedDateTime: '2024-07-31T13:09:35.937Z'
}
But when I am trying to associate this customer in the sales post body
{
customerId: 'XXXYYYZZZZ',
currencyCode: 'EUR',
orderDate: '2024-07-31',
postingDate: '2024-07-31',
salesOrderLines: [
{
itemId: '0defc956-d7f8-ee11-a1ff-000d3a48a433',
lineType: 'Item',
lineObjectNumber: 'B.112',
description: 'Fable Explore 2.5 Educational Robot',
quantity: '1.00',
unitPrice: '637.00',
discountPercent: '0.00'
},
{
itemId: '0eefc956-d7f8-ee11-a1ff-000d3a48a433',
lineType: 'Item',
lineObjectNumber: 'B.113',
description: 'Fable Go 2.5 Educational Robot',
quantity: '1.00',
unitPrice: '637.00',
discountPercent: '0.00'
}
]
}
I am getting this error
error: {
code: 'Application_FieldValidationException',
message: 'D394 Partner type. must not be in Customer: No.=CI00088 CorrelationId: 26f438d2-a6ab-4a77-9af0-a068d2437dba.'
}
We are simply creating a customer without adding any partner type and then using that customer in our sales order
What is this error D394 Partner Type ? and how it is connected to customer ?