Sell
The Sell endpoint allows users to liquidate their digital assets by converting a successful calculation into a pending invoice. This process ensures users have the opportunity to confirm the final weight and currency amount before the sale is finalized.
Invoice Status: Similar to the purchase process, sell invoices start in a pending state. You must subsequently notify Treasury to confirm or cancel the transaction based on the user's final decision.
Create Sell Invoice
POST /asset/transaction/sell
Headers
| Header / Type | Condition | Description |
|---|---|---|
Authorizationstring | required | Bearer token retrieved from the Authentication endpoint. |
X-User-Idstring | optional-when X-Partner-User-Id | Unique user identifier from Treasury. |
X-Partner-User-Idstring | optional-when X-User-Id | Your internal user identifier. |
Request Body
| Field / Type | Condition | Description |
|---|---|---|
calculate_uidstring | required | The unique ID received from the Calculate process. |
reference_idstring | optional | Your internal invoice or transaction number from the partner side. Highly recommended to prevent reconciliation mismatches. |
Response
Sample Response (200 OK)
json
{
"code": 200,
"data": {
"status" : "pending",
"invoice_code": "GSA...",
"reference_id": "x...",
"transaction" : {
"asset_type" : "gold",
"asset_grams" : 0.05,
"amount" : 132481,
"commission_amount": 2103,
"adjustment_amount": 500,
"buy_price" : 2633639,
"sell_price" : 2549192,
"transaction_at" : "2026-01-01T12:00:00+07:00",
"expired_at" : "2026-01-01T12:10:00+07:00"
}
}
}