Edit this page

Return Domain Action Guide

The Domain Actions API offers the functionality to generate a list of transactions that needs to be performed to return a domain to Unstoppable Domains and receive a refund without having to form them on the client.

Step 1: Retrieve Your Reseller ID and Secret API Token

To access your ResellerID and Secret API Token, you must navigate to your Sandbox or Production Partner dashboard. The ResellerID is used to identify the requests as coming from a Partner, while the Secret API Token is used for authentication to ensure that only authorized Partners can access the API.

Step 2: Prepare Request Body

When making a domain action request, the body must contain information about your domain action in JSON format with the following structure:

Copy
Copied
{
    "action": "Return",
    "domain": string, // domain name you are returning
    "gasCompensationPolicy": string // gas compensation policy
}
  • action : (string) The domain action you want to perform. To return domains, the value should be "Return" .
  • domain : (string) The domain name you want to return.
  • gasCompensationPolicy : (string) The gas compensation policy that should be used for the domain action.

Step 3: Prepare Authorization Headers

The Partner API uses bearer tokens to authorize requests with the Secret API Token from your Partner credentials.

Field Name Value
Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer Format a token provided by Unstoppable Domains

Step 4: Use the Create Domain Action Request Endpoint

Send a POST request to the Create Domain Action Request endpoint. To make a successful request, you must include the request body and authorization headers you have prepared, which should contain information about the domain action you want to perform.

Sandbox Environment:

Copy
Copied
https://api.ud-sandbox.com/api/v2/resellers/{PARTNER_RESELLERID}/actions

Production Environment:

Copy
Copied
https://unstoppabledomains.com/api/v2/resellers/{PARTNER_RESELLERID}/actions
info

The PARTNER_RESELLERID path parameter is the same one you retrieved from your partner account earlier.

Example

Here is an example of a request that you can use to create a domain action request to return a domain with the following parameters:

Parameter Value
Domain Action Return
Domain reseller-test-udtesting-602716235250.crypto
Gas Compensation Policy CompensateFree
RequestResponse
Copy
Copied
curl --location --request POST 'https://api.ud-sandbox.com/api/v2/resellers/{PARTNER_RESELLERID}/actions' \
--header 'Authorization: Bearer {SECRET_API_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "action": "Return",
    "domain": "reseller-test-udtesting-602716235250.crypto",
    "gasCompensationPolicy": "CompensateFree"
}'
Copy
Copied
{
    "id": 11,
    "action": "Return",
    "status": "Draft",
    "domain": {
        "id": 11949,
        "name": "reseller-test-udtesting-602716235250.crypto",
        "ownerAddress": "0x499dd6d875787869670900a2130223d85d4f6aa7",
        "resolver": "0x2a93c52e7b6e7054870758e15a1446e769edfb93",
        "resolution": {
            "crypto.ETH.address": "0x499dd6d875787869670900a2130223d85d4f6aa7",
            "crypto.MATIC.version.ERC20.address": "0x499dd6d875787869670900a2130223d85d4f6aa7",
            "crypto.MATIC.version.MATIC.address": "0x499dd6d875787869670900a2130223d85d4f6aa7"
        },
        "blockchain": "MATIC",
        "projectedBlockchain": "MATIC",
        "registryAddress": "0x2a93c52e7b6e7054870758e15a1446e769edfb93",
        "networkId": 80001,
        "freeToClaim": true,
        "node": "0x047fd742a6793ecd66d6de1140724c7bcfc1f429fc5a1150a76f58877105b6da"
    },
    "txs": [
        {
            "id": 108,
            "blockchain": "MATIC",
            "hash": null,
            "from": "0x499dd6d875787869670900a2130223d85d4f6aa7",
            "status": "Draft",
            "operation": "TransferDomain",
            "failReason": null,
            "type": "Meta",
            "signatureStatus": "Required",
            "messageToSign": "0x4ba3d701323836da23ce8100b9f5b8e5dd09290d589f5c66e0d78a9c1bfb4778"
        }
    ],
    "paymentInfo": null
}

The id field in the API response is the domain action ID and the txs field contains the list of transactions that needs to be performed to return the reseller-test-udtesting-602716235250.crypto domain to Unstoppable Domains for a refund.

Congratulations!

You have successfully created the domain action request to return a domain with the Domain Actions API. Now that the domain action is created, you can sign the transaction.

Asking For Help

If you are experiencing difficulties using our services, please know that we are here to help. You can join our Discord Community for real-time support from UD and the community, where you can receive assistance with integrating your app