POST
/
v1
/
allocations
curl --request POST \
  --url https://api.prime.coinbase.com/v1/allocations \
  --header 'Content-Type: application/json' \
  --data '{
  "allocation_id": "<string>",
  "source_portfolio_id": "<string>",
  "product_id": "<string>",
  "order_ids": [
    "<string>"
  ],
  "allocation_legs": [
    {
      "allocation_leg_id": "<string>",
      "destination_portfolio_id": "<string>",
      "amount": "<string>"
    }
  ],
  "size_type": "ALLOCATION_SIZE_TYPE_UNKNOWN",
  "remainder_destination_portfolio": "<string>",
  "netting_id": "<string>"
}'
{
  "body": {
    "success": true,
    "allocation_id": "<string>",
    "failure_reason": "<string>"
  }
}

Use the Prime SDK or CLI to test this endpoint by following the quickstart guide and running with the following examples

AllocationsService allocationsService = PrimeServiceFactory.createAllocationsService(client);

String allocationId = UUID.randomUUID().toString();
String allocationLegId = UUID.randomUUID().toString();

AllocationLeg allocationLeg = new AllocationLeg.Builder()
        .allocationLegId(allocationLegId)
        .amount("100")
        .destinationPortfolioId("DESTINATION_PORTFOLIO_ID_HERE")
        .build();

CreateAllocationRequest request = new CreateAllocationRequest.Builder()
        .sourcePortfolioId("SOURCE_PORTFOLIO_ID_HERE")
        .allocationId(allocationId)
        .allocationLegs(new AllocationLeg[]{allocationLeg})
        .productId("ETH-USD")
        .build();

CreateAllocationResponse response = allocationsService.createAllocation(request);

For more information, please visit the Prime Java SDK.

Body

application/json

Response

200
application/json

A successful response.

The response is of type object.