curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/allocations/{allocation_id}{
"allocation": {
"root_id": "<string>",
"reversal_id": "<string>",
"allocation_completed_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"product_id": "<string>",
"side": "BUY",
"avg_price": "<string>",
"base_quantity": "<string>",
"quote_value": "<string>",
"fees_allocated": "<string>",
"status": "ALLOCATION_STATUS_UNSPECIFIED",
"source": "<string>",
"order_ids": [
"<string>"
],
"destinations": [
{
"leg_id": "<string>",
"portfolio_id": "<string>",
"allocation_base": "<string>",
"allocation_quote": "<string>",
"fees_allocated_leg": "<string>"
}
],
"netting_id": "<string>"
}
}Retrieve an allocation by allocation ID.
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/allocations/{allocation_id}{
"allocation": {
"root_id": "<string>",
"reversal_id": "<string>",
"allocation_completed_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"product_id": "<string>",
"side": "BUY",
"avg_price": "<string>",
"base_quantity": "<string>",
"quote_value": "<string>",
"fees_allocated": "<string>",
"status": "ALLOCATION_STATUS_UNSPECIFIED",
"source": "<string>",
"order_ids": [
"<string>"
],
"destinations": [
{
"leg_id": "<string>",
"portfolio_id": "<string>",
"allocation_base": "<string>",
"allocation_quote": "<string>",
"fees_allocated_leg": "<string>"
}
],
"netting_id": "<string>"
}
}AllocationsService allocationsService = PrimeServiceFactory.createAllocationsService(client);
GetAllocationRequest request = new GetAllocationRequest.Builder("PORTFOLIO_ID_HERE", "ALLOCATION_ID_HERE").build();
GetAllocationResponse response = allocationsService.getAllocation(request);
var allocationsService = new AllocationsService(client);
var request = new GetAllocationRequest("PORTFOLIO_ID_HERE", "ALLOCATION_ID_HERE");
var response = allocationsService.GetAllocation(request);
allocationsService := allocations.NewAllocationsService(client)
request := &allocations.GetPortfolioAllocationRequest{
PortfolioId: "PORTFOLIO_ID_HERE",
AllocationId: "ALLOCATION_ID_HERE",
}
response, err := allocationsService.GetPortfolioAllocation(context.Background(), request)
prime_client = PrimeClient(credentials)
request = GetAllocationByIdRequest(
portfolio_id="PORTFOLIO_ID_HERE",
allocation_id="ALLOCATION_ID_HERE",
)
response = prime_client.get_allocation_by_id(request)
primectl get-allocation --help
const allocationService = new AllocationService(client);
allocationService.getAllocation({
allocationId: "ALLOCATION_ID_HERE",
portfolioId: "PORTFOLIO_ID_HERE"
}).then(async (response) => {
console.log('Allocation: ', response);
})
Was this page helpful?