Edit chip properties for a token

Modify properties of the chips that are tied to a token. The request must be signed by the current owner of the token using a EIP-712 (opens in a new tab) structured data signature.

Request

PATCH /chips/self-service

Body

FieldDescriptionType
contractAddressContract address of the tokenstring
chainIdChain ID of the network where the token residesnumber
tokenIdID of the tokenstring
ownerSignatureOwner's EIP-712 signed requeststring
updatesObject of edits you want to apply across all chipsUpdates (see below)
requestExpiryTimeUnix timestamp at which the request expiresnumber

Updates Properties

FieldDescriptionType
redirectUrlURL to redirect to when the chip is tappedstring

EIP-712 Structured Data

The request body must be signed by the current owner of the token using an EIP-712 signature. The following structured data needs to be signed and included in the request as the ownerSignature:

{
  "domain": {
    "name": "Update Self Service Tag",
    "version": "1"
  },
  "types": {
    "Updates": [
      {
        "name": "redirectUrl",
        "type": "string"
      }
    ],
    "TokenRef": [
      {
        "name": "contractAddress",
        "type": "address"
      },
      {
        "name": "tokenId",
        "type": "uint256"
      },
      {
        "name": "chainId",
        "type": "uint256"
      }
    ],
    "UpdateRequest": [
      {
        "name": "token",
        "type": "TokenRef"
      },
      {
        "name": "updates",
        "type": "Updates"
      },
      {
        "name": "requestExpiryTime",
        "type": "uint256"
      }
    ]
  },
  "primaryType": "UpdateRequest",
  "message": {
    "token": {
      "contractAddress": "<CONTRACT_ADDRESS>",
      "tokenId": "<TOKEN_ID>",
      "chainId": <CHAIN_ID>
    },
    "updates": {
      "redirectUrl": "<REDIRECT_URL>"
    },
    "requestExpiryTime": <EXPIRY_TIMESTAMP>
  }
}

Example Body

{
  "contractAddress": "0xe03a266acfe08103fca5711b417db1a025aff6c4",
  "chainId": 137,
  "tokenId": "7",
  "ownerSignature": "0x11e5b560385d8aac13b4c719ed7b5547a066ecfe781a87a5e65fbbd022afa9e52ff426fdd5d7f9d6f1ba25d90e75a2ac2cb12748ec842aabad73a82d9dbe8f501b",
  "updates": {
    "redirectUrl": "https://iyk.app/t/c/v1"
  },
  "requestExpiryTime": 1689048938
}

The above request will change the redirect URL of the chips associated with the specified token to https://iyk.app/t/c/v1?iykRef=EXAMPLE when tapped.

Response

{
  "success": true,
  "updatedTags": ["1111111111144444"]
}

The response will indicate whether the operation was successful and return the UIDs of the updated tags. Note: updatedTags is an array as there may be more than one tag attached to a token.

Transfer Ownership

Transfer the NFT associated with the NFC tag to a new owner.

Request

POST /phygitals/transfer/self-service

Headers

HeaderValueRequired
content-typeapplication/jsonYes
x-iyk-api-keyAPI key for userYes

Body

FieldDescriptionType
tagUIDUniversalID for the tagstring
recipientETH address or ENS name to transfer ownership tostring

Response

{
  "initialTxHash": "0x07d1953bc13656004bf407b93f65b6a3d178b473ccc74594e2780bbd62f920d6",
  "tokenRef": {
    "chainId": 137,
    "contractAddress": "0x7455c52486d32a1d8b3d48d2945ec7db25dce722",
    "tokenId": "51"
  }
}
FieldDescriptionType
initialTxHashThe transaction hash for the ownership transfer. This hash may change as the transaction is resubmitted by the relayer.string
tokenRefThe chain ID, contract address, and token ID of the NFT linked to the tagobject