# Enroll card in Visa CTP Enroll a customer card in Visa Click to Pay. This endpoint generates a [Click to Pay event generated](https://developers.pismo.io/events/docs/cards-tokenization-click-to-pay-1) event. **Notes**: - If `billing_address` is not passed, it is looked for internally. If not found, an error is returned. - This endpoint takes an account token - an access token encoded with a Pismo account ID. - The process is asynchronous, success or failure is indicated in the generated event. - This is a PCI endpoint, use the https://gw-pci.pismolabs.io environment. # 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": "Visa Click to Pay", "description": "Visa Click to Pay service endpoints" } ], "components": { "parameters": { "CidHeader": { "name": "x-cid", "in": "header", "schema": { "type": "string" }, "description": "Request correlation ID used for tracking on Pismo platform." }, "CustomerIDheader": { "name": "x-customer-id", "in": "header", "required": true, "schema": { "type": "integer" }, "description": "Customer ID" }, "TenantHeader": { "name": "x-tenant", "in": "header", "schema": { "type": "string" }, "description": "Pismo organization/tenant ID", "required": true } }, "schemas": { "CardID": { "type": "number", "description": "Card ID", "example": 6743052 }, "ClickToPayAddress": { "type": "object", "properties": { "city": { "type": "string", "description": "City", "minLength": 1, "maxLength": 32, "example": "San Francisco" }, "state": { "type": "string", "description": "State - ISO 3166-2 code format. For example - `RJ` (Rio de Janiero, Brazil)", "format": "ISO 3166-2", "minLength": 1, "maxLength": 3, "example": "RJ" }, "postal_code": { "type": "string", "description": "Postal code", "minLength": 1, "maxLength": 9, "example": "94105" }, "country_code": { "type": "string", "format": "ISO 3166-1-alpha3,", "description": "Country code - 3-character ISO 3166 (Alpha 3) format", "minLength": 1, "maxLength": 3, "example": "USA" }, "address_line1": { "type": "string", "description": "Address line one", "minLength": 1, "maxLength": 64, "example": "1000 Market Street" }, "address_line2": { "type": "string", "description": "Address line two", "minLength": 1, "maxLength": 64, "example": "Building 56" }, "address_line3": { "type": "string", "description": "Address line three", "minLength": 1, "maxLength": 64, "example": "Suite 101" } } }, "ClickToPayBadRequest": { "type": "object", "properties": { "code": { "type": "number", "description": "HTTP response code", "example": 400 }, "message": { "type": "string", "description": "Error description" }, "details": { "type": "array", "description": "Error details", "items": { "type": "string" } } } }, "ClickToPayEnrollCardRequest": { "type": "object", "required": [ "card_id", "owner_bid" ], "properties": { "owner_bid": { "$ref": "#/components/schemas/OwnerBid" }, "card_id": { "$ref": "#/components/schemas/CardID" }, "billing_address": { "$ref": "#/components/schemas/ClickToPayAddress" } } }, "ClickToPayInternalServerError": { "type": "object", "description": "Click to Pay internal server error", "properties": { "code": { "type": "number", "description": "HTTP response code", "example": 500 }, "message": { "type": "string", "description": "Error description", "example": "Internal server error" } } }, "OwnerBid": { "type": "string", "description": "Owner business ID. Identifies the issuing entity creating or managing enrollment in Click to Pay.\n", "example": "1000052" } }, "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" } } }, "security": [ { "BearerAuth": [] } ], "paths": { "/v1/clicktopay/visa/enroll/card": { "post": { "summary": "Enroll card in Visa CTP", "description": "Enroll a customer card in Visa Click to Pay.\n\nThis endpoint generates a [Click to Pay event generated](https://developers.pismo.io/events/docs/cards-tokenization-click-to-pay-1) event.\n\n **Notes**:\n\n- If `billing_address` is not passed, it is looked for internally. If not found, an error is returned. \n\n- This endpoint takes an account token - an access token encoded with a Pismo account ID.\n\n- The process is asynchronous, success or failure is indicated in the generated event.\n\n- This is a PCI endpoint, use the https://gw-pci.pismolabs.io environment.\n", "operationId": "post-v1-clicktopay-enroll_card", "tags": [ "Visa Click to Pay" ], "parameters": [ { "$ref": "#/components/parameters/TenantHeader" }, { "$ref": "#/components/parameters/CustomerIDheader" }, { "$ref": "#/components/parameters/CidHeader" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClickToPayEnrollCardRequest" } } } }, "responses": { "202": { "description": "Accepted" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClickToPayBadRequest" }, "examples": { "bad_request": { "value": { "code": 400, "message": "bad request" } }, "invalid_network": { "value": { "code": 400, "message": "invalid network" } }, "bad_request_detailed": { "value": { "code": 400, "message": "bad request", "details": [ "AccountID: cannot be blank", "CustomerID: cannot be blank", "OrgID: cannot be blank." ] } }, "customer_not_in_click_to_pay": { "value": { "code": 400, "message": "customer not enabled to click to pay" } }, "click_to_pay_not_enabled_to_tenant": { "value": { "code": 400, "message": "click to pay is not enabled to tenant" } } } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClickToPayInternalServerError" }, "examples": { "internal_server_error": { "value": { "code": 500, "message": "internal server error" } } } } } } } } } } } ```