Skip to main content

Hash Widget URL API

The Hash Widget URL API allows you to encrypt your widget URL details securely. Using a one-time hash ensures that the product checkout page is only activated when the link is opened. Additionally, it provides the ability to track whether the product URL has been accessed.


Endpoint

URL:
For development:
https://api-dev.1buy.io/api/business/product/hash_widget_url

For production:
https://api.1buy.io/api/business/product/hash_widget_url


HTTP Method

POST


Headers

HeaderDescription
api-keyYour API key for authentication.
Content-TypeMust be set to application/json.

Request Body

The API accepts the following parameters:

ParameterTypeDescriptionRequired
urlDatastringRepresents the query parameters as a single string. Must start with ? and use & to join key-value pairs.Yes
is_one_timebooleanIndicates whether the generated URL hash should be for one-time use. Default: false.No

Example Request Body

{
"urlData": "?api_key=YOUR_API_KEY&product_id=PRODUCT_ID&lang=LANG",
"is_one_time": true
}

Replace the Placeholders

  • api_key: Your API key for authentication.
  • product_id: The unique identifier of the product.
  • lang: Preferred language code (optional, e.g., en for English, fr for French).

For more details on additional parameters, refer to Step 3: Add Parameters.

Use Hash Value

You can use the returned hash to embed a secure widget in your application:

<iframe
src="https://checkout-dev.1buy.io/buy-nft?hash={{HASH}}"
width="780px"
height="540px"
title="1buy.io"
frameborder="1"
/>

For additional details, refer to Step 4: Generate Widget Hash Code.