A partner in Xena can be used as a creditor, debtor and/or employee. The idea behind this is to avoid duplicate data and to give our customers a better overview of all of their business with a specific partner. If a partner is a creditor, it will have a customer context connected. If a partner is a debtor, it will have a supplier context connected. A partner can have more than one context. When you make a lookup on a specific partner, you will get info about the contexts associated.
This is important to understand when you create a new partner. If you use the default endpoint, the partner will be created without any contexts.
There are two ways to creating a partner. The first method requires two API calls. The second method can only create a customer or supplier but only requires one API call.
Create a basic partner without any customer or supplier context. See the full dto here:
https://github.com/EG-BRS/Xena.Contracts/blob/development/src/Xena.Contracts/Domain/PartnerDto.cs
This will create a new partner in Xena. In Xena, the partner can be converted to a customer, supplier or/and employee. If you want to add a context you can use the following endpoint.
Articles/lines are not added directly to the order but to an order task. One order can have several order tasks. The next step is to get the tasks and add articles to them.
First you need to find the order task that you want to add the article to. If CreateTask was true when you created the order then the order will have one task already. To find the Id of that order task you need to get the list of order tasks. You will get a PagedResultSet with a list of OrderTaskDTO in Entities property from the endpoint.
Now you are ready to add an article to the order task. To do this, you will need the id of the article and to create an order line. Here, we assume you got an article id. Start by creating a new order task line.
Id of the fiscal you want to create the partner in
DefaultDeliveryAddressId
string
Address
object
ReferenceUserId
integer
Attention
string
PartnerType
string
PhoneNumber
string
Note
string
GLNNumber
string
OrgNumber
string
SupplierId
integer
CustomerId
integer
ResourceId
integer
ContextType
string
ContextType_Customer or ContextType_Supplier
PartnerId
integer
Id of the partner
InvoiceEmail
string
The email that will be suggested when creating an invoice
CustomerTermsOfPaymentOffset
integer
Days or months the customer have to pay the invoice
CustomerTermsOfPaymentDueType
string
xena_cash, xena_nett, xena_running_month or xena_prepaid
SupplierTermsOfPaymentOffset
integer
Days or months on supplier payment terms
SupplierTermsOfPaymentDueType
string
xena_cash, xena_nett, xena_running_month or xena_prepaid
SendInvite
boolean
Leave this as false
Provider
integer
Leave this as null
ProviderId
integer
Leave this as null
PartnerType
string
xena_partnertype_person if the partner is a private customer.
xena_partnertype_company if the partner is a company.
Email
string
Customer mail
Attention
string
Partner att
OrgNumber
string
Company registration number (CVR in DK)
GLNNumber
string
Number used for electronic invoicing
Name
string
Partner name
PhoneNumber
string
Partner phone number
Street
string
Street
PlaceName
string
Place name
Zip
string
Postal code
City
string
City
CountryName
string
ISO countrycode (DK, NO, SE etc.)
IsCustomer
boolean
If this is True then a Customer context will be added to the partner
IsCupplier
boolean
If this is True then a Supplier context will be added to the partner.
InternalNote
string
Just the internal note.
CreateTask
boolean
If true an ordertask will be created.
OrderNumber
integer
This should be null. Only set this if you know what you are doing! This can be relevant if the order is born with a number in some other system (e.g. a webshop).
ProjectId
integer
Id of the assosiated project. Only relevant for users of the project module.
PartnerId
integer
Id of the Customer or Supplier on the order.
ContextType
string
Whether it should be a Sales order (ContextType_Customer) or Purchase order (ContextType_Supplier)
ShowDeactivated
boolean
Leave this as false
Page
integer
Page number
ForceNoPaging
boolean
If you set this as True then you will deactivate pageing
PageSize
integer
Page size
orderId
string
Internal order id
OrderId
integer
Id for the order you want to create an ordertask on