# Create unique NMKR Pay Link for random Token sales

With this endpoint you have the flexibility to add your own custom Queue or Whitelisting system in Front of the purchasing process of random tokens via NMKR Pay.&#x20;

To create a unique random payment transaction that allows your customer to buy a random token via [NMKR Pay](https://docs.nmkr.io/nmkr-studio/set-up-sales/nmkr-pay), we call the API endpoint:

```
/v2/CreatePaymentTransaction
```

### Curl request

As always with the NMKR API, the API Key / Authentication Token is given in the header:\
Further you specify the "projectUid" (not the Project ID) and also the "nftUid" (not the token ID) as well as the token count.

```json
curl --location --request POST 'https://studio-api.nmkr.io/v2/CreatePaymentTransaction' \
--header 'authorization: <<api_key>>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "projectUid": "<<project_uid>>",
  "paymentTransactionType": "nmkr_pay_random",
  "customProperties": {},
 
  "paymentgatewayParameters": {
    
        "mintnfts":{
    "countNfts": 1
        }
  },
  "customerIpAddress": "0.0.0.0"
}'
```

### Response

The response given by NMKR Studio will now identify the project by the UID and the price of the tokens from the [pricelist](https://docs.nmkr.io/nmkr-studio/set-up-sales/manage-prices-pricelist).\
The field "nmkrPayUrl" now contains a [random payment link](https://docs.nmkr.io/nmkr-studio/set-up-sales/nmkr-pay/set-up-nmkr-pay#share-the-payment-link-or-integrate-to-website) to buy the Token via [NMKR Pay](https://docs.nmkr.io/nmkr-studio/set-up-sales/nmkr-pay) with all its [features](https://docs.nmkr.io/nmkr-studio/set-up-sales/nmkr-pay#nmkr-pay-vs.-pay-in-address).

```json
{
    "paymentTransactionUid": "Tb38ed487c9274cd1b34266b40d97ea08",
    "projectUid": "05f6694c-a399-45fd-8dc4-d9fc9a7343b0",
    "paymentTransactionType": "nmkr_pay_random",
    "customProperties": {},
    "state": "prepared",
    "transactionParameters": null,
    "paymentTransactionCreated": "2022-12-01T00:49:18.158886+00:00",
    "paymentgatewayResults": {
        "priceInLovelace": null,
        "fee": null,
        "minUtxo": null,
        "mintNfts": {
            "countNfts": 1,
            "reserveNfts": []
        },
        "additionalPriceInTokens": []
    },
    "paymentTransactionSubStateResult": null,
    "auctionResults": null,
    "directSaleResults": null,
    "decentralParameters": null,
    "mintAndSendResults": null,
    "cbor": null,
    "signedCbor": null,
    "expires": null,
    "signGuid": null,
    "fee": null,
    "txHash": null,
    "nmkrPayUrl": "https://pay.nmkr.io/?mtid=Tb38ed487c9274cd1b34266b40d97ea08",
    "referencedTransaction": null,
    "customeripaddress": "0.0.0.0",
    "referer": null
}

```
