Add SHARE Protocol Split Contract as a Payee

This guide provides step by step instructions for using a split contract as a payee within your system.

At royalty split creation time your customers can enter the ID of a splits contract instead of an email address as a payment recipient. In your service, this call should be invoked during the Royalty Splits -> New Royalty Split -> Add Payee flow. When a customer is prompted to enter the email address of a payee, they can instead enter the contract ID as a payee.

  1. Validate that the contract exists using the contracts_get_by_id endpoint.

curl -v -X POST 'https://share-ddn.formless.xyz/v1' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $API_KEY" \
-d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "contracts_get_by_id",
    "params": {
        "contract_id": "32843127-d5d9-41d7-b1ad-508de4f86693"
    }
}'

Response

{
    "jsonrpc": "2.0",
    "id": "1",
    "result": {
        "success": true,
        "contract_address": "0xb1303e1cAffC4A0dfA4D67227D53aA384d7f962d",
        "network_id": 137
    }
}

Note that success is true, indicating that this payee represents a valid smart contract.

  1. Store this contract ID in your system in the same way a payee referenced by email would be stored. This contract ID will be referenced again at payout time.

Last updated