# Append update PIN script Append issuer script to update the card PIN that will be applied at the next authorization. You must work with Pismo to pre-register a script and get its script ID. For information on generating a PINBlock and key ID, refer to the [PIN/PINBlock tutorial](doc:pinpinblock-tutorial) guide. For more information, refer to the [Card scripts](doc:card-scripts) guide. **Note:** This is a PCI endpoint, use the https://gw-pci.pismolabs.io/ environment." # 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": "PCI", "description": "Card PCI/sensitive information endpoints" } ], "components": { "parameters": { "cardId": { "in": "path", "name": "cardId", "schema": { "type": "string" }, "description": "Pismo card ID", "required": true }, "x-AccountIdHeader": { "in": "header", "name": "x-account-id", "schema": { "type": "string" }, "description": "Account ID", "required": true }, "x-TenantHeader": { "in": "header", "name": "x-tenant", "schema": { "type": "string" }, "description": "Organization/tenant ID", "required": true } }, "schemas": { "AccountID": { "type": "integer", "description": "Pismo account ID", "example": 7654776 }, "AppendUpdatePinIssuerScriptBody": { "type": "object", "description": "Object used to append issuer script to update card PIN", "required": [ "script_id" ], "properties": { "script_id": { "type": "string", "description": "Issuer script ID. Pismo configures a script according to your needs. Contact your Pismo representative to create a script. Once created, Pismo gives you the script ID. \n", "example": "11a10bff-830b-4649-9660-1a01a5e1c192" }, "pin_block": { "type": "string", "description": "New PIN encrypted as a PINblock using the Zone Pin Key (ZPK) `key_id` field that was pre-registered.", "example": "86FA0CED8BDD40D1" }, "key_id": { "$ref": "#/components/schemas/KeyID2" }, "pin": { "$ref": "#/components/schemas/PIN2" } } }, "AppendIssuerScriptResponse": { "type": "object", "description": "Response body containing card script created", "properties": { "card_script_id": { "type": "string", "description": "ID of script added to card.", "example": "11a10bff-830b-4649-9660-1a01a5e1c192" }, "org_id": { "$ref": "#/components/schemas/OrgID" }, "card_id": { "$ref": "#/components/schemas/CardID2" }, "account_id": { "$ref": "#/components/schemas/AccountID" }, "script_id": { "$ref": "#/components/schemas/ScriptID" }, "created_at": { "type": "string", "description": "Card script creation date, format = yyyy-MM-dd'T'HH:mm:ss.SSS\"", "example": "2021-10-16T14:09:04.549" }, "applied": { "type": "boolean", "description": "Has script been applied?", "example": false } } }, "CardID2": { "type": "integer", "description": "Pismo card ID", "example": 123456 }, "KeyID2": { "type": "string", "description": "Generated key ID. \n\nA Zone PIN Key (ZPK) identifier. The ZPK is a data encrypting or decrypting key for PIN transfer between parties. Ffor example, between issuers and processors or acquirers and networks or networks and processors, and so on.\n\nIn a sandbox environment, a fixed ZPK is used:\n\n key_id: 7d14ca2e-1057-11ee-8cee-060f666de710\n\n HSM key: 0404F2543B1C6E70AB61586E1304B6A7\n\nFor production, open a Jira ticket with type = **Configuration**. Request you need the key to use endpoints with PIN management such as PINBLOCK.\n", "example": "32a147ec-b2d9-4b0d-8c5b-557e6cf41e0e" }, "OrgID": { "type": "string", "description": "Organization/tenant ID", "example": "TN-f878e4a1-2879-48ba-be16-821e73ac98db" }, "PIN2": { "type": "string", "description": "New card Primary Identification Number (PIN)- 4 or 6 digits.", "minLength": 4, "maxLength": 6, "example": "1234" }, "ScriptID": { "type": "string", "description": "Issuer script ID. Pismo configures a script according to your needs. Contact your Pismo representative to create a script. Once created, Pismo gives you the script ID. \n", "example": "11a10bff-830b-4649-9660-1a01a5e1c192" } }, "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": { "400BadRequest": { "description": "Bad Request" }, "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" }, "500InternalServer": { "description": "Internal server error" } } }, "paths": { "/pcicards/v1/pcicards/{cardId}/scripts/pin-update": { "post": { "operationId": "post-v1-append-update-pin-script", "summary": "Append update PIN script", "description": "Append issuer script to update the card PIN that will be applied at the next authorization.\n\nYou must work with Pismo to pre-register a script and get its script ID. For information on generating a PINBlock and key ID, refer to the [PIN/PINBlock tutorial](https://developers.pismo.io/pismo-docs/docs/pinpinblock-tutorial) guide.\n\nFor more information, refer to the [Card scripts](https://developers.pismo.io/pismo-docs/docs/card-scripts) guide.\n\n**Note:** This is a PCI endpoint, use the https://gw-pci.pismolabs.io/ environment.\"\n", "tags": [ "PCI" ], "parameters": [ { "$ref": "#/components/parameters/cardId" }, { "$ref": "#/components/parameters/x-AccountIdHeader" }, { "$ref": "#/components/parameters/x-TenantHeader" } ], "requestBody": { "description": "Request body*", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppendUpdatePinIssuerScriptBody" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppendIssuerScriptResponse" } } }, "description": "Response for success append issuer scripts" }, "400": { "$ref": "#/components/responses/400BadRequest" }, "401": { "$ref": "#/components/responses/401Unauthorized" }, "403": { "$ref": "#/components/responses/403Forbidden" }, "404": { "$ref": "#/components/responses/404NotFound" }, "500": { "$ref": "#/components/responses/500InternalServer" } } } } } } ```