# Migrate card to different program [beta] Migrate a card to a different program. It is possible to migrate from a Zero balance program to a Full balance program and vice-versa. This endpoint generates two events: * [Card can be added to next scheduled embossing](https://developers.pismo.io/events/docs/cards-embossing-card-ingress-1) event containing the field `operation_type` = `CARD_PROGRAM_MIGRATION` if the card has not yet been embossed. * [Card migrated](https://developers.pismo.io/events/docs/cards-migration-1) event. **Notes:** * This endpoint **REQUIRES** an account token - an access token encoded with a Pismo account ID. * For combination cards, this endpoint migrates the [card mode](doc:cards-overview-1#create-a-combination-card-with-card-modes) the card was originally created with. To migrate the secondary mode, call the [Migrate card mode](ref:patch-migrate-card-mode) endpoint. # 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 }, "customerIdHeader": { "in": "header", "name": "x-customer-id", "schema": { "type": "integer" }, "required": true, "description": "Pismo customer ID" } }, "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}/program-migration": { "patch": { "summary": "Migrate card to different program [beta]", "description": "Migrate a card to a different program. It is possible to migrate from a Zero balance program to a Full balance program and vice-versa.\n \nThis endpoint generates two events:\n\n * [Card can be added to next scheduled embossing](https://developers.pismo.io/events/docs/cards-embossing-card-ingress-1) event containing the field `operation_type` = `CARD_PROGRAM_MIGRATION` if the card has not yet been embossed.\n\n * [Card migrated](https://developers.pismo.io/events/docs/cards-migration-1) event. \n\n**Notes:** \n\n * This endpoint **REQUIRES** an account token - an access token encoded with a Pismo account ID.\n\n * For combination cards, this endpoint migrates the [card mode](https://developers.pismo.io/pismo-docs/docs/cards-overview-1#create-a-combination-card-with-card-modes) the card was originally created with. To migrate the secondary mode, call the [Migrate card mode](https://developers.pismo.io/pismo-docs/reference/patch-migrate-card-mode) endpoint.\n", "operationId": "patch-migrate-card", "tags": [ "Migration" ], "parameters": [ { "$ref": "#/components/parameters/cardId" }, { "$ref": "#/components/parameters/customerIdHeader" } ], "requestBody": { "description": "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" } } } } } } ```