Skip to main content

Split crypto payments

Start with scenario setup. This example assumes a fresh quote for exactly 25 tokens and no existing deposits.

Send these two bodies to POST /v1/collections/simulate-crypto-deposit in order, using the same quotePaymentId and a different deposit ID each time:

{
"paymentRequestReference": "ORDER-10045",
"quotePaymentId": "49122879-6ca4-40d3-a20d-e011501cd185",
"depositId": "0492f319-60c7-423a-8f9f-61d41901475e",
"cryptoAmount": 10,
"status": "CONFIRMED"
}
{
"paymentRequestReference": "ORDER-10045",
"quotePaymentId": "49122879-6ca4-40d3-a20d-e011501cd185",
"depositId": "47e9aa5d-3138-4e22-92a0-1c20ad4699d4",
"cryptoAmount": 15,
"status": "CONFIRMED"
}

After the first deposit, expect paymentRequestStatus: PART_PAID. After the second, expect paymentRequestStatus: PAID. Each confirmation queues payment webhooks. Hubpay also queues payment_request.part_paid after the first deposit and payment_request.paid after the second. Save both returned payment IDs so you can match each deposit to your test records.

Use either deposit's paymentId for completion. Both IDs identify deposits for the same quote, so completion settles them together. All deposits for that quote must be confirmed first. A pending deposit counts towards the quote's deposit limit, but does not count as confirmed funds.

Retry each deposit with its original ID to verify that received totals do not increase. The sum of pending and confirmed deposits cannot exceed the quote quantity. To finish with only the first deposit, follow quote expiry and partial settlement.