Checking access…

Skip to main content
Audience: CCG Platform Engineers

Customer Migration Service Reference

Repository-derived draft β€” engineering review pending

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 lookupMethod and path under /api/migrationRequired inputs in sourceGate or output
Stage card or bank-account fileGET /job/stagingHeaders: 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 customersGET /job/create-customersHeaders: X-Merchant-Id, file-name; optional force-rerunValidation normally requires STAGING_COMPLETED or CUSTOMER_CREATION_INITIATED.
Set up bank-account payment methodsGET /job/setup-payment-methodsHeaders: X-Merchant-Id, file-name; optional force-rerunBank-account type; validation normally requires CUSTOMER_CREATION_COMPLETED.
Reconcile bank-account setupGET /job/setup-payment-methods/reconcileHeaders: X-Merchant-Id, file-nameRequires SETUP_PAYMENT_METHOD_COMPLETED and accounted-for record counts.
Generate Stripe extractPOST /job/stripe-extractHeader: X-Merchant-Id; body: migrationSourceIdList (nonempty UUID list)Requires every source to be CARD and CUSTOMER_CREATION_COMPLETED.
Reconcile Stripe responseGET /job/merchant-migrations/{migrationSourceId}/stripe/reconcileHeader: X-Merchant-Id, file-name; optional error-file booleanRequires STRIPE_EXTRACT_COMPLETED at request validation; selects success/error reader.
Read migration statusGET /job/merchant-migrationsHeader: X-Merchant-Id plus X-Migration-Source-Id or X-Migration-FileNameReturns a MerchantMigrationStatusResponse; both identifiers, if given, must match.
Generate merchant extractPOST /job/merchant-extractHeader: X-Merchant-Id; body: migrationSourceId UUIDRequires STRIPE_EXTRACT_COMPLETED or COMPLETED in code.
Generate error extractPOST /job/merchant-error-extractHeader: X-Merchant-Id; body: migrationSourceId UUIDChecks that the migration record exists; does not validate a completed status at controller entry.
Archive migration staging dataPOST /job/merchant-migrations/{migrationSourceId}/archiveHeader: X-Merchant-Id; optional force-rerunNormally 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:

StageStatus valuesSource-backed meaning
StagingSTAGING_INITIATED, STAGING_COMPLETEDStatus record created/updated during file import.
Customer creationCUSTOMER_CREATION_INITIATED, CUSTOMER_CREATION_COMPLETEDCustomer-creation job started and its post-step status update completed.
Bank-account setupSETUP_PAYMENT_METHOD_INITIATED, SETUP_PAYMENT_METHOD_COMPLETEDSetup job started/completed; reconciliation can then check record counts.
Card Stripe extractSTRIPE_EXTRACT_INITIATED, STRIPE_EXTRACT_COMPLETEDExtract generation/upload stage. This is not card reconciliation completion.
Terminal or lifecycleFAILED, COMPLETED, ARCHIVE_INITIATED, ARCHIVEDFailure, 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.java currently hardcodes the container name customer-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_STATUS and uses Flyway migrations for the PostgreSQL migration schema. 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:

QuestionPrimary source
Methods, paths, headers, asynchronous responsessrc/main/java/com/optum/ccg/migration/controller/MigrationController.java
Status/type enums and response shaperepository/entity/migrationstatus/{MigrationStatus,MigrationType,MerchantMigrationStatus}.java, controller/response/{MerchantMigrationStatusResponse,CurrentStagingRecordsStatusCount}.java
File import and stagingtask/common/staging/CustomerStagingImportTask.java, task/card/staging/CardCustomerStagingImportTask.java, task/bankaccount/staging/BankAccountCustomerStagingImportTask.java
Customer creation and validationtask/common/customercreation/CustomerCreationTask.java, task/common/customercreation/tasklet/ValidateCustomerCreationTasklet.java
Card branchtask/card/extract/stripe/StripeExtractTask.java, service/StripeExtractService.java, task/card/stripe/StripeReconciliationTask.java
Bank-account branchtask/bankaccount/setuppaymentmethod/SetupPaymentMethodTask.java, task/bankaccount/reconciliation/SetupPaymentMethodReconciliationTask.java
Extracts and archivetask/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.