Merchant onboarding is the process of acquiring and verifying merchants for payment processing services, such as credit and debit card payments and other methods like Google Pay and Apple Pay. The process involves several steps to ensure ISVs and payment service providers who facilitate the boarding process comply with strict regulations, which can be cumbersome and time-consuming.
Merchant onboarding typically involves gathering information from the merchant, verifying their identity, assessing their risk profile, and setting up their account with a payment service provider. Once the merchant has been approved, the payment company provides them with the necessary tools and resources to start accepting payments, such as a payment terminal or software. However, ISVs can simplify and shorten this process by automating merchant onboarding. In this article, you'll learn how to onboard merchants using North's integration for Simplified Enrollment in Python.
Click through the interactive visualizer below to view details about the API calls that are used in the Simplified Enrollment flow.
Submit a completed application to Underwriting for review.
Prerequisites
Set up the following to complete this tutorial:
- A Python installation. You will be using Python version 3.11 or later. Run the command python --version to see the Python version number that you currently have.
- A virtual environment using env. You will need a virtual environment to create an isolated environment that contains all the necessary dependencies and libraries required for your demo application.
To create the user interface for your application, you will also need the following:
- Node.JS version 16 and above. Run node -v 1 to check your version.
- Node Package Manager (NPM) version 9.8+. Run npm -v to check which version you have.
You can find the complete source code for this tutorial on GitHub .
How To Onboard Merchants With Python
Set Up a Python Project
Create a new directory named Payments_Hub_Merchant_Onboarding_Demo. It will contain all your Python code.
Navigate to the Payments_Hub_Merchant_Onboarding_Demo directory and run the following command to create a virtual environment called payments_hub_merchant_onboarding_demo:
After creating the virtual environment, you need to activate it. On Windows, run the following command:
To activate the virtual environment on Linux or Mac, run this command:
Once the virtual environment is activated, install the requests package by running the following command:
Authentication
Before accessing the Merchant Boarding API, you must authenticate by calling the auth endpoint. Make a POST request and provide the following keys and values in the x-www-form-urlencoded format:
- grant_type: client_credentials
- scope: all
- client_id: your_client_id
- client_secret: your_client_secret
If your request is successful, you will receive a 200 OK success code and a bearer token that is valid for five minutes. You will need to include this bearer token in the headers of subsequent requests to the Merchant Boarding API in the format Bearer token.
In the payments_hub_merchant_onboarding_demo directory, create a file named get_oauth_token.py and add the following code to it:
Remember to replace your_client_id and your_client_secret with your actual values.
The code above calls the authentication endpoint, and if successful, it prints out an access token that you can use for subsequent calls to the Merchant Boarding API.
To execute the file, run the following command on the terminal from the root directory:
The successful output will look as follows:
The output is a JSON object with the following keys: access_token, expires_in, token_type, and scope. You will need to use the access_token on further API calls, but bear in mind that it expires after three hundred seconds, or five minutes.
Create a New North Application
After authenticating, call the Merchant Boarding API and create a new application. Before starting this new application, either create an application template or note the plan ID of an existing template.
For this tutorial, you will make a call to the Sandbox endpoint /enroll/application and provide the following mandatory fields: agent, applicationName, externalKey, and plan. The following fields are optional: shipping, principals, business, bankAccount, and epxHierarchy.
- agent: the agent or sales rep ID
- applicationName: string that can be used to identify the application
- externalKey: unique identifier for application
- plan: equipment plan object
- shipping: shipping information model
- principals: business principal object
- business: business object
- bankAccount: bank account object
- epxHierarchy: enrollment EPX customer hierarchy object
In the payments_hub_merchant_onboarding_demo directory, create a file called create_application.py and add the following code to it:
This code will create a new application.
Remember to replace PUT_YOUR_ACCESS_TOKEN_HERE with the valid bearer token that you received after running get_oauth.py. Also, replace PUT_YOUR_AGENT_ID_HERE and PUT_YOUR_PLAN_ID_HERE with your credentials. You can keep the values provided for principals, business, and bank_account_details or replace the values with the details you want to test with.
To execute the file, run the following command on the terminal from the root directory:
A successful request will return a 201 status code and details of the application you created. The status is success, which signifies that your application was successfully created.
If your request is not valid, you will receive a 400 Bad Request response, and if you use an invalid or expired token, you will receive a 401 Invalid authorization response.
Send the Application to the Merchant
After creating the application, the next step is to send it to the merchant for completion. In production, an email with a link to the application will be sent to the merchant. The endpoint used is /enroll/application/merchant/send/key/{externalKey}, and the method is PUT. The externalKey should match the externalKey used when creating the application; in this case, it was 012345-ABC.
In the payments_hub_merchant_onboarding_demo directory, create a file called send_application.py and add the following code to it:
Run the script using the following command:
The successful output will look as follows:
Validate the Application
After you send the application, the merchant will complete it. Before the completed application can be sent for underwriting review, it must be validated to check that the data the merchant entered meets the parameter requirements.
The endpoint to use here is /enroll/application/validate/{externalKey}. This endpoint validates that the data entered in the application meets the parameter requirements before the application is submitted for underwriting.
In the payments_hub_merchant_onboarding_demo directory, create a file called validate_application.py and put the following code in it:
Run the following command to execute the script:
The successful output will look as follows:
A success status means that there are no errors and that the application can now be submitted to underwriting.
Submit the Application
If your application validation is successful, the last step is to submit the application to underwriting. The endpoint to submit the application is /enroll/application/submit/{externalKey}.
In the payments_hub_merchant_onboarding_demo directory, create a file called submit_application.py and add the following code to it:
Remember to replace PUT_YOUR_TOKEN_HERE with your actual token.
To execute the script, run the following command:
The successful output will look as follows:
The applicationStatus value of finalized signifies that the application was successfully submitted.
Demonstrating the Complete Flow
Now that you know how the individual parts of the simplified enrollment process work, let's see how the complete flow works.
In the payments_hub_merchant_onboarding_demo directory, create a file called demonstrate_application.py and add the following code to it:
The code above combines the different functions from this tutorial into a single application for onboarding a merchant.
Be sure to replace PUT_YOUR_CLIENT_ID_HERE, PUT_YOUR_CLIENT_SECRET_HERE, PUT_YOUR_AGENT_ID_HERE, and PUT_YOUR_PLAN_ID_HERE with your credential values.
To run the full application, run the following command:
If it is successful, you will receive a success response that an application with the external key DemoApp-123 was created:
If you used a different external key, the message will contain the external key you used.
Web Application

Set Up the User Interface
The code for the web application user interface is in four main files, index.html, packages.json, proxy.js and server.js.
The HTML in the index.html file creates a form with the fields required to create a merchant application. It also has JavaScript code enclosed between the script tags that fetches a token and then uses it to create a merchant application.
The form comes pre-populated with test values that you can replace before you submit your application. Be sure to complete the agent, external key, and plan id fields before you submit as you can't submit the application if they are not completed.
The form also has two buttons at the bottom: Generate Token and Submit. The Generate Token button is first used to get the authentication token after which the Submit button submits the application.
The packages.json file contains metadata about the application and also lists the dependencies required.
The proxy.js file is necessary to avoid cross-origin resource sharing (CORS) issues . The proxy is responsible for sending API calls to the North API.
Remember to replace your_client_id and your_client_secret with your credentials.
And, lastly, the server.js file serves the index.html page for the user interface.
Run the Application
To run the application, run the following command on the terminal to install the dependencies: npm install
Next, run the command node proxy.js to start the proxy. You should get the following output:
Open another terminal and run the command node server.js to start the server script that's responsible for serving the user interface, ie the index.html page. You should get the following output:
On the form, click on Generate Token to get an auth token. Wait for the modal to confirm that you now have a token.
You will also see the token displayed on the terminal that is running proxy.js:
Click on Submit to submit the form. The auth token will be automatically added to the request in proxy.js, a payload will be created using the details in the form, and it will be sent to the /enroll/application/submit endpoint.
You will get a confirmation that the merchant application was successfully created.
Conclusion
How To Get Started
North’s Sales Engineering team provides support to developers and business decision-makers to help select the best possible payment system. Contact us to learn more about how North can help you set up a secure, efficient, and easy-to-use merchant boarding flow.