Currently, YayPay can import data from a Business Central® ERP System. However, there is not any capability for reverse payment integration from YayPay back to Business Central®.
Here we describe integrating your Business Central® and YayPay:
Registering YourApplication in Azure
See also:
Quickstart: Register an application with the Microsoft identity platform
This section explains the process of registering and configuring an Azure application. This is required before connecting Business Central® with YayPay.
To register a new application in the Azure portal:
- Log in to your Azure Portal account, navigate to Identity | Applications App registrations, and click New registration.
- On the page that opens, enter a display name for your application in the Name field, and select the Accounts in this organizational directory only (Single tenant) in the Supported account typesfield.
-
Click Register at the bottom of the page to complete the initial app registration.
When completed, the Overviewpage displays, providing basic information about your application.
To configure your application:
Navigate to the App registrations section and select your application.
On the page that opens, click Authentication located under Manage on the left side of the page.
- On the page that opens, click Add a platform located under Platform configurations.
- On the Configure platforms panel that opens on the right hand side, select Web.
-
On the page that opens, enter the redirect URI in the Redirect URIs field and click Configure.
This URI is where the Microsoft identity platform redirects a user's client and sends security tokens after authentication.
- Navigate to the API permissions section, and in the panel that opens, click on the Dynamic 365 Business Centraloption to configure permissions.
- On the page that opens, select Delegated permissions.
- Click API permissions again and set Application permissions to Grant admin consent for {user}.
- Navigate to the Certificates & secrets section and click New client secret to define the following:
Description – Describes the client secret.
Expires– Defines when the secret expires.
Copy and save the client secret value because it will be later masked and you cannot copy it.
After completing this process, see the Overview page of your application for all relevant information.
Save this information as you will need to use these values in the corresponding fields on the Business Central Connector Settings page in YayPay:
- Application (client) ID
- Certificates & secrets values
- Directory (tenant) ID
Configure Business Central®
This section describes how to configure both the online and on-premise Business Central® platforms before synchronizing them with YayPay.
Business Central® Online
This section summarizes how to configure your cloud Business Central® application before synchronizing it with YayPay.
To connect your application created in Azure to the Business Central® environment:
Log into your Business Central® account and use the Search icon in the top right corner of the page to search for add or Microsoft Entra Applications.
- On the page that opens, click New.
- On the page that opens, enter the value of the Application (client) ID field of your application registered in Azure into the Client ID field. You can find this information in the Overview section in the Azure portal. Also, add a short description of the application in the Description field.
Assign the same user permissions as for the Azure user.
- Go back to the Microsoft Entra Applications page to ensure that the State field is set to Enabled.
Configure Endpoints in Business Central®.
Configure Endpoints in Business Central®
See also:
The Business Central Admin Center API
Endpoints for the APIs for Dynamics 365 Business Central On-Premises and Online
This section describes how to create and configure endpoints in Business Central®.
In the Azure portal, go to App registrations. On the Overview page of your registered app, you will find the Endpoints section located above the app. After an app is registered and the Tenant ID value is generated, you will find the OAuth 2.0 base URL in this Endpoints section.
Additionally, see the Location section in Business Central Administration Center API. For the base URI, use https://api.businesscentral.dynamics.com/v2.0/<environment name>/api/v2.0.
Once a client has created an app in Azure to integrate with YayPay and connected it to their Business Central instance, they must expose the endpoints of their environment to the YayPay connector. This is essential for the YayPay connector to be able to synchronize data.
To achieve this, the client needs to create the necessary endpoints within their Business Central ERP system.
Creating Endpoints in Business Central®
To create an endpoint in Business Central:
- In your Business Central instance, navigate to the Web Services section and click Newat the top of the page.
- On the new row that appears, set Object Type to Page.
- For the new Page object, set Object ID to Customers. You can browse the list of object IDs using keywords.
-
Define the Service Name field and check the Publish check box.
- Click the Reloadbutton located at the top of the page.
As a result, you will find the updated URL in the OnData V4 URL column.
The above listed endpoints represent available fields that the connector can utilize to synchronize data. As the service name for these endpoints are entered by users, the connector will use the endpoints created by users. Users can navigate between these endpoints using the Object ID value.
For example, for a Customer object, there's a list of available endpoints. To use a specific endpoint required for the connector, enter the Object ID value of that endpoint.
See the following sections for a list of endpoints that you need to create in the Business Central environment for the YayPay connector to be able to work with your data.
Endpoints Configuration
For the connector to be able to work with the data, create the following endpoints in your Business Central environment.
Native Fields
Native Fields
Object ID | Object Name | Service Name to enter in the Business Central environment |
---|---|---|
6408 | workflowCustomers | ypBcCustomers |
30011 | APIV2 - Company Information | ypBcCompany |
30009 | APIV2 - Customers | ypBcContacts |
132 | Posted Sales Invoice | ypBcInvoiceBillToContact |
30012 | APIV2 - Sales Invoices | ypBcSalesInvoice |
20023 | paymentTerms | ypBcPaymentTerms |
483 | Currency Exchange Rates | ypBcExchangeRates |
526 | Posted Sales Invoice Lines | ypBcSalesInvoiceLines |
25 | Customer Ledger Entries | ypBcCustomerLedgerEntries |
573 | Detailed Customer Ledger Entries | ypBcDetailedCustLedgerEntries |
144 | Posted Sales Credit Memos | ypBcSalesCreditMemos |
9657 |
Customer Billing Contact |
ypBсdocLayouts |
Custom Fields
When configuring custom fields in YayPay, ensure that you include the object's name from your YayPay mapping in the Source Field Name field for both customer and invoice level custom fields. If you decide to customize the default Service Names value provided in the mapping, remember to substitute them before the field name
The following table lists native fields available for custom configuration of the CUSTOMER object.
Custom Fields: CUSTOMER
Tab name | Field on the tab | Source Field Name |
---|---|---|
General | Balance (LCY) | ypBcCustomers.balanceLcy |
Credit Limit (LCY) | ypBcCustomers.creditLimitLcy |
|
Blocked | ypBcCustomers.blocked |
|
Salesperson Code | ypBcCustomers.salespersonCode |
|
Responsibility Centre | ypBcCustomers.responsibilityCenter |
|
Document Sending Profile | ypBcCustomers.documentSendingProfile |
|
Last Date Modified | ypBcCustomers.lastDateModified |
|
Address & Contact | Address | ypBcCustomers.address |
Address 2 | ypBcCustomers.address2 |
|
Country/Region Code | ypBcCustomers.countryRegionCode |
|
City | ypBcCustomers.city |
|
Postcode | ypBcCustomers.postCode |
|
Phone No. | ypBcCustomers.phoneNumber |
|
ypBcCustomers.eMail |
||
Home Page | ypBcCustomers.homePage |
|
Contact Name | ypBcCustomers.contact |
|
Invoicing | VAT Registration No. | ypBcCustomers.vatRegistrationNumber |
Copy Sell-to Addr. to Qte From | ypBcCustomers.copySellToAddrToQteFrom |
|
Gen. Bus. Posting Group | ypBcCustomers.genBusPostingGroup |
|
Customer Posting Group | ypBcCustomers.vatBusPostingGroup |
|
Customer Price Group | ypBcCustomers.customerPriceGroup |
|
Customer Disc. Group | ypBcCustomers.customerDiscGroup |
|
Payments | Payment Terms Code | ypBcCustomers.paymentTermsCode |
Shipping | Location Code | ypBcCustomers.locationCode |
Combine Shipments | ypBcCustomers.combineShipments |
|
Reserve | ypBcCustomers.reserve |
|
Shipping Advice | ypBcCustomers.shippingAdvice |
|
Shipment Method: Code | ypBcCustomers.shipmentMethodCode |
|
Base Calendar Code | ypBcCustomers.baseCalendarCode |
The following table lists native fields available for custom configuration of the INVOICE object.
Custom Fields: INVOICE
Tab name | Field on the tab | Source Field Name |
---|---|---|
General | Posting Date | ypBcSalesInvoice.postingDate |
Due Date | ypBcSalesInvoice.dueDate |
|
Order No. | ypBcSalesInvoice.customerPurchaseOrderReference |
|
Cancelled | ypBcSalesInvoice.status |
|
Open | ypBcSalesInvoice.status |
|
Invoice Discount Amount Excl. VAT | ypBcSalesInvoice.discountAmount |
|
Total Excl. VAT | ypBcSalesInvoice.totalAmountExcludingTax |
|
Total VAT | ypBcSalesInvoice.totalTaxAmount |
|
Total Incl. VAT | ypBcSalesInvoice.totalAmountIncludingTax |
|
Invoice Details | Currency Code | ypBcSalesInvoice.currencyCode |
Department Code | ypBcSalesInvoice.shortcutDimension1Code |
|
Customergroup Code | ypBcSalesInvoice.shortcutDimension2Code |
|
Shipping and Billing | Ship-to: Address | ypBcSalesInvoice.shipToAddressLine1 |
Ship-to: Address 2 | ypBcSalesInvoice.shipToAddressLine2 |
|
Ship-to: Name | ypBcSalesInvoice.shipToName |
|
Ship-to: City | ypBcSalesInvoice.shipToCity |
|
Ship-to: Ship-to County | ypBcSalesInvoice.shipToState |
|
Ship-to: Country/Region | ypBcSalesInvoice.shipToCountry |
|
Ship-to: Postcode | ypBcSalesInvoice.shipToPostCode |
|
Ship-to: Contact | ypBcSalesInvoice.shipToContact |
|
Bill-to: Name | ypBcSalesInvoice.billToName |
Example
This example provides a sample JSON mapping for native fields. You can customize this sample to include the mapping for custom fields or make any necessary modifications.
{ "endpointMapping" : { "customersObject" : "ypBcCustomers", "contactsObject" : "ypBcContacts", "companyObject" : "ypBcCompany", "currencyExchangeRateObject" : "ypBcExchangeRates", "paymentTermObject" : "ypBcPaymentTerms", "postedSalesInvoiceObject" : "ypBcSalesInvoice", "postedSalesInvoiceLineObject" : "ypBcSalesInvoiceLines", "postedSalesCreditMemoObject" : "ypBcSalesCreditMemos", "customerLedgerEntriesObject" : "ypBcCustomerLedgerEntries", "detailedCustLedgerEntriesObject" : "ypBcDetailedCustLedgerEntries", "invoiceBillToContactObject" : "ypBcInvoiceBillToContact", "customerBillingContactObject": ypBсdocLayouts }, "dunsNumberCustomField" : null, "billingEmailCustomField" : null, "syncInvoicePdf" : false, "onPremBaseUrl" : null }
The highlighted array contains mandatory endpoints that must be configured for a successful synchronization.
The array below is reserved for configuring custom fields.
Business Central® On-Premise
This section summarizes how to configure your on-premise Business Central® application before synchronizing it with YayPay.
Prerequisites:
-
Prepare your Business Central® environment.
To learn how to do that, read the following instructions: Configure your API endpoints in Business Central®.
-
Enable access to the APIs.
To learn how to do that, read the following instructions:
When you complete the prerequisite steps, continue by configuring your Business Central® on-premise application:
Log into your Business Central® on-premise application.
In the list of server instances, select the one that you will use for the YayPay synchronization.
- Navigate to the General section and set Credential Type to AccessControlService(Office 365).
- Generate the web server access key:
- Go to the User Card page and generate the Web Service Access Key using the Web Service Access Key field.
When generated, use the web service access key as a password on the connector's Settings page in YayPay. Use the User Name and Web Service Access Key (Basic Auth) fields to connect Odata and APIs in the following step..
- Go to the User Card page and generate the Web Service Access Key using the Web Service Access Key field.
- Navigate to the OData Servicessection and check the following check boxes:
Enable API Services
Enable OData Services
Click Save to confirm your settings.
- Click Restart to restart your Business Central® server instance for the changes to take effect.
After completing the Business Central® configuration, proceed with the configuration on the connector's Settings page in YayPay.
Configure YayPay
This section explains how to configure YayPay to connect to your Business Central® system.
Log into YayPay.
- Navigate to Settings | Integrations and click on the Manage Business Systemsbutton located on the right side of the page.
- In the Manage Business Systems dialog that opens, select Business Central.
Click SAVE to confirm the settings.
On the Business Central Connector Settings panel that appears, download JSON mapping by clicking on the Download Current Mapping button. This mapping will be used by the connector to associate API endpoint names with the synchronizing entity types.
-
Specify the settings needed for the synchronization.
Depending on the version of Business Central, you will specify the following fields:Cloud On-premise Client ID Username Client Secret Web Service Access Key Directory (tenant) ID Server Instance Name The following fields are available on the Business Central Connector Settings panel:
Test Mode
If checked, it verifies the connection settings without importing real data.
This can be useful when setting up or configuring the connection for the first time, as any entered data is stored separately and will not impact real data in Business Central.
Upload File
Upload a JSON file containing the mapping fields for Business Central. If you do not upload a JSON mapping file, the connector will use the default mapping from the defaultCustomConfig.json file instead. This mapping is used by the connector to associate API endpoint names with the corresponding entity types for synchronization.
If you want to change the current mapping, click on Download Current Mapping, make the necessary edits to the mapping according to your needs, and then upload the updated mapping file back to YayPay.
Clicking on the Preview Mapping button will open the Mapping Preview dialog where you can review the currently used mapping.Client ID/Username
Enter the client ID of your Azure application or username for your on-premise application.
Company
Enter the name of your Azure application.
Environment (cloud)
Enter the client’s Business Central environment.
To locate the environment in the Cloud version of your Business Central, go to Information | Help & Support | Report a problem and look for the value next to Microsoft Entra tenant ID.
Client Secret/Web Service Access Key
Enter the client secret of your Azure application or the Web Service Access Key value for your on-premise application.
Directory (tenant) ID/Server Instance Name
Enter the directory (tenant) ID of your Azure application or server instance name of your on-premise application.
Step for Delta Sync
Optionally, enter a numerical value that will be used to divide the retrieved data into batches, based on a specific time period.
For example, if you enter 5 and select Month for Period, the sync will import data starting from 2015 and split it into batches of 5 months each.
Period
Select a time period used for the Step for Delta Sync option.
-
Click CONNECT and the Sync button to start the synchronization process.
After the first synchronization, the Last Sync Date value will be replaced with a date-time stamp, and other statuses will indicate that YayPay is still connected to your Business Central system.
- Go to the LOGStab to see the details of the synchronization process.