# LOC migration API and webhooks reference

## Webhook events

Peach does not fire webhooks during the migration process itself. After migration completes successfully, webhooks begin firing for subsequent loan activity.

| Event | When it fires |
|  --- | --- |
| `loan.migration.succeeded` | Migration completed successfully |
| `loan.migration.failed` | Migration failed and was rolled back |
| Events for live activities | After successful migration, webhooks fire for all events created during replay of live activities |


## API quick reference

| Action | Method | Endpoint |
|  --- | --- | --- |
| Create borrower | `POST` | `/api/people` |
| Create contact | `POST` | `/api/people/{personId}/contacts` |
| Create payment instrument | `POST` | `/api/people/{personId}/payment-instruments` |
| Create loan (LOC) | `POST` | `/api/people/{personId}/loans` |
| List draws | `GET` | `/api/people/{personId}/loans/{loanId}/draws` |
| Create draw | `POST` | `/api/people/{personId}/loans/{loanId}/draws` |
| Create document | `POST` | `/api/people/{personId}/documents` |
| Upload document content | `POST` | `/api/people/{personId}/documents/{docId}/content` |
| Create past periods | `POST` | `/api/people/{personId}/loans/{loanId}/migration/past-periods` |
| Get past periods | `GET` | `/api/people/{personId}/loans/{loanId}/migration/past-periods` |
| Update past period | `PUT` | `/api/people/{personId}/loans/{loanId}/migration/past-periods` |
| Delete past period | `DELETE` | `/api/people/{personId}/loans/{loanId}/migration/past-periods` |
| Create migration period (LOC) | `POST` | `/api/people/{personId}/loans/{loanId}/migration/period` |
| Get migration period (LOC) | `GET` | `/api/people/{personId}/loans/{loanId}/migration/period` |
| Update migration period (LOC) | `PUT` | `/api/people/{personId}/loans/{loanId}/migration/period` |
| Create migration period (draw) | `POST` | `/api/people/{personId}/loans/{loanId}/draws/{drawId}/migration/period` |
| Get migration period (draw) | `GET` | `/api/people/{personId}/loans/{loanId}/draws/{drawId}/migration/period` |
| Update migration period (draw) | `PUT` | `/api/people/{personId}/loans/{loanId}/draws/{drawId}/migration/period` |
| Update loan status | `PUT` | `/api/people/{personId}/loans/{loanId}` |
| Create purchase | `POST` | `/api/people/{personId}/loans/{loanId}/draws/{drawId}/purchases` |
| Create past transaction | `POST` | `/api/people/{personId}/loans/{loanId}/migration/past-transaction` |
| Get past transactions | `GET` | `/api/people/{personId}/loans/{loanId}/migration/past-transaction` |
| Update past transaction | `PUT` | `/api/people/{personId}/loans/{loanId}/migration/past-transaction/{txnId}` |
| Create transaction | `POST` | `/api/people/{personId}/loans/{loanId}/transactions` |
| Create fee | `POST` | `/api/people/{personId}/loans/{loanId}/fees` |
| Migrate loan | `POST` | `/api/people/{personId}/loans/{loanId}/migrate` |
| Get loan (check status) | `GET` | `/api/people/{personId}/loans/{loanId}` |
| Get balance | `GET` | `/api/people/{personId}/loans/{loanId}/balance` |
| Create autopay | `POST` | `/api/people/{personId}/loans/{loanId}/autopay` |
| Cancel fee | `PUT` | `/api/people/{personId}/loans/{loanId}/fees/{feeId}/cancel` |
| Reverse transaction | `POST` | `/api/people/{personId}/loans/{loanId}/transactions/{txnId}/reverse` |
| Create purchase dispute | `POST` | `/api/people/{personId}/loans/{loanId}/draws/{drawId}/purchases/{purchaseId}/disputes` |
| Cancel loan | `POST` | `/api/people/{personId}/loans/{loanId}/cancel` |


## See also

- [LOC migration procedure](/loan-lifecycle/loc-migration/migration-procedure) — Where these endpoints are used in sequence.
- [LOC migration validation and troubleshooting](/loan-lifecycle/loc-migration/validation-and-troubleshooting) — Errors returned by these endpoints.