Skip to main content

NFT Management Console

Overview

http://console.paytweed.com - Offers an UI to manage you're collections in the Tweed marketplace eco-system:

  1. The NFT screen is where you plumb your smart contract to Tweed's backend.
  2. The Payout screen is where you create a payout account to collect the payments for your platform's collections.
  3. In addition to the UI, the console gives marketplace developers the abitiliy to add collections programmatically.

Configuring the payout

The 1st step would be to create a payout account, fill in all your business account details, once the account is approved you will be able to collect payments.

Webhook Integration (optional)

Webhook integration is available to streamline the process of sending personalized emails or receipts to your users every time an NFT purchase is made. This feature can be utilized when you choose to handle invoicing on the "Payout" tab in the last step.

Provide a webhook URL

  1. Click on the "Payout" tab in the left pane of the dev console.
  2. In the "NFT" tab, locate the webhook integration section.
  3. Enter the URL where you want to receive the transaction details. This URL should be capable of handling incoming HTTP POST requests.

Generate authentication token

  1. Click "Save" to save your webhook URL.
  2. A unique authentication token will be generated for your webhook integration. This token is essential for authenticating your webhook requests and should be kept private.

Handle Incoming Webhook Requests

  1. Your webhook URL will receive HTTP POST requests with transaction details every time an NFT purchase is made.
  2. Implement the necessary logic on your server to handle incoming requests. Validate the authenticity of the request using the authentication token provided.

Sample Webhook Payload

  nftId: '1'
currency: 'USD'
price: 1000
customerName: 'John Doe'
customerAddress: '123 Main St, New York, NY 10001'
stripePaymentId: 'pi_1J4GZt2eZvKYlo2C2X2X2X2X'

Adding an NFT collection

  1. Click on the NFT button of the left pane of the dev console
  2. Click "Add Collection" button, a popup will let you adding the information of your contract
  3. Type in the collection name, Contract address and choose the blockchain
  4. Click "Add collection", if the contract has passed the sanity tests your collections will be added
  5. List you collection using Tweed's SDK function:
sdk.nft.buyWithFiat(...)
NFT Screen
The NFT screen

Add NFT Collection
The Add Collection popup

Adding an NFT collection using API

This feature allows you to seamlessly add and manage NFT collections outside of the management console by utilizing our powerful REST API. With this functionality, you can easily integrate NFT collection management into your own applications or systems.

1. Generate API Key and Secret

In the NFT page of the console, click on the "Add Collection via API" button. than click 'Generate API Keys' button.

NFT Screen

2. Obtain JWT Access Token

To obtain a JWT access token, send a POST request to the console.paytweed.com/auth/getAccessToken endpoint. Include your API key and API secret in the request body. This will return a JWT access token.

info

Create a mechanism in your code to generate a new JWT token only when the current token has expired, rather than generating a new token for each API call.

const apiKey = 'your_api_key';
const apiSecret = 'your_api_secret';

const authEndpoint = 'https://console.paytweed.com/auth/getAccessToken';

const payload = {
apiKey,
apiSecret,
};

const response = await fetch(authEndpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
});

const jwt = await response.json();

3. Include JWT Token in API Requests

For each API call you make to the console.paytweed.com/collections endpoint, include the JWT token in the header of your request. This ensures that the server can authenticate and authorize your requests properly.

const headers = {
Authorization: `Bearer ${access_token}`,
'Content-Type': 'application/json',
};

// Make API requests using the 'headers' object in your requests

Now you are able to make API calls to the console.paytweed.com/collections endpoint to manage your NFT collections.

Add A new NFT Collections

Send a POST request to the console.paytweed.com/collections endpoint, including an array of objects that represent the details of the NFT collection.

The required properties for each object are:

NameTypeRequiredDescription
nameString✔️The name of the collection
blockchainString✔️The name of the blockchain associated with the collection
contractAddressString✔️The address of the smart contract associated with the collection
whitelistedBoolean✔️A boolean value indicating if the collection is whitelisted
whitelistingInfoString✔️Additional information about the whitelisted status

note

Ensure that all these properties are included in your request.

const collections = [
{
name: 'Collection 1',
contractAddress: '0x123456789',
blockchain: 'Ethereum',
whitelisted: false,
whitelistingInfo: '{}'
},
{...another collection}]

Retrieve NFT Collections

To retrieve all the NFT collections in your console, send a GET request to the console.paytweed.com/collections endpoint. The response will contain the information about all the collections available.

Delete an NFT Collection

To delete a specific NFT collection, make a DELETE request to the console.paytweed.com/collections/{collection_Id} endpoint, where {collection_Id} represents the ID of the collection you want to delete.