Integrations & ERP Custom Fields / Business Central

Business Central®: Configuration

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:

  1. Registering your Application in Azure

  2. Configuring Business Central®

  3. Configuring 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:

  1. Log in to your Azure Portal account, navigate to Identity | Applications App registrations, and click New registration.
  2. 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.

    Delete

    Note

    To integrate Business Central® with YayPay, create a line-of-business application. Thus, for the Supported account types option, use single tenant registration in the Azure portal.


  3. 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:

  1. Navigate to the App registrations section and select your application.

  2. On the page that opens, click Authentication located under Manage on the left side of the page.

  3. On the page that opens, click Add a platform located under Platform configurations.

  4. On the Configure platforms panel that opens on the right hand side, select Web.

  5. 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.

  6. Navigate to the API permissions section, and in the panel that opens, click on the Dynamic 365 Business Centraloption to configure permissions.

  7. On the page that opens, select Delegated permissions.


  8. Click API permissions again and set Application permissions to Grant admin consent for {user}.

  9. 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:

  1. 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.

  2. On the page that opens, click New.
  3. 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.
  4. Assign the same user permissions as for the Azure user.

  5. Go back to the Microsoft Entra Applications page to ensure that the State field is set to Enabled.
  6. 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.

Delete

Note

For more details, see also the following articles on the Microsoft® website:


Creating Endpoints in Business Central®

To create an endpoint in Business Central:

  1. In your Business Central instance, navigate to the Web Services section and click Newat the top of the page.

  2. On the new row that appears, set Object Type to Page.

  3. For the new Page object, set Object ID to Customers. You can browse the list of object IDs using keywords.

  4. Define the Service Name field and check the Publish check box.

  5. Click the Reloadbutton located at the top of the page.

  6. 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
Delete

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
Email 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
Delete


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
Delete


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:

  1. Prepare your Business Central® environment.

    To learn how to do that, read the following instructions:
  2. Configure your API endpoints in Business Central®.

  3. 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:

  1. Log into your Business Central® on-premise application.

  2. In the list of server instances, select the one that you will use for the YayPay synchronization.

  3. Navigate to the General section and set Credential Type to AccessControlService(Office 365).

  4. Generate the web server access key:  
    1. 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.

    2. Use the User Name and Web Service Access Key (Basic Auth) fields to connect Odata and APIs in the following step..

  5. Navigate to the OData Servicessection and check the following check boxes:
    • Enable API Services 

    • Enable OData Services 


  6. Click Save to confirm your settings.

  7. 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.

  1. Log into YayPay.

  2. Navigate to Settings | Integrations and click on the Manage Business Systemsbutton located on the right side of the page.

  3. In the Manage Business Systems dialog that opens, select Business Central.

    Click SAVE to confirm the settings.

  4. 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.

  5. 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.

    Delete

    Warning

    This field is not used when integrating with the on-premise version of the Business Central application and becomes deactivated once the mapping file with an onPremBaseUrl object is specified.

    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.

  6. 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.

  7. Go to the LOGStab to see the details of the synchronization process.



Can't find what you need?

Contact our support team support@yaypay.com for help.