How to create an integration user for Paya Connect as an automated process
Product
Paya Connect
Paya Connect Developers Tool Kit
Description
While this is just a guide of best practices, we suggest working with the Paya SDK team for additional consultation. The intended audience for this article is only our integration partners and their development teams. Please note that additional code work will need to be done and any referenced sample(s) are only for educational purposes.
**THIS IS INTENDED FOR DEVELOPER/INTEGRATOR USE ONLY.**
Resolution
Some integrators will look to automatically create a Paya Connect local integration user to drive the API and Hosted requests coming from their Paya Connect Integrated solution. The process outlined below will take the integrator through the workflow of creating a local integration user for each merchant that is onboarded to their solution.
Glossary
Global Integration User - this is a hardcoded integration user that controls the creation of an integration user. While this user might be used for other purposes, we will be referring to its user creation capabilities.
Local Integration User - this is the location level integration user that will drive all ISV integrated solutions API and Hashed request.
Process
- Run a GET on the "locationinfo" endpoint, using the Global Integration Users credentials, to gather the Location Id using the supplied Location API ID. As part of your onboarding and experience discussion, your team will work with Paya's experience team to determine what information will be set as the Location API ID. Most integrators choose an internal account number.
- PHP GitHub example of the GET on "locationinfo".
- Additional documentation on the Endpoint (you will find a sample of the response our APIs will return for this request).
- the API call would be {host}/v2/locationinfos?[location-api-id]
- Gather the location id and submit a POST request to the "users" endpoint, using the Global Integration Users credentials, to create the Local Integration User. Important items to consider:
- The integration will need to create:
- unique username
- unique API key (between 24 & 64 characters)
- unique HASH key (between 24 & 64 characters) *only needed from Payform and Accountform integrations
- These values would need to keep on record as the location's local integration user credentials.
- PHP GitHub example of the POST on "users"
- Additional endpoint documentation on the endpoint
- The integration will need to create:
- Gather the Local Integration User's user id from the response of the creation of the user for the POST to "authroleusers" endpoint, using the Global Integration User credentials, to assign the integration roles.
- PHP GitHub example of the POST to "authroleusers"
- please note that in GitHub we show only the sandbox authrole ids, production roles will be supplied after certification.
Please contact the SDK support team with any additional integration questions.