Download OpenAPI specification:Download
API support: tech@avata.gg
Used to ask for a proposal for a policy for an NFT.
X-Brand-Id | string |
totalValue required | number The total value of the purchase |
chain required | string Enum: "ETHEREUM" "POLYGON" The used chain for the purchase |
nftContractId required | string^0x[A-Fa-f0-9]{40}$ The smart contract address of the NFT |
countryCode | string Enum: "global" "nl" "be" "de" "gb" ISO 3166-1 alpha-2 country code. The country code of the buyer. This code is optional for normal NFT, but required for an NFT that is a receipt for a physical product. |
marketplaceContractId | string^0x[A-Fa-f0-9]{40}$ The smart contract address of the Marketplace |
token required | string Enum: "ETH" "MATIC" "USDC" "USDT" "EUR" "USD" "GBP" "AED" The used token for the purchase |
{- "totalValue": 0,
- "chain": "ETHEREUM",
- "nftContractId": "string",
- "countryCode": "global",
- "marketplaceContractId": "string",
- "token": "ETH"
}
{- "totalValue": 0,
- "duration": 0,
- "policyPercentage": 0,
- "policyTermsUrl": "string",
- "policyPrice": 0,
- "id": "string",
- "coveragePercentage": 0,
- "policyLogoUrl": "string",
- "avataLogoUrl": "string"
}
Used to confirm a proposal for a policy for an NFT . Data needs to match proposal.
X-Brand-Id | string |
required | object |
required | object or object |
object Customer details if available for contact purpose |
{- "proposal": {
- "id": "string"
}, - "purchase": {
- "totalValue": 0,
- "chain": "ETHEREUM",
- "metadata": { },
- "currentBlock": "string",
- "txId": "string",
- "marketplaceContractId": "string",
- "source": "string",
- "token": "ETH",
- "target": "string",
- "reference": "string",
- "nftContractId": "string",
- "countryCode": "global",
- "nftTokenId": "string"
}, - "customer": {
- "firstName": "string",
- "lastName": "string",
- "houseNumberSuffix": "string",
- "phoneNumber": "string",
- "city": "string",
- "countryCode": "string",
- "street": "string",
- "postalCode": "string",
- "houseNumber": "string",
- "dateOfBirth": "string",
- "state": "string",
- "email": "user@example.com"
}
}
{- "id": "string",
- "message": "string"
}
Used to activate a policy and cancel a booking.
policyUuid required | string Policy identifier |
chain required | string Enum: "ETHEREUM" "POLYGON" The used chain for the purchase |
nftIds required | Array of strings[^0x[A-Fa-f0-9]{64}$] The NFT ids with capacity |
walletAddress required | string Public wallet ID of the buyer, used for payout |
token required | string Enum: "ETH" "MATIC" "USDC" "USDT" "EUR" "USD" "GBP" "AED" The used token for the purchase |
{- "policyUuid": "string",
- "chain": "ETHEREUM",
- "nftIds": [
- "string"
], - "walletAddress": "string",
- "token": "ETH"
}
Used to confirm a proposal for a policy for an Booking . Data needs to match proposal.
X-Brand-Id | string |
required | object |
required | object |
object Customer details if available for contact purpose |
{- "proposal": {
- "id": "string"
}, - "purchase": {
- "reference": "string",
- "totalValue": 0,
- "bookingWalletAddress": "string",
- "chain": "ETHEREUM",
- "metadata": { },
- "nftIds": [
- "string"
], - "bookingDateTime": "string",
- "txId": "string",
- "walletAddress": "string",
- "checkInDate": "string",
- "token": "ETH"
}, - "customer": {
- "firstName": "string",
- "lastName": "string",
- "houseNumberSuffix": "string",
- "phoneNumber": "string",
- "city": "string",
- "countryCode": "string",
- "street": "string",
- "postalCode": "string",
- "houseNumber": "string",
- "dateOfBirth": "string",
- "state": "string",
- "email": "user@example.com"
}
}
{- "id": "string",
- "message": "string"
}
Used to ask for a proposal for a policy for a booking.
totalValue required | number The total value of the purchase |
chain required | string Enum: "ETHEREUM" "POLYGON" The used chain for the purchase |
nftIds required | Array of arrays The NFT ids of the purchase |
countryCode | string Enum: "global" "nl" "be" "de" "gb" ISO 3166-1 alpha-2 country code. The country code of the buyer. This code is optional for normal NFT, but required for an NFT that is a receipt for a physical product. |
checkInDate required | string The date of the checkin in ISO 8601 format yyyy-MM-dd |
token required | string Enum: "ETH" "MATIC" "USDC" "USDT" "EUR" "USD" "GBP" "AED" The used token for the purchase |
{- "totalValue": 0,
- "chain": "ETHEREUM",
- "nftIds": [ ],
- "countryCode": "global",
- "checkInDate": "string",
- "token": "ETH"
}
{- "totalValue": 0,
- "duration": 0,
- "policyPercentage": 0,
- "policyTermsUrl": "string",
- "policyPrice": 0,
- "id": "string",
- "coveragePercentage": 0,
- "policyLogoUrl": "string",
- "avataLogoUrl": "string"
}
Used to ask for a proposal for a policy for an NFT.
X-Brand-Id | string |
totalValue required | number The total value of the purchase |
countryCode required | string Enum: "global" "nl" "be" "de" "gb" ISO 3166-1 alpha-2 country code |
currencyCode required | string Value: "eur" ISO 4217 alpha currency code |
{- "totalValue": 0,
- "countryCode": "global",
- "currencyCode": "eur"
}
{- "totalValue": 0,
- "policyPercentage": 0,
- "policyTermsUrl": "string",
- "policyPrice": 0,
- "id": "string",
- "policyLogoUrl": "string",
- "avataLogoUrl": "string"
}
Used to confirm a proposal for a policy for an digital-asset. Data needs to match proposal.
X-Brand-Id | string |
required | object |
required | object |
required | object |
{- "proposal": {
- "id": "string"
}, - "purchase": {
- "reference": "string",
- "totalValue": 0,
- "invoiceId": "string",
- "currencyCode": "eur"
}, - "customer": {
- "firstName": "string",
- "lastName": "string",
- "houseNumberSuffix": "string",
- "phoneNumber": "string",
- "city": "string",
- "countryCode": "global",
- "street": "string",
- "postalCode": "string",
- "houseNumber": "string",
- "dateOfBirth": "string",
- "state": "string",
- "email": "user@example.com"
}
}
{- "id": "string",
- "message": "string"
}
Used to ask for a update of the policy request status
uuid required | string The unique id of the policy request |
{- "uuid": "string"
}
{- "eventType": "string",
- "body": {
- "reference": "string",
- "uuid": "string",
- "status": "string"
}
}
This section describes the authentication process and calls. The authentication process consists of two steps.
Used to ask an authentication token. The JWT Bearer token can be used access the API requests.
signature required | string The signature of the signed nonce with the wallet public key. |
chainId required | number The chain id of the connected network chain. |
publicKey required | string The public key of the wallet of the user. |
{- "signature": "string",
- "chainId": 0,
- "publicKey": "string"
}
{- "accessToken": "string"
}
Used to ask a nonce to sign authenticate request with. The request is called with two query parameters:
{- "nonce": "string"
}
Used to request details for a policy.
uuid required | string Required policy uuid. |
{- "uuid": "string"
}
{- "policy": {
- "startDateTime": "string",
- "policyId": "string",
- "policyHash": "string",
- "purchaseData": {
- "reference": "string",
- "totalValue": "string",
- "duration": "string",
- "confirmedAt": "string",
- "nft": {
- "txId": "string",
- "source": "string",
- "asset": {
- "owner": "string",
- "chain": "string",
- "tokenId": "string",
- "contractId": "string",
- "title": "string",
- "uri": "string"
}, - "token": "string",
- "target": "string"
}, - "coveragePercentage": "string"
}, - "policyType": "string",
- "endDateTime": "string",
- "uuid": "string",
- "status": "string",
- "finishedAt": "string"
}
}
Used to request policies for a wallet address.
wallet required | string Required wallet to request policies for. |
chainId required | number Required chain ID. |
{- "wallet": "string",
- "chainId": 0
}
{- "policies": [
- {
- "policy": {
- "startDateTime": "string",
- "policyId": "string",
- "policyHash": "string",
- "purchaseData": {
- "reference": "string",
- "totalValue": "string",
- "duration": "string",
- "confirmedAt": "string",
- "nft": {
- "txId": "string",
- "source": "string",
- "asset": {
- "owner": "string",
- "chain": "string",
- "tokenId": "string",
- "contractId": "string",
- "title": "string",
- "uri": "string"
}, - "token": "string",
- "target": "string"
}, - "coveragePercentage": "string"
}, - "policyType": "string",
- "endDateTime": "string",
- "uuid": "string",
- "status": "string",
- "finishedAt": "string"
}
}
]
}
This section describes the different calls that can be made for claims.
NOTE: If a policy report will be uploaded this must be done in front of the create claim call. The upload call will respond with a key of the claim document file. This key must be added in the create claim call.
Used to upload required documents for a claim.
policyUuid required | string <uuid> Required policy uuid. |
required | Array of objects non-empty |
publicKey required | string The public key of the wallet of the user. |
{- "keys": [
- "string"
], - "message": "string"
}
Used to get claim status.
policyUuid required | string <uuid> Required policy uuid. |
{- "policyUuid": "0bc4470f-d4c3-4d35-b760-d2a4163c98fa"
}
{- "claim": {
- "status": "CREATED",
- "policy": {
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f"
}
}
}
Used to create a claim on a policy.
reason required | string The reason of the claim |
policyUuid required | string Required policy uuid. |
required | Array of objects non-empty |
email required | string <email> Email address of the claimer |
{- "reason": "string",
- "policyUuid": "string",
- "files": [
- {
- "fileName": "string",
- "fileVersion": "string",
- "key": "string"
}
], - "email": "user@example.com"
}
{- "claim": {
- "reason": "string",
- "createdDate": "string",
- "files": [
- {
- "fileName": "string",
- "fileVersion": "string",
- "key": "string"
}
], - "email": "string",
- "status": "string",
- "policy": {
- "startDateTime": "string",
- "policyId": "string",
- "policyHash": "string",
- "purchaseData": {
- "reference": "string",
- "totalValue": "string",
- "duration": "string",
- "confirmedAt": "string",
- "nft": {
- "txId": "string",
- "source": "string",
- "asset": {
- "owner": "string",
- "chain": "string",
- "tokenId": "string",
- "contractId": "string",
- "title": "string",
- "uri": "string"
}, - "token": "string",
- "target": "string"
}, - "coveragePercentage": "string"
}, - "policyType": "string",
- "endDateTime": "string",
- "uuid": "string",
- "status": "string",
- "finishedAt": "string"
}
}
}
Used to send KYC info to.
policyUuid required | string |
provider required | string |
payload | object |
{- "policyUuid": "string",
- "provider": "string",
- "payload": { }
}
{- "policyUuid": "string",
- "provider": "string",
- "payload": { }
}
The Avata API supports callbacks to the merchant. The callback is triggered when a resource is updated. The callback is triggered with a POST request to the callback URL of the merchant. The body of the request contains a JSON object with the following structure:
Field | Type | Description |
---|---|---|
eventType | string | The type of event that triggered the callback. |
body | object | The body of the event. |
The eventType can be one of the following values:
eventType | Description |
---|---|
policy-update | The policy is updated. |
claim-update | The claim is updated. |
Policy Updates The body of the policy-update event is an object with the following structure:
Field | Type | Description |
---|---|---|
status | PolicyStatus | The status of the policy. |
uuid | string | The uuid of the policy. |
reference | string | The reference of the policy. |
details | PolicyDetails | The details of the policy. |
The PolicyDetails object has the following structure:
Field | Type | Description |
---|---|---|
policyId | string | The id of the policy. |
policyType | string | The type of the policy. |
startDateTime | string | The start date and time of the policy. |
endDateTime | string | The end date and time of the policy. |
The PolicyStatus object has the following structure:
Field | Type | Description |
---|---|---|
CREATED | string | The policy is created. |
PENDING | string | The policy is pending. |
EXPIRED | string | The policy is expired. |
SEND | string | The policy is send. |
ACCEPTED | string | The policy is accepted. |
REJECTED | string | The policy is rejected. |
ERROR | string | The policy has an error. |
RETRYING | string | The policy is retrying. |
The following example shows the body of a policy-update callback request:
{
"eventType": "policy-update",
"body": {
"status": "APPROVED",
"uuid": "d7b9f5b0-4b4b-11eb-ae93-0242ac130002",
"reference": "1234567890",
"details": {
"policyId": "1234567890",
"policyType": "DIGITAL_ASSET",
"startDateTime": "2021-01-01T00:00:00.000Z",
"endDateTime": "2021-01-02T00:00:00.000Z"
}
}
}
Claim Updates
The body of the claim-update event is an object with the following structure:
Field | Type | Description |
---|---|---|
status | ClaimStatus | The status of the claim. |
uuid | string | The uuid of the claim. |
policyUuid | string | The uuid of the policy. |
details | ClaimDetails | The details of the claim. |
The ClaimDetails object has the following structure:
Field | Type | Description |
---|---|---|
claimId | string | The id of the claim. |
The ClaimStatus object has the following structure:
Field | Type | Description |
---|---|---|
CREATED | string | The claim is created. |
PENDING | string | The claim is pending. |
REPORTED | string | The claim is reported. |
REVIEWED | string | The claim is reviewed. |
REJECTED | string | The claim is rejected. |
APPROVED | string | The claim is approved. |
Callback request example
The following example shows the body of a claim-update callback request:
{
"eventType": "claim-update",
"body": {
"status": "APPROVED",
"uuid": "d7b9f5b0-4b4b-11eb-ae93-0242ac130002",
"policyUuid": "d7b9f5b0-4b4b-11eb-ae93-0242ac130002",
"details": {
"claimId": "1234567890"
}
}
}
To direct your clients to the Merchant Claim Page, you need to construct a specific URL that includes necessary parameters. The structure of the URL is as follows:
https://portal.avata.gg/merchant-claim/{policyUuid}/{signedPolicyUuid}
In this URL:
{policyUuid}
should be replaced with the specific policy UUID you want the client to access.{signedPolicyUuid}
should be replaced with a message that includes the policyUuid
, signed with the private key of the owner's wallet.Detailed information about the parameters in the URL:
policyUuid
This is a unique identifier assigned to each policy in our system.
signedPolicyUuid
This is a message encrypted with the private key of the owner's wallet. This message should include the policyUuid. This is a crucial component as it allows us to verify the transaction with the owner's address.
To generate the signedPolicyUuid
, you need to follow the process of signing a message with the private key of the owner's wallet. It involves encrypting the policyUuid
with the owner's private key. An example in Node.js:
var ethers = require('ethers');
const wallet = new ethers.Wallet.createRandom();
const message = "policyUuid";
const signature = await wallet.signMessage(message);
To direct your clients to the Merchant Claim Page, you need to construct a specific URL that includes necessary parameters. The structure of the URL is as follows:
https://portal.avata.gg/merchant-claim/{policyUuid}/{signedPolicyUuid}
In this URL:
{policyUuid}
should be replaced with the specific policy UUID you want the client to access.{signedPolicyUuid}
should be replaced with a message that includes the policyUuid
, signed with the private key of the owner's wallet.Detailed information about the parameters in the URL:
policyUuid
This is a unique identifier assigned to each policy in our system.
signedPolicyUuid
This is a message encrypted with the private key of the owner's wallet. This message should include the policyUuid. This is a crucial component as it allows us to verify the transaction with the owner's address.
To generate the signedPolicyUuid
, you need to follow the process of signing a message with the private key of the owner's wallet. It involves encrypting the policyUuid
with the owner's private key. An example in Node.js:
var ethers = require('ethers');
const wallet = new ethers.Wallet.createRandom();
const message = "policyUuid";
const signature = await wallet.signMessage(message);