# Validate card POST https://api-sandbox.payabli.com/api/MoneyIn/validate Content-Type: application/json Validates a card number without running a transaction or authorizing a charge. Reference: https://docs.payabli.com/developers/api-reference/moneyin/validate-card ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Validate card version: endpoint_moneyIn.Validate paths: /MoneyIn/validate: post: operationId: validate summary: Validate card description: >- Validates a card number without running a transaction or authorizing a charge. tags: - - subpackage_moneyIn parameters: - name: requestToken in: header required: true schema: type: string - name: idempotencyKey in: header required: false schema: $ref: '#/components/schemas/type_:IdempotencyKey' responses: '200': description: Ok content: application/json: schema: $ref: '#/components/schemas/type_moneyIn:ValidateResponse' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: type: object properties: accountId: $ref: '#/components/schemas/type_:Accountid' entryPoint: $ref: '#/components/schemas/type_:Entrypointfield' orderDescription: $ref: '#/components/schemas/type_:Orderdescription' orderId: $ref: '#/components/schemas/type_:OrderId' paymentMethod: $ref: >- #/components/schemas/type_moneyIn:RequestPaymentValidatePaymentMethod description: Object describing payment method to use for transaction. required: - entryPoint - paymentMethod components: schemas: type_:IdempotencyKey: type: string type_:Accountid: type: string type_:Entrypointfield: type: string type_:Orderdescription: type: string type_:OrderId: type: string type_moneyIn:RequestPaymentValidatePaymentMethodMethod: type: string enum: - value: card - value: cloud type_:Cardnumber: type: string type_:Cardexp: type: string type_:Cardzip: type: string type_:Cardholder: type: string type_moneyIn:RequestPaymentValidatePaymentMethod: type: object properties: method: $ref: >- #/components/schemas/type_moneyIn:RequestPaymentValidatePaymentMethodMethod cardnumber: $ref: '#/components/schemas/type_:Cardnumber' cardexp: $ref: '#/components/schemas/type_:Cardexp' cardzip: $ref: '#/components/schemas/type_:Cardzip' cardHolder: $ref: '#/components/schemas/type_:Cardholder' required: - method - cardnumber - cardexp - cardzip - cardHolder type_:ResponseText: type: string type_:IsSuccess: type: boolean type_:Authcode: type: string type_:Referenceidtrans: type: string type_:ResultCode: type: integer type_:Resulttext: type: string type_:AvsResponseText: type: string type_:CvvResponseText: type: string type_:Customeridtrans: type: integer format: int64 type_:MethodReferenceId: type: string type_moneyIn:ValidateResponseData: type: object properties: authCode: $ref: '#/components/schemas/type_:Authcode' referenceId: $ref: '#/components/schemas/type_:Referenceidtrans' resultCode: $ref: '#/components/schemas/type_:ResultCode' resultText: $ref: '#/components/schemas/type_:Resulttext' avsResponseText: $ref: '#/components/schemas/type_:AvsResponseText' cvvResponseText: $ref: '#/components/schemas/type_:CvvResponseText' customerId: $ref: '#/components/schemas/type_:Customeridtrans' methodReferenceId: $ref: '#/components/schemas/type_:MethodReferenceId' required: - authCode - referenceId - resultCode - resultText - avsResponseText - cvvResponseText - customerId type_moneyIn:ValidateResponse: type: object properties: responseText: $ref: '#/components/schemas/type_:ResponseText' isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseData: $ref: '#/components/schemas/type_moneyIn:ValidateResponseData' required: - responseText - isSuccess - responseData ``` ## SDK Code Examples ```python ValidateCard from payabli import payabli from payabli.money_in import RequestPaymentValidatePaymentMethod client = payabli( api_key="YOUR_API_KEY", ) client.money_in.validate( idempotency_key="6B29FC40-CA47-1067-B31D-00DD010662DA", entry_point="entry132", payment_method=RequestPaymentValidatePaymentMethod( method="card", cardnumber="4360000001000005", cardexp="12/29", cardzip="14602-8328", card_holder="Dianne Becker-Smith", ), ) ``` ```typescript ValidateCard import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.moneyIn.validate({ idempotencyKey: "6B29FC40-CA47-1067-B31D-00DD010662DA", entryPoint: "entry132", paymentMethod: { method: "card", cardnumber: "4360000001000005", cardexp: "12/29", cardzip: "14602-8328", cardHolder: "Dianne Becker-Smith" } }); ``` ```go ValidateCard import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.MoneyIn.Validate( context.TODO(), &sdkgo.RequestPaymentValidate{ IdempotencyKey: sdkgo.String( "6B29FC40-CA47-1067-B31D-00DD010662DA", ), EntryPoint: "entry132", PaymentMethod: &sdkgo.RequestPaymentValidatePaymentMethod{ Method: sdkgo.RequestPaymentValidatePaymentMethodMethodCard, Cardnumber: "4360000001000005", Cardexp: "12/29", Cardzip: "14602-8328", CardHolder: "Dianne Becker-Smith", }, }, ) ``` ```csharp ValidateCard using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.MoneyIn.ValidateAsync( new RequestPaymentValidate { IdempotencyKey = "6B29FC40-CA47-1067-B31D-00DD010662DA", EntryPoint = "entry132", PaymentMethod = new RequestPaymentValidatePaymentMethod { Method = RequestPaymentValidatePaymentMethodMethod.Card, Cardnumber = "4360000001000005", Cardexp = "12/29", Cardzip = "14602-8328", CardHolder = "Dianne Becker-Smith", }, } ); ``` ```ruby ValidateCard require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/MoneyIn/validate") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["idempotencyKey"] = '6B29FC40-CA47-1067-B31D-00DD010662DA' request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"entryPoint\": \"entry132\",\n \"paymentMethod\": {\n \"method\": \"card\",\n \"cardnumber\": \"4360000001000005\",\n \"cardexp\": \"12/29\",\n \"cardzip\": \"14602-8328\",\n \"cardHolder\": \"Dianne Becker-Smith\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java ValidateCard HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/MoneyIn/validate") .header("idempotencyKey", "6B29FC40-CA47-1067-B31D-00DD010662DA") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"entryPoint\": \"entry132\",\n \"paymentMethod\": {\n \"method\": \"card\",\n \"cardnumber\": \"4360000001000005\",\n \"cardexp\": \"12/29\",\n \"cardzip\": \"14602-8328\",\n \"cardHolder\": \"Dianne Becker-Smith\"\n }\n}") .asString(); ``` ```php ValidateCard request('POST', 'https://api-sandbox.payabli.com/api/MoneyIn/validate', [ 'body' => '{ "entryPoint": "entry132", "paymentMethod": { "method": "card", "cardnumber": "4360000001000005", "cardexp": "12/29", "cardzip": "14602-8328", "cardHolder": "Dianne Becker-Smith" } }', 'headers' => [ 'Content-Type' => 'application/json', 'idempotencyKey' => '6B29FC40-CA47-1067-B31D-00DD010662DA', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift ValidateCard import Foundation let headers = [ "idempotencyKey": "6B29FC40-CA47-1067-B31D-00DD010662DA", "requestToken": "", "Content-Type": "application/json" ] let parameters = [ "entryPoint": "entry132", "paymentMethod": [ "method": "card", "cardnumber": "4360000001000005", "cardexp": "12/29", "cardzip": "14602-8328", "cardHolder": "Dianne Becker-Smith" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyIn/validate")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```