Direct Flow

How it works

If you are a developer, you can use our Direct Flow to keep using your checkout and connect to our services using only a server-to-server connection.

Your company must be PCI-certified to use our server-to-server card payments service. Please forward your AOC certification to your account manager before beginning the implementation.

❗️

We always recommend using Yuno's SDKs over Direct Flow integrations. Yuno's SDKs are PCI compliant and simplify the payment process by managing all complexities, including fraud prevention, 3DS, and payment provider-specific requirements. Direct Flow requires merchants to handle these aspects manually, increasing complexity and risk.

For every implementation, we recommend taking the payment status and sub_status as the main reference for the payment's state. A payment could have different transactions associated with it, so by focusing on the payment status/sub_status, you can have the latest state regardless of how many transactions were made, giving you clear input for decision-making. With this integration, you can also enroll credit cards for future purchases (also only available for PCI-compliant merchants).

Payment

Step 1: Create a customer

[Optional] - The fist step of the payment flow is to create a customer. A customer will have payment methods associated. You can create a customer using the following endpoint. As a result, you will receive the customer's id that was created in the Yuno DB.

You can skip this step if you have previously created the customer.

This step is optional because you can send the customer information directly in the payment without creating a customer object in Yuno.

Step 2: Create the payment

As you take care of the whole payment experience with this integration, you will need to display the payment methods enabled in your Yuno account, and once the user has selected the payment method, you can create a payment. A payment gathers all crucial details regarding the order, customer specifics, total amount, currency, products, shipping details, and more. You can create a Payment using the following endpoint.

You can use the examples section in the API reference as a reference. If the user selects a previously enrolled payment method, you can use the vaulted_token returned by the get payment methods service to create the payment.

During the integration, we recommend taking the payment status and sub_status as the main reference for the payment's state. A payment could have different transactions associated with it, so by focusing on the payment status/sub_status, you can have the latest state regardless of how many transactions were made, giving you clear input for decision-making.

Important add-ons

  • Webhooks: We also recommend configuring Webhooks in your Yuno dashboard. Webhooks are the best way to ensure your system is up-to-date with payment progress and status. Since the event notifications trigger automatically, your system won't need to perform recurrent requests to Yuno.
  • Device_fingerprints: The customer's device fingerprints used for fraud prevention purposes. They are usually generated by using a third_party javascript in the checkout. In case you are using a DIRECT integration and want to support fraud providers in the payment flow, you can use this object to specify the necessary information. For integrations using Yuno checkout the value is obtained automatically, do not send this field.
    • [...]
      "customer_payer": {
          "merchant_customer_id": "1690161049",
          "first_name": "Giovanna",
          "last_name": "Bartell",
          "email": "[email protected]",
           "device_fingerprints": [
              {
                  "provider_id": "MERCADO_PAGO",
                  "id": "20a6c463-dd0c-4323-9115-03668d178856"
              },
              {
                  "provider_id": "CLEARSALE",
                  "id": "92d2ea4b-4bf7-494b-aaea-c48276135941"
              }     
        }, 
      [...]
      

  • Three_d_secure_setup_id: Use our JS only to get the three_d_secure_setup_id and then handle the payment as an only API integration. The Direct workflow is only available for PCI-compliant merchants. It provides a straightforward way to create a payment and validate user information, requiring the merchant to perform just one request to create the payment. To successfully implement the Direct integration, follow the steps outlined in the integration guideline and provide the required information as instructed. This service is not necessary for 3DS implementation using Yuno's SDK.

Enrollment

Step 1: Create a customer

The fist step of the payment flow is to create a customer. A customer will have payment methods associated. You can create a customer using the following endpoint. As a result, you will receive the customer's id that was created in the Yuno DB.

You can skip this step if you have previously created the customer.

Step 2: Enroll payment method

This feature is only available for enrolling Cards for PCI compliant merchants

Once you have your customer, you can enroll the payment method using the Enroll Payment Method endpoint . With the information provided by Yuno after the customer selects the payment method to enroll, you will be able to save that information for future purchases using the vaulted_token that represents the payment method object created.