Customer Migration Service Reference
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.
This is a lookup for the file-based migration path in wallet-migration-service main at commit f63cfa3c (inspected 2026-11-26). It describes code-level behavior, not an approved production API or runbook. For the sequence, use Run and Monitor a Customer Migration.
Job endpointsβ
All paths below are relative to the service host and come from MigrationController.java. A GET method is shown even where it starts a job because that is what the current controller declares. Do not infer that these endpoints are safe to call from a browser or without the approved internal caller.
| Job or lookup | Method and path under /api/migration | Required inputs in source | Gate or output |
|---|---|---|---|
| Stage card or bank-account file | GET /job/staging | Headers: X-Merchant-Id, X-Merchant-Metadata-Keys, file-name, X-Migration-Type (CARD or BANK_ACCOUNT) | Starts the matching staging task; rejects blank metadata keys; returns 202 after scheduling. |
| Create customers | GET /job/create-customers | Headers: X-Merchant-Id, file-name; optional force-rerun | Validation normally requires STAGING_COMPLETED or CUSTOMER_CREATION_INITIATED. |
| Set up bank-account payment methods | GET /job/setup-payment-methods | Headers: X-Merchant-Id, file-name; optional force-rerun | Bank-account type; validation normally requires CUSTOMER_CREATION_COMPLETED. |
| Reconcile bank-account setup | GET /job/setup-payment-methods/reconcile | Headers: X-Merchant-Id, file-name | Requires SETUP_PAYMENT_METHOD_COMPLETED and accounted-for record counts. |
| Generate Stripe extract | POST /job/stripe-extract | Header: X-Merchant-Id; body: migrationSourceIdList (nonempty UUID list) | Requires every source to be CARD and CUSTOMER_CREATION_COMPLETED. |
| Reconcile Stripe response | GET /job/merchant-migrations/{migrationSourceId}/stripe/reconcile | Header: X-Merchant-Id, file-name; optional error-file boolean | Requires STRIPE_EXTRACT_COMPLETED at request validation; selects success/error reader. |
| Read migration status | GET /job/merchant-migrations | Header: X-Merchant-Id plus X-Migration-Source-Id or X-Migration-FileName | Returns a MerchantMigrationStatusResponse; both identifiers, if given, must match. |
| Generate merchant extract | POST /job/merchant-extract | Header: X-Merchant-Id; body: migrationSourceId UUID | Requires STRIPE_EXTRACT_COMPLETED or COMPLETED in code. |
| Generate error extract | POST /job/merchant-error-extract | Header: X-Merchant-Id; body: migrationSourceId UUID | Checks that the migration record exists; does not validate a completed status at controller entry. |
| Archive migration staging data | POST /job/merchant-migrations/{migrationSourceId}/archive | Header: X-Merchant-Id; optional force-rerun | Normally allows CUSTOMER_CREATION_COMPLETED or COMPLETED; rejects already ARCHIVED. This is a destructive data-lifecycle operation. |
The controller schedules most mutating jobs with Mono.fromRunnable(...).subscribeOn(Schedulers.boundedElastic()).subscribe() and returns 202 Accepted. A status gate inside a Spring Batch job can instead end with NOOP; a 202 is not an end-to-end success signal. Some controller validation exceptions are also returned as 202 with an error message. Interpret the response body and persisted status together.
Migration and record statusesβ
MigrationType.java defines exactly CARD and BANK_ACCOUNT. MigrationStatus.java defines these top-level values:
| Stage | Status values | Source-backed meaning |
|---|---|---|
| Staging | STAGING_INITIATED, STAGING_COMPLETED | Status record created/updated during file import. |
| Customer creation | CUSTOMER_CREATION_INITIATED, CUSTOMER_CREATION_COMPLETED | Customer-creation job started and its post-step status update completed. |
| Bank-account setup | SETUP_PAYMENT_METHOD_INITIATED, SETUP_PAYMENT_METHOD_COMPLETED | Setup job started/completed; reconciliation can then check record counts. |
| Card Stripe extract | STRIPE_EXTRACT_INITIATED, STRIPE_EXTRACT_COMPLETED | Extract generation/upload stage. This is not card reconciliation completion. |
| Terminal or lifecycle | FAILED, COMPLETED, ARCHIVE_INITIATED, ARCHIVED | Failure, reconciliation completion, or archive progress. COMPLETED alone does not assert extracts were delivered to a merchant. |
Card reconciliation sets COMPLETED when card staging COMPLETED + FAILED counts equal stagingRecordsCreatedCount. Bank-account reconciliation first checks SETUP_PAYMENT_METHOD_COMPLETED and whether skipped + completed + failed accounts for recordsCount, then updates the top-level status to COMPLETED.
The per-record StagingStatus enum is separate: CREATED, CUSTOMER_CREATED, FAILED, COMPLETED. The status response serializes their counts under currentStagingRecordsStatusCount as STAGED, CUSTOMER_CREATED, FAILED, and COMPLETED (the Java created field has JSON name STAGED). Do not confuse these row counts with the top-level migration status.
Status response fieldsβ
MerchantMigrationStatusResponse.java includes type, migrationSourceId, merchantId, fileName, status, recordsCount, stagingRecordsCreatedCount, stagingRecordsSkippedCount, currentStagingRecordsStatusCount, and uniqueCustomersCount. It also includes originalFileLocation, archiveFileLocation, stripeExtractFileLocation, merchantExtractFileLocation, merchantErrorExtractFileLocation, and stripeResponseFileArchiveLocation when populated. These are observability fields, not proof that an external consumer received a file.
Storage and persistence boundariesβ
- Staging reads an input blob under the migration container's
input/<merchantId>/<file-name>path, downloads it to temporary local storage, writes card or bank-account staging rows, and archives the input file.CustomerStagingImportTask.javacurrently hardcodes the container namecustomer-migration; deployment configuration also declares a configurable migration-container property. Confirm the deployed value before operational use. - Stripe reconciliation downloads a response file from the migration container's
input/<merchantId>/<file-name>path, updates staging rows, and archives that response file. - The service stores its top-level migration state in
MERCHANT_MIGRATION_STATUSand uses Flyway migrations for the PostgreSQLmigrationschema. Do not edit status or staging tables manually from this reference. - The service creates Stripe and merchant extract files and uploads them to Blob Storage, updating location fields. The code does not establish the external Stripe processor, merchant delivery channel, or retention policy.
Historical throughput figures β not validatedβ
An earlier merchant-facing migration file-format page listed these approximate observations: customer creation up to 65 records per second, payment-method creation up to 30 records per second, and about 1 million records over 24 hours in a previous migration. That page did not identify the measurement date, workload, environment configuration, or benchmark evidence. The inspected repository does not establish these as current production rates or a delivery commitment.
Confirm current capacity and a migration-specific completion estimate with the migration engineering team before using these figures for planning or communicating a timeline.
Source mapβ
Paths below are relative to the wallet-migration-service repository at f63cfa3c:
| Question | Primary source |
|---|---|
| Methods, paths, headers, asynchronous responses | src/main/java/com/optum/ccg/migration/controller/MigrationController.java |
| Status/type enums and response shape | repository/entity/migrationstatus/{MigrationStatus,MigrationType,MerchantMigrationStatus}.java, controller/response/{MerchantMigrationStatusResponse,CurrentStagingRecordsStatusCount}.java |
| File import and staging | task/common/staging/CustomerStagingImportTask.java, task/card/staging/CardCustomerStagingImportTask.java, task/bankaccount/staging/BankAccountCustomerStagingImportTask.java |
| Customer creation and validation | task/common/customercreation/CustomerCreationTask.java, task/common/customercreation/tasklet/ValidateCustomerCreationTasklet.java |
| Card branch | task/card/extract/stripe/StripeExtractTask.java, service/StripeExtractService.java, task/card/stripe/StripeReconciliationTask.java |
| Bank-account branch | task/bankaccount/setuppaymentmethod/SetupPaymentMethodTask.java, task/bankaccount/reconciliation/SetupPaymentMethodReconciliationTask.java |
| Extracts and archive | task/card/extract/merchant/{MerchantExtractTask,MerchantErrorExtractTask}.java, task/common/archive/CustomerArchiveTask.java |
The source map's shortened paths after src/main/java/com/optum/ccg/migration/ share that prefix.