# Create card relationships Create relationships between primary and secondary cards. # OpenAPI definition ```json { "openapi": "3.0.0", "info": { "title": "Card issuing - Visa Flexible Credentials [beta]", "description": "Visa Flexible Credentials endpoints.", "version": "1.0.0", "contact": { "email": "support@pismo.com.br", "name": "API Support", "url": "https://developers.pismo.io/support" }, "license": { "name": "Copyright Pismo", "url": "https://developers.pismo.io/licenses" }, "termsOfService": "https://developers.pismo.io/terms" }, "servers": [ { "url": "https://sandbox.pismolabs.io", "description": "Sandbox API server for testing" } ], "tags": [ { "name": "Relationships", "description": "Creation and management of relationship between primary and secondary cards." } ], "components": { "parameters": { "accessTokenHeader": { "name": "access_token", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Access token. Tokens can expire quickly, which can result in a **401 Unauthorized** error." }, "CardIDpath": { "name": "cardId", "in": "path", "schema": { "type": "string" }, "description": "Card ID", "required": true } }, "schemas": { "CardID2": { "type": "integer", "format": "int64", "description": "ID of card to create relationship for", "example": 6743052 }, "CardID3": { "type": "integer", "format": "int64", "description": "Primary card ID", "example": 6743052 }, "CardID4": { "type": "integer", "format": "int64", "description": "Secondary card ID", "example": 6743052 }, "ErrorObject": { "type": "object", "description": "Standard error object", "properties": { "error_code": { "type": "string", "description": "Error code" }, "message": { "type": "string", "description": "Error message" } } }, "IsFallback": { "type": "boolean", "description": "Is this the fallback card? Only one card can be a fallback card.", "example": false }, "RelationshipCardRequest": { "type": "object", "required": [ "cards" ], "properties": { "cards": { "type": "array", "items": { "type": "object", "required": [ "cardID", "roleType", "isFallback" ], "properties": { "cardID": { "$ref": "#/components/schemas/CardID2" }, "roleType": { "$ref": "#/components/schemas/RoleType" }, "isFallback": { "$ref": "#/components/schemas/IsFallback" } } } } } }, "RelationshipResponse": { "type": "object", "required": [ "cardID", "cards" ], "properties": { "cardID": { "$ref": "#/components/schemas/CardID3" }, "cards": { "type": "array", "items": { "type": "object", "required": [ "cardID", "roleType", "isFallback" ], "properties": { "cardID": { "$ref": "#/components/schemas/CardID4" }, "roleType": { "$ref": "#/components/schemas/RoleType" }, "isFallback": { "$ref": "#/components/schemas/IsFallback" } } } } } }, "RoleType": { "type": "string", "enum": [ "SECONDARY_DEBIT", "SECONDARY_CREDIT", "SECONDARY_LOC", "SECONDARY_INSTALLMENT", "SECONDARY_PREPAID" ], "description": "Card role type: \n* `SECONDARY_DEBIT`—Debit card\n\n* `SECONDARY_CREDIT`—Credit card\n\n* `SECONDARY_LOC`—Secondary/fallback funding source\n\n* `SECONDARY_INSTALLMENT`—Installment plan\n\n* `SECONDARY_PREPAID`—Prepaid card\n", "example": "SECONDARY_INSTALLMENT" } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Account token - token encoded with a Pismo account ID. Tokens can expire quickly, which can result in a \"**401 Unauthorized**\" error.", "bearerFormat": "JWT" } }, "responses": { "400BadRequest": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorObject" }, "example": { "error_code": "ERR9993", "message": "card not found" } } } }, "401Unauthorized": { "description": "Access token is missing or invalid", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorObject" }, "example": { "error_code": "ERR9786", "message": "Access token is missing or invalid" } } } }, "500InternalServerError": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorObject" }, "example": { "error_code": "ERR5446", "message": "Internal server error" } } } } } }, "security": [ { "BearerAuth": [] } ], "paths": { "/v1/vfc/relationship/cards/{cardId}": { "parameters": [ { "$ref": "#/components/parameters/CardIDpath" } ], "post": { "summary": "Create card relationships", "description": "Create relationships between primary and secondary cards.\n", "operationId": "create-card-relationship", "tags": [ "Relationships" ], "parameters": [ { "$ref": "#/components/parameters/accessTokenHeader" }, { "$ref": "#/components/parameters/CardIDpath" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RelationshipCardRequest" } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RelationshipResponse" }, "example": { "cardID": 186283623, "cards": [ { "cardID": 186283615, "roleType": "SECONDARY_INSTALLMENT", "isFallback": false } ] } } } }, "400": { "$ref": "#/components/responses/400BadRequest" }, "401": { "$ref": "#/components/responses/401Unauthorized" }, "500": { "$ref": "#/components/responses/500InternalServerError" } } } } } } ```