# Migrate card mode [beta] Migrate a [card's mode](doc:cards-overview-1#create-a-combination-card-with-card-modes) to a different program. Migrate a card's secondary mode (debit or credit) to a new program. If a combination card is initially created with a credit account (has a `CREDIT` mode), it gets migrated when the [Migrate card to different program](ref:patch-migrate-card) endpoint is called. However, if you wish to migrate the debit (secondary) mode, you need to call this endpoint. This endpoint generates a [Card migrated](https://developers.pismo.io/events/docs/cards-migration-1) event. **Note:** This endpoint **REQUIRES** an account token - an access token encoded with a Pismo account ID. # OpenAPI definition ```json { "openapi": "3.0.1", "info": { "title": "Card issuing - Cards", "version": "1.4.6", "description": "Card endpoints API", "contact": { "name": "API Support", "url": "https://developers.pismo.io/support/" }, "license": { "name": "Copyright Pismo" } }, "servers": [ { "url": "https://sandbox.pismolabs.io", "description": "Sandbox API server for testing." }, { "url": "https://gw-pci.pismolabs.io", "description": "Sandbox PCI API server for testing" } ], "security": [ { "BearerAuth": [] } ], "tags": [ { "name": "Migration", "description": "Migrate card and card modes" } ], "components": { "parameters": { "cardId": { "in": "path", "name": "cardId", "schema": { "type": "string" }, "description": "Pismo card ID", "required": true }, "modeIdPath": { "in": "path", "name": "modeId", "schema": { "type": "string" }, "required": true, "description": "Card mode ID. For more information, refer to [Create a combination card with card modes](https://developers.pismo.io/pismo-docs/docs/cards-overview-1#create-a-combination-card-with-card-modes).\n" } }, "schemas": { "MigrateCardToProgramRequest": { "type": "object", "description": "Migrate card to different program object", "required": [ "new_program_id" ], "properties": { "new_program_id": { "$ref": "#/components/schemas/ProgramID" } } }, "ProgramID": { "type": "integer", "description": "Pismo program ID", "example": 7654 } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Account token - an access token encoded with a Pismo account ID. Tokens can expire quickly, which can result in an \"Unauthorized\" error.", "bearerFormat": "JWT" } }, "responses": { "400BadRequest2": { "description": "Bad Request, missing customer ID or program ID" }, "401Unauthorized": { "description": "Access token is missing or invalid" }, "403Forbidden": { "description": "You don't have permission to access this resource" }, "404NotFound": { "description": "The specified resource was not found" }, "406NotAcceptable": { "description": "Not accepetable" }, "500InternalServer": { "description": "Internal server error" } } }, "paths": { "/wallet/v2/cards/{cardId}/mode/{modeId}/program-migration": { "patch": { "summary": "Migrate card mode [beta]", "description": "Migrate a [card's mode](https://developers.pismo.io/pismo-docs/docs/cards-overview-1#create-a-combination-card-with-card-modes) to a different program.\n\nMigrate a card's secondary mode (debit or credit) to a new program. If a combination card is initially created with a credit account (has a `CREDIT` mode), it gets migrated when the [Migrate card to different program](https://developers.pismo.io/pismo-docs/reference/patch-migrate-card) endpoint is called. However, if you wish to migrate the debit (secondary) mode, you need to call this endpoint. \n\nThis endpoint generates a [Card migrated](https://developers.pismo.io/events/docs/cards-migration-1) event. \n\n**Note:** This endpoint **REQUIRES** an account token - an access token encoded with a Pismo account ID.\n", "operationId": "patch-migrate-card-mode", "tags": [ "Migration" ], "parameters": [ { "$ref": "#/components/parameters/cardId" }, { "$ref": "#/components/parameters/modeIdPath" } ], "requestBody": { "description": "Migrate card mode request body", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MigrateCardToProgramRequest" } } } }, "responses": { "202": { "description": "Success" }, "400": { "$ref": "#/components/responses/400BadRequest2" }, "401": { "$ref": "#/components/responses/401Unauthorized" }, "403": { "$ref": "#/components/responses/403Forbidden" }, "404": { "$ref": "#/components/responses/404NotFound" }, "406": { "$ref": "#/components/responses/406NotAcceptable" }, "500": { "$ref": "#/components/responses/500InternalServer" } } } } } } ```