Prerequisites
Before you begin, ensure that you’ve:- Completed the
Borrow USDC against cirBTC collateral
quickstart and hold at least one loan in
activestatus. - Held sufficient USDC in your Mint balance to cover the repayment amount you plan to submit.
Steps
1
Choose a repayment mode
Decide whether you want to repay in full or partially, then call
The endpoint returns an Save the job
POST /v1/borrow/loans/{id}/repayments
with the corresponding mode.- Full repay: set
mode: FULL. Circle measures the outstanding debt at the moment it builds the UserOperation and repays that exact amount. On success, Circle releases the loan’s cirBTC collateral back to your Mint balance and the loan transitions toclosed. - Partial repay: set
mode: PARTIALand include theamountyou want to apply in rawuint256base units. The loan staysactivewith a reduced debt. No collateral is released.
- Full repay
- Partial repay
onchainJob with jobType: repay:id. You poll it in the next step.2
Poll the job to completion
Circle builds, signs, and submits the onchain UserOperation for the repayment.
The job progresses through
submitted and confirmed to completed. Poll
GET /v1/borrow/jobs/{id}
until you see the terminal state.3
Confirm the outcome
Fetch the loan to inspect the updated position:For a full repay, the loan’s
status is closed and debtAmount is zero. The
cirBTC collateral is credited back to your Mint balance. Confirm the credit by
calling GET /v1/businessAccount/balances.For a partial repay, the loan’s status remains active and debtAmount
reflects the reduced outstanding balance. No collateral change occurs.