POST
/
v1
/
allocations
/
net
curl --request POST \
  --url https://api.prime.coinbase.com/v1/allocations/net \
  --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,
    "netting_id": "<string>",
    "buy_allocation_id": "<string>",
    "sell_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();

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

CreateNetAllocationResponse response = allocationsService.createNetAllocation(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.