Run and Monitor a Customer Migration
This guide was generated from the wallet-migration-service repository. Engineering has not reviewed or approved the described flow, operational steps, or environment behavior. Confirm the details with the migration engineering team before using or referring to this guide for a migration or incident.
Use this sequence to understand and check an approved internal migration run. It describes the service's callable jobs and status gates; it does not authorize manual production execution. The external file handoff, caller identity, endpoint access, Stripe handoff, and merchant notification process must be confirmed with migration engineering.
Source snapshot: wallet-migration-service main at f63cfa3c, inspected 2026-11-26. See the reference for exact request fields and source files.
Before the first jobβ
- Confirm the approved migration type is
CARDorBANK_ACCOUNT, and record the merchant ID, input file name, and merchant metadata keys. The service accepts these values as headers on the staging request. - Confirm the input file has reached the service's configured migration Blob container and input path. The application code downloads the file during staging; this repository does not prove how an ECG QuickConnect/SFTP delivery reaches that location.
- Confirm the deployed service revision, authorized caller, and run owner with engineering. Do not infer production permissions or sequencing from the
README.mdexamples.
Run the common stagesβ
| Order | Job start | Wait for / verify before continuing |
|---|---|---|
| 1 | GET /api/migration/job/staging with X-Merchant-Id, X-Merchant-Metadata-Keys, file-name, and X-Migration-Type | Query migration status. Normally wait for STAGING_COMPLETED; inspect recordsCount, stagingRecordsCreatedCount, and stagingRecordsSkippedCount. A 202 start response is insufficient. |
| 2 | GET /api/migration/job/create-customers with X-Merchant-Id and file-name | Wait for CUSTOMER_CREATION_COMPLETED. Inspect currentStagingRecordsStatusCount for STAGED, CUSTOMER_CREATED, FAILED, and COMPLETED row counts. |
To read progress, call GET /api/migration/job/merchant-migrations with X-Merchant-Id and either X-Migration-Source-Id or X-Migration-FileName. If both identifiers are supplied, the service looks up a record matching both. Keep the returned migrationSourceId for later card reconciliation, extracts, and archive.
The controller schedules most jobs asynchronously and immediately returns 202 Accepted. The job can later fail or finish without advancing the migration status. A FAILED status, unexpected counts, or a status that does not advance needs investigation before starting the next job.
Continue a card migrationβ
- Once the source is
CUSTOMER_CREATION_COMPLETED, the Stripe extract endpoint accepts a list of migration source IDs for the merchant:POST /api/migration/job/stripe-extract. The service validates that each ID has that status and typeCARD. - Wait for
STRIPE_EXTRACT_COMPLETED, then checkstripeExtractFileLocationin the status response. The code uploads an extract; who moves it to Stripe and how cards are attached is an external handoff to confirm. - When an approved Stripe response file is available, the service can reconcile it through
GET /api/migration/job/merchant-migrations/{migrationSourceId}/stripe/reconcilewithX-Merchant-Id,file-name, and the optionalerror-fileheader. The task selects a success-file or error-file reader based on that header. Confirm the file-processing order and required files with engineering before use. - The reconciliation status update sets
COMPLETEDonly when the number of completed plus failed card staging rows equalsstagingRecordsCreatedCount. If it remains atSTRIPE_EXTRACT_COMPLETED, compare those counts and investigate the missing results.
Continue a bank-account migrationβ
- Once the source is
CUSTOMER_CREATION_COMPLETED, the service exposesGET /api/migration/job/setup-payment-methodswithX-Merchant-Idandfile-name. - Wait for
SETUP_PAYMENT_METHOD_COMPLETED. A validation step checks customer creation first unlessforce-rerunis set. Do not useforce-rerunas a normal shortcut. - The service exposes
GET /api/migration/job/setup-payment-methods/reconcilewith the same merchant and file headers. Its first step checks the completed setup status and whether skipped, completed, and failed record counts account for the input count. It can finish without progressing if those checks fail. - Wait for
COMPLETEDand inspect row counts for unexpected failures before treating the run as complete.
Confirm outputsβ
The service has separate POST /api/migration/job/merchant-extract and POST /api/migration/job/merchant-error-extract endpoints. The merchant extract start validates STRIPE_EXTRACT_COMPLETED or COMPLETED; the error extract start checks that the migration record exists. Both jobs upload their result file and store a location in the migration status. These code gates do not establish the approved release sequence or merchant delivery process. Confirm with engineering when each output is required and who delivers it; use the merchant extract guide for the consumer-facing meaning.
Archive is also a separate job. It copies and deletes staging data and has status/force-rerun checks. Do not treat archive as an automatic final step or run it before engineering confirms retention, extract, and replay requirements.
When a gate failsβ
Stop the sequence and use Troubleshoot a Migration Run. Preserve the merchant ID, file name, migration source ID, last status, record counts, and job timestamp for the migration team. Do not retry or force rerun a partially completed job based only on this draft.