Skip to main content

Buy On Primary Market

Purchase tokens directly from the primary market at the initial offering price.

Endpoint

POST /v2/users/purchases/users/{user_id}/tokens/{token_id}/buy-on-primary-market

Headers

HeaderValue
Content-Typeapplication/json
AuthorizationBearer {token}

Path Parameters

ParameterTypeRequiredDescription
user_idstringYesThe unique identifier of the user making the purchase
token_idstringYesThe unique identifier of the token to purchase

Request Body

{
"quantity": 10
}

Parameters

ParameterTypeRequiredDescription
quantitynumberYesNumber of tokens to purchase

Response

Returns a transaction ID for async processing. The purchase is processed asynchronously; use the transaction ID to poll for status via the transaction status endpoint.

Success Response (200 OK)

{
"transaction_id": "6913872755654191dede37da"
}

Response Fields

FieldTypeDescription
transaction_idstringTransaction ID for polling - use GET /v2/admin/tokens/{tokenID}/transactions/{transactionID} to check status

Example

Request

curl -X POST "\{\{baseUrl\}\}/v2/users/purchases/users/680c02896d91ca0145cfeb81/tokens/68ae06cfcccf4e8fc19362d1/buy-on-primary-market" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \{\{token\}\}" \
-d '{
"quantity": 10
}'

Response

{
"transaction_id": "6913872755654191dede37da"
}

Note: Poll the transaction status endpoint to track purchase completion.

Error Responses

400 Bad Request

{
"error": "Invalid parameters",
"details": "Quantity must be greater than 0"
}

401 Unauthorized

{
"error": "Authentication required"
}

403 Forbidden

{
"error": "Access denied",
"details": "Insufficient permissions to purchase tokens"
}

404 Not Found

{
"error": "Resource not found",
"details": "Token not available for primary market purchase"
}

422 Unprocessable Entity

{
"error": "Purchase not possible",
"details": "Insufficient token supply available"
}

500 Internal Server Error

{
"error": "Internal server error"
}

Important Notes

  • Async Processing: Purchase is processed asynchronously; use transaction_id to poll status
  • Primary Market: Tokens are purchased at the initial offering price set by the issuer
  • Supply Check: System verifies sufficient token supply is available
  • Transaction Polling: Poll GET /v2/admin/tokens/{tokenID}/transactions/{transactionID} for completion
  • Purchase Limits: Subject to token's min_purchase_quantity and max_purchase_quantity
  • KYC Requirements: Users may need KYC verification depending on token configuration