(Optional) Pre-selecting the Digital Asset to receive

Skip a step in the journey by having the digital asset already selected

To streamline the process of redirecting end users directly to the payment address page for digital asset transactions, utilize the Create Payment endpoint, incorporating payOutDetails.

Below are the details required for the create payment request that bypasses the digital asset selection stage:

ParameterTypeRequiredDescription
merchantIdstringYesIdentifies the Merchant ID, indicating which wallet the payment should settle in. Found on the Merchant Details page.
amountlongYesThe total amount needed to complete the payment.
expiryMinutesintegerNoDefines the time frame for the end-user to complete the payment. Defaults to 1440 minutes if not specified.
currencystringYesThe currency code to present the price in to the end-user.
returnUrlstringNoThe URL for redirecting the user back to the merchant's site from the payment flow.
referencestringYesA unique reference for the payment, visible to both you and your customer.
typestringYesSpecifies the transaction type, using OUT for outgoing payments.
payOutDetails.currencystringNoOptional to specify if you know the digital asset the end-user will use, skipping the selection screen. Leave this out to offer digital asset choice.
payOutDetails.protocolstringNoRequired when payOutDetails.currency is set and the digital asset supports multiple protocols, to specify the exact protocol.

Example Request

Here is how an example request might look:

{
    "currency": "EUR",
    "amount": "10",
    "reference": "a0c95e46-28f6-403d-a612-735ff21bd38f",
    "merchantId": "ce3fe53f-2461-46d7-9e8a-0e58003cd358",
    "expiryMinutes": "20",
    "returnUrl": "https://yourwebsitename.com",
    "type": "OUT",
     "payOutDetails": {
         "code": "crypto",
         "currency": "USDT",
         "protocol": "ERC20",
         "address": "0x84A4a239805d06c685219801B82BEA7c76702215"
     }
}

Example Response

Upon successfully submitting the request, you'll receive a response like the following:

{
    "metadata": {},
    "uuid": "11db7d1b-97cf-4e71-ac73-ef9e8e505331",
    "merchantDisplayName": "USDT wallet",
    "merchantId": "ce3fe53f-2461-46d7-9e8a-0e58003cd358",
    "dateCreated": 1750171656561,
    "expiryDate": 1750172856561,
    "quoteExpiryDate": 1750172856561,
    "acceptanceExpiryDate": 1750171686592,
    "quoteStatus": "ACCEPTED",
    "reference": "a0c95e46-28f6-403d-a612-735ff21bd38f",
    "type": "OUT",
    "subType": "merchantPayOut",
    "status": "PROCESSING",
    "displayCurrency": {
        "currency": "EUR",
        "amount": 10,
        "actual": 0
    },
    "walletCurrency": {
        "currency": "USDT",
        "amount": 11.57236634640142803,
        "actual": 11.57236634640142803
    },
    "paidCurrency": {
        "currency": "USDT",
        "amount": 11.57236634640142803,
        "actual": 0
    },
    "feeCurrency": {
        "currency": "USDT",
        "amount": 0.381888089039204284,
        "actual": 0
    },
    "networkFeeCurrency": {
        "currency": "USDT",
        "amount": 1.15723663,
        "actual": 0
    },
    "displayRate": {
        "base": "USDT",
        "counter": "EUR",
        "rate": 0.864127525866
    },
    "exchangeRate": {
        "base": "USDT",
        "counter": "USDT",
        "rate": 1
    },
    "address": {
        "address": "0x84A4a239805d06c685219801B82BEA7c76702214",
        "tag": "",
        "protocol": "ERC20",
        "uri": "ethereum:0xdac17f958d2ee523a2206206994597c13d831ec7/transfer?address=0x84A4a239805d06c685219801B82BEA7c76702214&uint256=11572366",
        "alternatives": []
    },
    "returnUrl": "https://yourwebsitename.com",
    "redirectUrl": "https://pay.sandbox.layer1.com/payout/11db7d1b-97cf-4e71-ac73-ef9e8e505331",
    "transactions": [],
    "refund": null,
    "refunds": [],
    "currencyOptions": [],
    "flow": "DEFAULT",
    "twoStep": false,
    "pegged": false,
    "customerId": null,
    "walletId": "ce3fe53f-2461-46d7-9e8a-0e58003cd358"
}

Key takeaways include the uuid for payment queries and the redirectURL for directing the end-user to the Hosted Payments Page, bypassing the first digital asset selection screen if payOutDetails.currency is provided.

This setup ensures a tailored payment experience, directly linking to the specified payment address. All Exchange rates are now provided given that the payment currency is known at the time the payment is created.