Requirements
Before proceeding with the steps in this guide, ensure you have:- Completed the three steps related to the importing cards from a gateway account process.
- Accessed your API credentials on the Yuno Dashboard, which include:
public-api-keyprivate-secret-keyaccount_id
Migrate tokens via API
Step 1: Create customers
To begin the token migration process, you will use the Create Customer endpoint to add customers to the Yuno system. It is important to note that payment methods cannot be enrolled for customers who do not exist in the Yuno system. If the customers are already present in Yuno, you may skip this step. To register new customers, provide their personal information. Additionally, you must supply themerchant_customer_id, which is a unique identifier for the customer used in your system.
Customer complementary informationWhen creating a customer, certain information is optional but can enhance the user’s payment experience if provided. Examples of non-mandatory data include phone number, billing address, and shipping address.If you choose to add optional information, ensure that all required mandatory fields are also provided.
id that identifies the user within the Yuno system. Use this id to enroll the existing payment methods.
Step 2: Check the customer data (optional)
In this step, you have the option to verify the information of each registered customer. Use the Retrieve Customer endpoint to access the customer data. To do this, provide theid that was generated when the customer was initially created.
Step 3: Enroll a payment method
To complete the migration process, you need to enroll payment methods for each customer using the third-party vault or gateway data. Utilize the Enroll Payment Method endpoint to register the payment methods. Remember, thecustomer_id required for this request is the id obtained during the customer creation in Step 1. Additionally, include the provider_data object containing the external provider’s token, as shown in the code snippet below:
Request
vaulted_token that identifies the enrolled payment method. This vaulted_token will be used for future payments, eliminating the need for additional payment method details.
Step 4: Check the enrolled payment method (optional)
Once the payment method is enrolled, you can verify its successful enrollment using the retrieve enrolled payment methods endpoint. Remember, thecustomer_id needed for this request is the id obtained during the customer creation in Step 1.