Skip to main content
POST
/
v1#contracts_create
Create Revenue Sharing Contract
curl --request POST \
  --url 'https://share-ddn.formless.xyz/v1#contracts_create' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "contracts_create",
  "params": {
    "type": "digital_property_with_revenue_share",
    "network": "base",
    "title": "HYPERMAX SNEAKER RELEASE",
    "description": "Community revenue sharing for HYPERMAX sneaker release",
    "creator_name": "HYPERMAX Brand",
    "revenue_share": {
      "recipients": {},
      "community_allocation_percent": 100,
      "community_split_count": 100,
      "distribution_unit": {
        "value": 1,
        "currency": "USD"
      }
    },
    "revenue_source": {
      "product": {
        "type": "product"
      }
    }
  }
}
'
{
  "jsonrpc": "2.0",
  "id": "<string>",
  "result": {
    "status": "success",
    "code": 200,
    "network_id": 123,
    "blockchain_name": "<string>",
    "revenue_share_smart_contract_address": "<string>",
    "digital_property_contract_address": "<string>",
    "digital_property_contract_id": "<string>",
    "join_splits_url": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.formless.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Create a PFA (Pay-For-Access) smart contract for a song on the blockchain. PFA stands for “Pay-For-Access”. It represents a song that is available for sale on the SHARE protocol. Unlike NFTs where ownership of a collectible is transferred, PFA contracts grant users access to content while keeping ownership of the contract with the creator, similar to mechanical royalties.

Song Contract Example

To create a song contract, set the revenue_source.product.type to "pfa" and include pay_for_access_metadata:
{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "contracts_create",
    "params": {
        "type": "digital_property_with_revenue_share",
        "network": "base",
        "title": "Test Song",
        "description": "Test Song",
        "creator_name": "Test User",
        "revenue_source": {
            "product": {
                "type": "pfa",
                "pay_for_access_metadata": {
                    "json_rpc": "https://base-mainnet.g.alchemy.com/v2/uTDQJozcVtnDB8Rc7fvmf",
                    "network_id": 8453,
                    "grant_ttl_seconds": 2153088000,
                    "price_per_access_usd": 0.99,
                    "price_per_license_usd": 0,
                    "supports_licensing": true,
                    "use_usdc_as_currency": true,
                    "license_type": "UNLIMITED_LEASE_V1",
                    "preview": {
                        "name": "Test Song",
                        "description": "Test Song",
                        "image": "https://share-ddn.formless.xyz/content/test-song-artwork.png",
                        "attributes": {},
                        "title": "Test Song",
                        "artist": "Test User",
                        "asset_release_timestamp": 1798761600,
                        "type": "audio",
                        "audio": "https://share-ddn.formless.xyz/content/stackmatik-kamil-30s-preview.wav"
                    },
                    "grant": {
                        "name": "Test Song",
                        "description": "Test Song",
                        "image": "https://share-ddn.formless.xyz/content/test-song-artwork.png",
                        "attributes": {},
                        "title": "Test Song",
                        "artist": "Test User",
                        "type": "audio",
                        "asset_release_timestamp": 1798761600,
                        "audio": "https://share-ddn.formless.xyz/content/stackmatik-kamil.wav"
                    }
                },
                "product": {
                    "type": "pfa"
                }
            }
        },
        "revenue_share": {
            "recipients": {
                "share@formless.xyz": 100
            },
            "community_allocation_percent": 0,
            "community_split_count": 0,
            "distribution_unit": {
                "value": 0.99,
                "currency": "USD"
            }
        }
    }
}

Response

{
    "jsonrpc": "2.0",
    "id": "1",
    "result": {
        "status": "success",
        "code": 200,
        "PFA": {
            "contract_address": "0x04EF0B1d4416E12094C8599C17E00512B99Db16A"
        }
    }
}

PFA Metadata Parameters

Pay-For-Access Metadata

  • price_per_access_usd: The price users pay to access the full song (e.g., 0.99 for $0.99).
  • preview: Contains metadata for the free preview version of the song (typically a 30-second clip).
  • grant: Contains metadata for the full version users receive after purchase.
  • supports_licensing: Whether the song can be licensed for commercial use.
  • license_type: Type of license (e.g., “UNLIMITED_LEASE_V1”).

Revenue Share

  • recipients: A mapping of email addresses to percentage shares (must total 100).
  • distribution_unit: The amount distributed per sale and the currency.

Authorizations

Authorization
string
header
required

JWT token with Unique ID identification

Body

application/json
jsonrpc
enum<string>
default:2.0
required
Available options:
2.0
id
string
default:1
required
method
enum<string>
default:contracts_create
required
Available options:
contracts_create
params
object
required

Response

200 - application/json

Successful response

jsonrpc
enum<string>
required
Available options:
2.0
id
string
required
result
object
required