# Transfer account to different program
Change the program ID for an account. This also changes the program ID for customers and statements associated with the account. Note that the account keeps the original program's flex controls and ignores the new program's flex controls.
Transfer is permitted **only** if both programs (origin and target) have the same:
* [Program type](doc:program-types)—For example, you can migrate from credit to credit and from prepaid to prepaid, but not credit to prepaid.
* Currency—For example, USD to USD only or BRL to BRL only.
* Brand (if applicable)—For example, Mastercard to Mastercard.
* Due date (credit programs only)—Account due date must be available in the target program.
**Notes:**
* Transferring an account does not affect account limits
* When an account is transferred successfully, you need to issue a new card that corresponds to the new program for your customers.
This endpoint generates an [Account migrated to different program](https://developers.pismo.io/events/docs/account-program-migration-1) event.
# OpenAPI definition
```json
{
"openapi": "3.1.0",
"info": {
"title": "Core platform - Accounts",
"version": "1.0.0",
"description": "API used to manage accounts domain",
"contact": {
"name": "API Support",
"url": "https://developers.pismo.io/support/"
},
"license": {
"name": "Copyright Pismo"
}
},
"servers": [
{
"url": "https://sandbox.pismolabs.io",
"description": "API server for testing"
}
],
"tags": [
{
"name": "Transfer account",
"description": "Endpoints dealing with account transfer"
}
],
"components": {
"schemas": {
"AccountID": {
"type": "integer",
"format": "int64",
"description": "Account ID",
"example": 1001
},
"MigrateAccountRequest": {
"type": "object",
"description": "Migrate account request budy",
"required": [
"account_id",
"program"
],
"properties": {
"account_id": {
"$ref": "#/components/schemas/AccountID"
},
"program": {
"description": "Program object",
"properties": {
"id": {
"$ref": "#/components/schemas/ProgramID"
}
}
}
}
},
"ProgramID": {
"type": "integer",
"format": "int64",
"description": "Program ID",
"example": 12345
}
},
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
},
"security": [
{
"BearerAuth": []
}
],
"x-readme": {
"explorer-enabled": true,
"proxy-enabled": true,
"samples-enabled": true
},
"paths": {
"/accounts/v1/accounts/programs/migration": {
"post": {
"tags": [
"Transfer account"
],
"summary": "Transfer account to different program",
"operationId": "PostMigrationProgram",
"description": "Change the program ID for an account. This also changes the program ID for customers and statements associated with the account. Note that the account keeps the original program's flex controls and ignores the new program's flex controls.\n\nTransfer is permitted **only** if both programs (origin and target) have the same:\n\n * [Program type](https://developers.pismo.io/pismo-docs/docs/program-types)—For example, you can migrate from credit to credit and from prepaid to prepaid, but not credit to prepaid.\n * Currency—For example, USD to USD only or BRL to BRL only.\n * Brand (if applicable)—For example, Mastercard to Mastercard.\n * Due date (credit programs only)—Account due date must be available in the target program.\n\n**Notes:**\n\n* Transferring an account does not affect account limits\n* When an account is transferred successfully, you need to issue a new card that corresponds to the new program for your customers. \n\nThis endpoint generates an [Account migrated to different program](https://developers.pismo.io/events/docs/account-program-migration-1) event.\n",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MigrateAccountRequest"
}
}
}
},
"responses": {
"200": {
"description": "Program was successfully migrated",
"content": {
"application/json": {
"schema": {
"properties": {
"account_id": {
"$ref": "#/components/schemas/AccountID"
},
"program": {
"description": "Program object",
"properties": {
"id": {
"$ref": "#/components/schemas/ProgramID"
}
}
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "account_id is required"
},
"field": {
"type": "string",
"example": "account_id"
}
}
}
}
}
},
"404": {
"description": "Resource not found",
"content": {
"application/json": {
"examples": {
"error1": {
"summary": "Account not found",
"value": {
"message": "Account with id: 1 not found"
}
},
"error2": {
"summary": "ProgramId not found",
"value": {
"message": "Program with id: 1 not found"
}
},
"error3": {
"summary": "ProgramDueDate not found for program",
"value": {
"message": "ProgramDueDate not found for the programId: 1"
}
},
"error4": {
"summary": "Calendar not found",
"value": {
"message": "Calendars not found for programId: 1"
}
}
}
}
}
},
"409": {
"description": "Conflict",
"content": {
"application/json": {
"examples": {
"error1": {
"summary": "Account is not credit type",
"value": {
"message": "This account is not credit type"
}
},
"error2": {
"summary": "The program is the same as the current one",
"value": {
"message": "The program is the same as the current one"
}
},
"error3": {
"summary": "New program is not credit type",
"value": {
"message": "The program is not credit type"
}
},
"error4": {
"summary": "Standard calendar selection parameter is active",
"value": {
"message": "Standard calendar selection parameter is active"
}
},
"error5": {
"summary": "New program does not have the same due date day",
"value": {
"message": "New program does not have the same due date day"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "Found an error when trying to migrate program"
}
}
}
}
}
}
}
}
}
}
}
```