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
Field | Description | Type |
---|---|---|
contractAddress | Contract address of the token | string |
chainId | Chain ID of the network where the token resides | number |
tokenId | ID of the token | string |
ownerSignature | Owner's EIP-712 signed request | string |
updates | Object of edits you want to apply across all chips | Updates (see below) |
requestExpiryTime | Unix timestamp at which the request expires | number |
Updates Properties
Field | Description | Type |
---|---|---|
redirectUrl | URL to redirect to when the chip is tapped | string |
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
Header | Value | Required |
---|---|---|
content-type | application/json | Yes |
x-iyk-api-key | API key for user | Yes |
Body
Field | Description | Type |
---|---|---|
tagUID | UniversalID for the tag | string |
recipient | ETH address or ENS name to transfer ownership to | string |
Response
{
"initialTxHash": "0x07d1953bc13656004bf407b93f65b6a3d178b473ccc74594e2780bbd62f920d6",
"tokenRef": {
"chainId": 137,
"contractAddress": "0x7455c52486d32a1d8b3d48d2945ec7db25dce722",
"tokenId": "51"
}
}
Field | Description | Type |
---|---|---|
initialTxHash | The transaction hash for the ownership transfer. This hash may change as the transaction is resubmitted by the relayer. | string |
tokenRef | The chain ID, contract address, and token ID of the NFT linked to the tag | object |