RE:VIVE

If you wish to use RE:VIVE before its official release, please reach out to contact@redreamer.io to request early access as the product is currently under development.

Welcome to the RE:VIVE - Redeem as Settlement section of the API documentation. The RE:DREAMER API documentation below outlines the essential steps to enable your end-users to utilize NFTs as settlement in your web store.

NFT Redemption as Settlement

Redemption process:

  1. Select "NFT Redemption" as your preferred settlement method at checkout.

  2. The shop will initiate a request to create an RE:VIVE order.

  3. You will be redirected to the RE:DREAMER website.

  4. On the RE:DREAMER website, connect your wallet.

  5. A list of available NFTs for the order will be displayed.

  6. Choose an NFT to redeem.

  7. RE:DREAMER will redirect you back to the shop after the redemption process is complete.

Prerequisite

To make use of RE:VIVE, a redemption protocol smart contract called RE:ALM is required. You will need to pass the address of your RE:ALM smart contract as realm_address in the request body parameter to create an order. Please contact our team at contact@redreamer.io to obtain the realm_address.

STEP 1: Create an Order

To initiate an order for the product that the end-user wishes to redeem, send a POST request to the following endpoint:

Create an Order

POST /api/v1/revive/:network/orders

Create an order for the product that the end-user wishes to redeem.

Path Parameters

NameTypeDescription

network*

String

Unique identifier of the network. Please refer to the "Network" section located on the "General" page for more information.

Headers

NameTypeDescription

x-api-key*

String

API key.

Request Body

NameTypeDescription

contract_addresses*

Array of String

A list of eligible NFT smart contract addresses that can be used for settlement.

realm_address*

String

The address of the redemption protocol smart contract that is specifically created for the redemption operator.

redirect_link*

String

A URL that the end-user will be directed to after the redemption process is complete and has been broadcasted to the blockchain network.

item_url*

String

A URL of the image of the item that the end-user wishes to redeem.

item_name*

String

The name of the item that the end-user wishes to redeem.

custom_id*

String

The unique identifier of the order, as provided by the shop owner.

{
    "uuid": String,
    "network": String,
    "contract_addresses": [
        String
    ],
    "realm_address": String,
    "custom_id": String,
    "item_name": String,
    "item_url": String,
    "redirect_link": String,
    "created_at": "2023-03-27T04:10:33.608518518Z"
}

To obtain details about a created order, issue a GET request to the specified endpoint:

Retrieve Order Details

GET /api/v1/revive/:network/orders/:uuid

Get detailed information about a created order.

Path Parameters

NameTypeDescription

network

String

Unique identifier of the network. Please refer to the "Network" section located on the "General" page for more information.

uuid

String

The unique identifier of the order for which the information is being retrieved.

{
    "uuid": String,
    "network": String,
    "contract_addresses": [
        String
    ],
    "realm_address": String,
    "custom_id": String,
    "item_name": String,
    "item_url": String,
    "redirect_link": String,
    "created_at": "0001-01-01T00:00:00Z"
}

STEP 2: List NFTs for an Order

To retrieve the list of NFTs eligible for redemption for a specific order, send a GET request to the following endpoint:

List NFTs for an Order

GET /api/v1/revive/:network/nfts

Returns a list of eligible NFTs owned by the connected wallet for a specific order.

Path Parameters

NameTypeDescription

network*

String

Unique identifier of the network. Please refer to the "Network" section located on the "General" page for more information.

Query Parameters

NameTypeDescription

order_uuid*

String

The unique identifier of the order for which the list of eligible NFTs is being retrieved.

Headers

NameTypeDescription

Authorization*

String

Bearer ${token}. Replace ${token} with the actual JWT.

{
    "data": [
        {
            "id": String,
            "uuid": String,
            "network": String,
            "contract_address": String,
            "token_id": Integer,
            "is_valid": Boolean,
            "is_redeemable": Boolean,
            "created_at": "0001-01-01T00:00:00Z",
            "updated_at": "0001-01-01T00:00:00Z",
            "deleted_at": "0001-01-01T00:00:00Z",
            "name": String,
            "description": String,
            "image": String,
            "external_url": String,
            "animation_url": String,
            "attributes": []
        }
    ]
}

STEP 3: Use NFT as Settlement

To use the selected NFT as settlement, send a POST request to the following endpoint:

Use an NFT as settlement for specific order

POST /api/v1/revive/:network/redemption

Settle an order by redeeming the selected NFT.

Path Parameters

NameTypeDescription

network*

String

Unique identifier of the network. Please refer to the "Network" section located on the "General" page for more information.

Headers

NameTypeDescription

x-api-key*

String

API key.

Request Body

NameTypeDescription

user_input_data*

JSON Object

Additional key-value pairs {"key":"value",...} which can be used to store shipping information.

token_id*

Integer

Unique identifier for an NFT within a specific smart contract.

realm_address*

String

The address of the redemption protocol smart contract that is specifically created for the redemption operator.

redeemer_address*

String

The address of the user.

order_uuid*

String

The unique identifier of the order for which the list of eligible RNFTs is being retrieved.

contract_address*

String

The address of the smart contract for the selected NFT.

custom_id*

String

The unique identifier of the order, as provided by the shop owner.

{
    "uuid": String,
    "order_uuid": String,
    "network": String,
    "contract_address": String,
    "token_id": Integer,
    "status": "redeemed",
    "redeemer_address": String,
    "user_input_data": {
        "additionalProp1": {}
    },
    "created_at": "2023-03-24T09:55:34.664463Z",
    "updated_at": "2023-03-24T09:55:34.664463Z"
}

Last updated