---
updatedAt: 2026-05-15T19:08:46.000Z
agentTools:
  siteIndex: https://developers.pismo.io/llms.txt
  projectIndex: https://developers.pismo.io/pismo-docs/llms.txt
---

# Validate card data

Validate client card data for [Transfer funds](ref:post-funds-transfer)


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Instant payments - RuPay on UPI",
    "description": "United Payments Interface (UPI) API integrating providers with the Pismo platform",
    "contact": {
      "name": "Pismo"
    },
    "license": {
      "name": "Apache 2.0"
    },
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://sandbox.pismolabs.io/upi-gateway",
      "description": "Sandbox API server for testing"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "UPI",
      "description": "Endpoints to manage UPI operations"
    }
  ],
  "components": {
    "parameters": {
      "AuthHeader": {
        "in": "header",
        "name": "Authorization",
        "required": true,
        "description": "Authorization token. Tokens can expire quickly, which can result in a **401 Unauthorized** message.",
        "schema": {
          "type": "string",
          "example": "Bearer eyJhbGci...IUzUx"
        }
      },
      "UserAgentHeader": {
        "in": "header",
        "name": "user-agent",
        "required": true,
        "description": "Client consuming API.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "accountReferenceNumber": {
        "type": "string",
        "description": "\nAccount reference number. Pismo creates this automatically when creating a card linked to RuPay on UPI.\n\nThis number combines 10 BIN digits and the credit account number. If BIN is 6 digits, the remaining 4 digits  are set to zero (`0`). If BIN is 8 digits, then the remaining 2 digits are set to zero. This is a [NPCI](https://www.npci.org.in/what-we-do/rupay/product-overview) standard. For example, if the account reference number = `1234560000987654321`, the first six digits are the BIN, appended with 4 zeros and then the credit account number (`987654321``).\n\nYou can call [List cards](https://developers.pismo.io/pismo-docs/reference/post-list-cards) to get a card's account reference number.\n",
        "example": "12345600000000001140340134"
      },
      "cards.CardData": {
        "type": "object",
        "required": [
          "card_expiration",
          "last_six_digits"
        ],
        "properties": {
          "card_expiration": {
            "type": "string",
            "description": "Card expiration, format = MMYY. **REQUIRED** if `last_six_digits` is passed.",
            "example": "0529"
          },
          "last_six_digits": {
            "type": "string",
            "description": "Card's last six digits. **REQUIRED** if `card_expiration` is passed",
            "example": "657114"
          }
        }
      },
      "cards.PinData": {
        "type": "object",
        "required": [
          "key_id",
          "pin_block"
        ],
        "properties": {
          "pin_block": {
            "type": "string",
            "description": "Pin block",
            "example": "3FE661D50EF1F6F1"
          },
          "key_id": {
            "type": "string",
            "description": "Key encryption ID",
            "example": "7d14ca2e-1057-11ee-8cee-060f666de710"
          }
        }
      },
      "cards.ValidateRequest": {
        "required": [
          "account_reference_number",
          "card_data",
          "external_transaction_datetime",
          "external_transaction_id"
        ],
        "type": "object",
        "properties": {
          "account_reference_number": {
            "$ref": "#/components/schemas/accountReferenceNumber"
          },
          "card_data": {
            "type": "object",
            "description": "Card data",
            "allOf": [
              {
                "$ref": "#/components/schemas/cards.CardData"
              }
            ]
          },
          "external_transaction_datetime": {
            "$ref": "#/components/schemas/externalTransactionDatetime"
          },
          "external_transaction_id": {
            "$ref": "#/components/schemas/externalTransactionID"
          },
          "pin_data": {
            "type": "object",
            "description": "Pin data",
            "allOf": [
              {
                "$ref": "#/components/schemas/cards.PinData"
              }
            ]
          }
        }
      },
      "cards.ValidateResponse": {
        "type": "object",
        "required": [
          "account_reference_number",
          "external_transaction_datetime",
          "external_transaction_id",
          "result"
        ],
        "properties": {
          "account_reference_number": {
            "$ref": "#/components/schemas/accountReferenceNumber"
          },
          "external_transaction_datetime": {
            "$ref": "#/components/schemas/externalTransactionDatetime"
          },
          "external_transaction_id": {
            "$ref": "#/components/schemas/externalTransactionID"
          },
          "result": {
            "type": "string",
            "description": "Validation result. If not valid, an error message is returned.",
            "example": "VALIDATED"
          }
        }
      },
      "domain.DetailMessage": {
        "type": "object",
        "properties": {
          "external": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/domain.ExternalMessage"
            }
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/domain.ParameterMessage"
            }
          },
          "payload": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/domain.PayloadMessage"
            }
          }
        }
      },
      "domain.Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error type code",
            "example": "EPT0001"
          },
          "details": {
            "type": "object",
            "description": "Detailed error message",
            "allOf": [
              {
                "$ref": "#/components/schemas/domain.DetailMessage"
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "User not found"
          }
        }
      },
      "domain.ExternalMessage": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Code",
            "example": "PBE315"
          },
          "message": {
            "type": "string",
            "description": "Message",
            "example": "Generic error"
          }
        }
      },
      "domain.ParameterMessage": {
        "type": "object",
        "required": [
          "field",
          "message"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Field",
            "example": "Query parameter"
          },
          "message": {
            "type": "string",
            "description": "Message",
            "example": "Generic error"
          }
        }
      },
      "domain.PayloadMessage": {
        "type": "object",
        "required": [
          "field",
          "message"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Field",
            "example": "Entity.field"
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "Generic error"
          }
        }
      },
      "externalTransactionDatetime": {
        "type": "string",
        "description": "Request datetime. ISO 8601 format.",
        "example": "2020-09-15T19:39:54.013Z"
      },
      "externalTransactionID": {
        "type": "string",
        "description": "Request ID code",
        "example": "MGS584A1244F6BC4D50A3FABE6D93DF913C"
      }
    },
    "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.\n",
        "bearerFormat": "JWT"
      }
    }
  },
  "paths": {
    "/v1/cards/validate": {
      "post": {
        "summary": "Validate card data",
        "description": "Validate client card data for [Transfer funds](https://developers.pismo.io/pismo-docs/reference/post-funds-transfer)\n",
        "operationId": "post-validate-card-data",
        "tags": [
          "UPI"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/AuthHeader"
          },
          {
            "$ref": "#/components/parameters/UserAgentHeader"
          }
        ],
        "requestBody": {
          "description": "Request Body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/cards.ValidateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Response Body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/cards.ValidateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/domain.Error"
                },
                "examples": {
                  "EUPI0041": {
                    "summary": "last_six_digits is a required field",
                    "value": {
                      "code": "EUPI0041",
                      "message": "last_six_digits is a required field"
                    }
                  },
                  "EUPI0040": {
                    "summary": "cvv is a required field",
                    "value": {
                      "code": "EUPI0040",
                      "message": "cvv is a required field"
                    }
                  },
                  "EUPI0039": {
                    "summary": "card_expiration is a required field",
                    "value": {
                      "code": "EUPI0039",
                      "message": "card_expiration is a required field"
                    }
                  },
                  "EUPI0038": {
                    "summary": "pin is a required field",
                    "value": {
                      "code": "EUPI0038",
                      "message": "pin is a required field"
                    }
                  },
                  "EUPI0003": {
                    "summary": "Bad Request",
                    "value": {
                      "code": "EUPI0003",
                      "message": "Bad Request"
                    }
                  },
                  "EUPI0002": {
                    "summary": "Validation error",
                    "value": {
                      "code": "EUPI0002",
                      "message": "Validation error"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/domain.Error"
                },
                "examples": {
                  "EUPI0004": {
                    "summary": "Missing required header 'x-tenant'",
                    "value": {
                      "code": "EUPI0004",
                      "message": "Missing required header 'x-tenant'"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/domain.Error"
                },
                "examples": {
                  "EUPI0028": {
                    "summary": "Cards not found.",
                    "value": {
                      "code": "EUPI0028",
                      "message": "Cards not found."
                    }
                  },
                  "EUPI0032": {
                    "summary": "Not found.",
                    "value": {
                      "code": "EUPI0032",
                      "message": "Not found."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/domain.Error"
                },
                "examples": {
                  "EUPI0036": {
                    "summary": "pinblock sent is not equal as original card pinblock",
                    "value": {
                      "code": "EUPI0036",
                      "message": "pinblock sent is not equal as original card pinblock"
                    }
                  },
                  "EUPI0035": {
                    "summary": "card_expiration sent is not equal as original card data",
                    "value": {
                      "code": "EUPI0035",
                      "message": "card_expiration sent is not equal as original card data"
                    }
                  },
                  "EUPI0034": {
                    "summary": "last_six_digits sent is not equal as original card data",
                    "value": {
                      "code": "EUPI0034",
                      "message": "last_six_digits sent is not equal as original card data"
                    }
                  },
                  "EUPI0033": {
                    "summary": "Card with SUSPENDED status",
                    "value": {
                      "code": "EUPI0033",
                      "message": "Card with SUSPENDED status"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "UnprocessableEntity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/domain.Error"
                },
                "examples": {
                  "EUPI0004": {
                    "summary": "An unexpected error has occurred",
                    "value": {
                      "code": "EUPI0042",
                      "message": "An unexpected error has occurred"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/domain.Error"
                },
                "examples": {
                  "EUPI0001": {
                    "summary": "An unexpected error happened",
                    "value": {
                      "code": "EUPI0001",
                      "message": "An unexpected error happened"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```