# Perform token operation Perform token operation. **Notes**: * This is a PCI endpoint, use the https://gw-pci.pismolabs.io/cards-tokenization environment. * This endpoint takes an account token - an access token encoded with a Pismo account ID # OpenAPI definition ```json { "openapi": "3.1.0", "info": { "title": "Card issuing - Tokenization", "description": "API endpoints for card tokenization.", "version": "1.0.0", "contact": { "name": "API Support", "url": "https://developers.pismo.io/support" }, "license": { "name": "Copyright Pismo" } }, "servers": [ { "url": "https://gw-pci.pismolabs.io/cards-tokenization", "description": "PCI API server for testing" }, { "url": "https://pci.pismolabs.io/cards-tokenization", "description": "Sandbox API server for testing" } ], "tags": [ { "name": "Token lifecycle", "description": "Token lifecycle endpoints" } ], "components": { "parameters": { "CardIDpath": { "name": "cardId", "in": "path", "schema": { "type": "string" }, "description": "Pismo card ID", "required": true }, "TokenIDpath": { "name": "tokenId", "in": "path", "schema": { "type": "string" }, "description": "Token ID", "required": true } }, "schemas": { "ActivationCode": { "type": "string", "description": "REQUIRED if `operation_type` is `CALL_CENTER_ACTIVATION`. These codes are known only to the issuer/caller.", "maxLength": 8, "example": "94" }, "ErrorObject": { "type": "object", "description": "Standard error object", "properties": { "error_code": { "type": "string", "description": "Error code" }, "message": { "type": "string", "description": "Error message" } } }, "OperatorID": { "type": "string", "description": "Client-generated ID for person or system performing the operation. This is for client monitoring and internal record-keeping.", "maxLength": 16 }, "OperationReason": { "type": "string", "description": "Operation reason. Be descriptive, it should be clear what the customer needs to do. For a suspended token, for example, the reason could say \"Suspended due to lost device.\"\n", "example": "Suspended due to lost device", "maxLength": 254 }, "OperationType": { "type": "string", "description": "Operation type: \n\n* `DELETE` - Delete token \n\n* `SUSPEND` - Suspend token \n\n* `RESUME` - Resume suspended token \n\n* `CALL_CENTER_ACTIVATION` - Call center verification \n\n* `CARDHOLDER_STEPUP_APP_TO_APP` - App2App verification\n\n* `TOKEN_DEVICE_BIDING_APPROVE` - Device verification, approve and activate the most recently inactive device (only Visa)\n\n* `TOKEN_DEVICE_BINDING_APPROVE_CALL_CENTER` - Device verification with call center activation, approve and activate the most recently inactive device (only Visa)\n\n* `TOKEN_DEVICE_BINDING_APPROVE_BANK_APP` - Device verification with bank app approval, approve and activate the most recently inactive device (only Visa)\n\n**Note**: For App2App token activation, set this field to `CARDHOLDER_STEPUP_APP_TO_APP` (Mastercard) and `CALL_CENTER_ACTIVATION` (Visa).\n", "enum": [ "DELETE", "SUSPEND", "RESUME", "CALL_CENTER_ACTIVATION", "CARDHOLDER_STEPUP_APP_TO_APP", "TOKEN_DEVICE_BIDING_APPROVE", "TOKEN_DEVICE_BINDING_APPROVE_BANK_APP" ], "example": "DELETE" }, "TokenOperationRequest": { "type": "object", "required": [ "operation_reason", "operation_type" ], "properties": { "operation_reason": { "$ref": "#/components/schemas/OperationReason" }, "operation_type": { "$ref": "#/components/schemas/OperationType" }, "activation_code": { "$ref": "#/components/schemas/ActivationCode" }, "operator_id": { "$ref": "#/components/schemas/OperatorID" } } } }, "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" }, "examples": { "example-1": { "value": { "error_code": "ERR93836", "message": "Card profile can't be null" } } } } } }, "401Unauthorized": { "description": "Access token is missing or invalid", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorObject" }, "examples": { "example-1": { "value": { "error_code": "ERR9786", "message": "Access token is missing or invalid" } } } } } }, "500InternalServerError": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorObject" }, "examples": { "example-1": { "value": { "error_code": "ERR5446", "message": "Internal server error" } } } } } } } }, "security": [ { "BearerAuth": [] } ], "paths": { "/v1/cards/{cardId}/network-tokens/{tokenId}": { "parameters": [ { "$ref": "#/components/parameters/CardIDpath" }, { "$ref": "#/components/parameters/TokenIDpath" } ], "post": { "tags": [ "Token lifecycle" ], "summary": "Perform token operation", "description": "Perform token operation.\n\n**Notes**: \n * This is a PCI endpoint, use the https://gw-pci.pismolabs.io/cards-tokenization environment.\n * This endpoint takes an account token - an access token encoded with a Pismo account ID\n", "operationId": "performtokenop", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenOperationRequest" } } } }, "responses": { "200": { "description": "Success" }, "400": { "$ref": "#/components/responses/400BadRequest" }, "401": { "$ref": "#/components/responses/401Unauthorized" }, "500": { "$ref": "#/components/responses/500InternalServerError" } } } } } } ```