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 confirmation of the primary market purchase.

Success Response (200 OK)

{
"success": true,
"message": "Primary market purchase successful",
"data": {
"purchase_id": "string",
"user_id": "string",
"token_id": "string",
"quantity": "number",
"unit_price": {
"amount": "number",
"decimal": "number",
"symbol": "string"
},
"total_cost": {
"amount": "number",
"decimal": "number",
"symbol": "string"
},
"fees": {
"platform_fee": {
"amount": "number",
"decimal": "number",
"symbol": "string"
},
"node_fee": {
"amount": "number",
"decimal": "number",
"symbol": "string"
}
},
"net_amount": {
"amount": "number",
"decimal": "number",
"symbol": "string"
},
"status": "string",
"transaction_hash": "string",
"purchase_date": "string",
"estimated_delivery": "string"
}
}

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

{
"success": true,
"message": "Primary market purchase successful",
"data": {
"purchase_id": "pm_purchase_789",
"user_id": "680c02896d91ca0145cfeb81",
"token_id": "68ae06cfcccf4e8fc19362d1",
"quantity": 10,
"unit_price": {
"amount": 10.0,
"decimal": 6,
"symbol": "USDT"
},
"total_cost": {
"amount": 100.0,
"decimal": 6,
"symbol": "USDT"
},
"fees": {
"platform_fee": {
"amount": 3.0,
"decimal": 6,
"symbol": "USDT"
},
"node_fee": {
"amount": 2.0,
"decimal": 6,
"symbol": "USDT"
}
},
"net_amount": {
"amount": 105.0,
"decimal": 6,
"symbol": "USDT"
},
"status": "completed",
"transaction_hash": "0x1234567890abcdef1234567890abcdef12345678",
"purchase_date": "2024-01-15T16:30:00Z",
"estimated_delivery": "2024-01-15T16:35:00Z"
}
}

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

  • Primary Market: Tokens are purchased at the initial offering price set by the issuer
  • Supply Check: System verifies sufficient token supply is available
  • Payment Processing: Payment is processed immediately upon successful validation
  • Token Delivery: Tokens are typically delivered within minutes of purchase
  • Fee Structure: Includes platform and node fees as configured
  • Purchase Limits: May be subject to minimum and maximum purchase quantities
  • KYC Requirements: Users may need to complete KYC verification for large purchases