Denota
Search
K
Comment on page

API Endpoints

Protect your transactions with the Denota Shield API
Please contact the Denota Team for API onboarding information
By leveraging the power of account abstraction, our API ensures that the complexities of blockchain interaction are tucked away, allowing for a straightforward integration process. This approach makes it possible for both Web2 and Web3 merchants to effortlessly integrate with Denota. Whether you're a traditional online merchant or a decentralized platform, our API has been tailored to meet your integration needs with minimal friction.

1. Register Onramp

This endpoint is used to onboard an onramp onto the Denota platform. It involves providing administrative credentials such as email, password, and onramp name. Upon successful registration, a blockchain account is created for the onramp to interact with Denota's smart contracts on the Polygon blockchain. The API returns the address of the onramp's blockchain account.
All blockchain interactions are abstracted by the API for simplicity. An invitation code from the Denota team is required for registration.
  • Endpoint: /register
  • Method: POST
Parameters:
  • email (required): Email for onramp admin.
  • password (required): Password for onramp.
  • onrampName (required): Name associated with the onramp.
  • coverageTier (required): The tier of coverage.
  • historicalChargebackData (optional): Data associated with the onramp's historical chargebacks.
  • inviteCode (required): Code for registration, please contact Denota team
Responses:
  • 200 OK: Successfully registered, returns the address used for onchain transaction.
  • 304 Not Modified: User already exists, returns the address.
  • 400 Bad Request: Missing required fields.
  • 401 Unauthorized: Invalid invite code.
  • 500 Internal Server Error: Any other error, like registration error.
curl command
curl -X POST \
$DENOTA_URL/register \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"password": "",
"onrampName": "FTX",
"coverageTier": "4",
"historicalChargebackData": {}
}'
example output
{
"address": "0x7BFb4A0646e2f747422Bf8170291Ae307653DC8f"
}

2. Obtain Access Token

This endpoint provides an access token necessary for making subsequent API calls to Denota. It requires the onramp admin's email and password for authentication. The returned access token is used to authorize other API requests.
  • Endpoint: /signin
  • Method: POST
Parameters:
  • email (required): Email of the onramp admim.
  • password (required): Password for the onramp admin.
Responses:
  • 200 OK: Successfully signed in, returns the access token.
  • 400 Bad Request: Missing required fields.
  • 500 Internal Server Error: Error in session or other server errors.
curl command
curl -X POST \
$DENOTA_URL/signin \
-H 'Content-Type: application/json' \
-d '{
"email": "[email protected]",
"password": ""
}'
example output
{
"access_token":"",
"expires_in":604800,
"refresh_token":""
}

3. Get Quote

This endpoint calculates an estimate for the cost of coverage for a specific payment based on the payment amount and onramp's coverage tier. The quote helps in assessing the cost for the coverage before adding it.
  • Endpoint: /quote
  • Method: POST
Parameters:
  • paymentAmount (required): Amount of payment (USDC value).
Headers:
  • Authorization: Required token for authentication.
Responses:
  • 200 OK: Successfully calculated quote, returns the quote.
  • 400 Bad Request: Missing required fields.
  • 500 Internal Server Error: Error in session or other server errors.
curl command
curl -X POST \
$DENOTA_URL/quote \
-H 'Authorization: $TOKEN' \
-H 'Content-Type: application/json' \
-d '{"paymentAmount": 10.00, "riskScore": 30}'
example output
{
"quote": 0.03
}

4. Add Coverage

This endpoint allows for adding coverage to a payment, enabling the onramp to be compensated in case of chargebacks. Internally, the process involves minting an NFT and utilizing DeFi reserve pools to back the coverage, although these details are abstracted from the user.
  • Endpoint: /nota
  • Method: POST
Parameters:
  • paymentAmount (required): Amount of payment (USDC value).
Headers:
  • Authorization: Required token for authentication.
Responses:
  • 200 OK: Successfully added nota, returns the onchainId.
  • 400 Bad Request: Missing required parameters.
  • 500 Internal Server Error: Nota creation failed or other server errors.
curl command
curl -X POST \
$DENOTA_URL/nota \
-H 'Authorization: $TOKEN' \
-H 'Content-Type: application/json' \
-d '{"paymentAmount": 5, "riskScore": 30}'
example output
{
"onchainId": "59"
}

5. Initiate Recovery

This endpoint initiates the recovery process for a payment. It's used when an onramp needs to be compensated for a chargeback. The process involves providing the ID of the nota and proof of the chargeback. A success message and transaction hash are returned upon successful initiation.
  • Endpoint: /recovery
  • Method: POST
Parameters:
  • onchainId (required): ID of the nota.
  • proofOfChargeback (optional): Proof of the chargeback.
Headers:
  • Authorization: Required token for authentication.
Responses:
  • 200 OK or 201 Created: Successfully initiated recovery, returns a success message and transaction hash.
  • 400 Bad Request: Nota doesn't exist or user is not authorized.
  • Any other status code indicates errors related to the database or server.
curl command
curl -X POST \
$DENOTA_URL/recovery \
-H 'Authorization: $TOKEN' \
-H 'Content-Type: application/json' \
-d '{"notaId": 57}'
output
{
"hash": "0x41a7b07f484f2ace4a64a7adcfb350811a826332d80608fd2afd3334c3525ad9",
"message": "success"
}