Verify
POST /v1/gateways/<gateway_token>/verify.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"transaction": {
"payment_method_token": "56wyNnSmuA6CWYP7w0MiYCVIbW6",
"retain_on_success": true
}
}
<transaction>
<payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
<retain_on_success>true</retain_on_success>
</transaction>
HTTPS/1.1 200 OK
{
"transaction": {
"on_test_gateway": true,
"created_at": "2018-11-07T15:10:26Z",
"updated_at": "2018-11-07T15:10:26Z",
"succeeded": true,
"state": "succeeded",
"token": "7H6kWRX0jxtaniT4em8ZfRMfcjR",
"transaction_type": "Verification",
"order_id": null,
"ip": null,
"sub_merchant_key": null,
"description": null,
"email": null,
"merchant_name_descriptor": null,
"merchant_location_descriptor": null,
"gateway_specific_fields": null,
"gateway_specific_response_fields": {
},
"gateway_transaction_id": "59",
"gateway_latency_ms": 20,
"currency_code": null,
"retain_on_success": true,
"payment_method_added": false,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "test",
"response": {
"success": true,
"message": "Successful verify",
"avs_code": null,
"avs_message": null,
"cvv_code": null,
"cvv_message": null,
"pending": false,
"result_unknown": false,
"error_code": null,
"error_detail": null,
"cancelled": false,
"fraud_review": null,
"created_at": "2018-11-07T15:10:26Z",
"updated_at": "2018-11-07T15:10:26Z"
},
"shipping_address": {
"name": "Newfirst Newlast",
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null
},
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2018-11-07T15:10:26Z",
"email": "joey@example.com",
"data": {
"my_payment_method_identifier": "448",
"extra_stuff": {
"some_other_things": "Can be anything really"
}
},
"storage_state": "retained",
"test": true,
"metadata": {
"key": "string value",
"another_key": 123,
"final_key": true
},
"last_four_digits": "1111",
"first_six_digits": "411111",
"card_type": "visa",
"first_name": "Newfirst",
"last_name": "Newlast",
"month": 3,
"year": 2032,
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null,
"company": null,
"full_name": "Newfirst Newlast",
"eligible_for_card_updater": null,
"shipping_address1": null,
"shipping_address2": null,
"shipping_city": null,
"shipping_state": null,
"shipping_zip": null,
"shipping_country": null,
"shipping_phone_number": null,
"payment_method_type": "credit_card",
"bin_metadata": {
"card_brand": "DISCOVER",
"card_category": "PERSONAL",
"card_type": "CREDIT",
"issuing_bank": "DISCOVER BANK",
"issuing_country_iso_number": "840",
"issuing_country_iso_a2_code": "US",
"issuing_country_iso_a3_code": "USA",
"issuing_country_iso_name": "UNITED STATES",
"issuing_bank_phone_number": "1 (800) 347-7000",
"issuing_bank_website": "HTTPS://WWW.DISCOVER.COM/",
"bin_type": "PERSONAL",
"regulated": "Y",
"max_pan_length": 19,
"message": "Successful"
},
"errors": [
],
"fingerprint": "e3cef43464fc832f6e04f187df25af497994",
"verification_value": "",
"number": "XXXX-XXXX-XXXX-1111"
}
}
}
<transaction>
<on_test_gateway type="boolean">true</on_test_gateway>
<created_at type="dateTime">2018-11-07T15:10:25Z</created_at>
<updated_at type="dateTime">2018-11-07T15:10:26Z</updated_at>
<succeeded type="boolean">true</succeeded>
<state>succeeded</state>
<token>8I9G697eo64d3hOvix8wdgaj3ml</token>
<transaction_type>Verification</transaction_type>
<order_id nil="true"/>
<ip nil="true"/>
<sub_merchant_key nil="true">
<description nil="true"/>
<email nil="true"/>
<merchant_name_descriptor nil="true"/>
<merchant_location_descriptor nil="true"/>
<gateway_specific_fields nil="true"/>
<gateway_specific_response_fields>
</gateway_specific_response_fields>
<gateway_transaction_id>44</gateway_transaction_id>
<gateway_latency_ms type="integer">24</gateway_latency_ms>
<currency_code nil="true"/>
<retain_on_success type="boolean">true</retain_on_success>
<payment_method_added type="boolean">false</payment_method_added>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway_token>T11bJAANtTWnxl36GYjKWvbNK0g</gateway_token>
<gateway_type>test</gateway_type>
<shipping_address>
<name>Newfirst Newlast</name>
<address1 nil="true"/>
<address2 nil="true"/>
<city nil="true"/>
<state nil="true"/>
<zip nil="true"/>
<country nil="true"/>
<phone_number nil="true"/>
</shipping_address>
<response>
<success type="boolean">true</success>
<message>Successful verify</message>
<avs_code nil="true"/>
<avs_message nil="true"/>
<cvv_code nil="true"/>
<cvv_message nil="true"/>
<pending type="boolean">false</pending>
<result_unknown type="boolean">false</result_unknown>
<error_code nil="true"/>
<error_detail nil="true"/>
<cancelled type="boolean">false</cancelled>
<fraud_review nil="true"/>
<created_at type="dateTime">2018-11-07T15:10:26Z</created_at>
<updated_at type="dateTime">2018-11-07T15:10:26Z</updated_at>
</response>
<payment_method>
<token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
<created_at type="dateTime">2017-06-26T17:04:38Z</created_at>
<updated_at type="dateTime">2018-11-07T15:10:01Z</updated_at>
<email>joey@example.com</email>
<data>
<my_payment_method_identifier>448</my_payment_method_identifier>
<extra_stuff>
<some_other_things>Can be anything really</some_other_things>
</extra_stuff>
</data>
<storage_state>retained</storage_state>
<test type="boolean">true</test>
<metadata>
<key>string value</key>
<another_key type="integer">123</another_key>
<final_key type="boolean">true</final_key>
</metadata>
<last_four_digits>1111</last_four_digits>
<first_six_digits>411111</first_six_digits>
<card_type>visa</card_type>
<first_name>Newfirst</first_name>
<last_name>Newlast</last_name>
<month type="integer">3</month>
<year type="integer">2032</year>
<address1 nil="true"/>
<address2 nil="true"/>
<city nil="true"/>
<state nil="true"/>
<zip nil="true"/>
<country nil="true"/>
<phone_number nil="true"/>
<company nil="true"/>
<full_name>Newfirst Newlast</full_name>
<eligible_for_card_updater nil="true"/>
<shipping_address1 nil="true"/>
<shipping_address2 nil="true"/>
<shipping_city nil="true"/>
<shipping_state nil="true"/>
<shipping_zip nil="true"/>
<shipping_country nil="true"/>
<shipping_phone_number nil="true"/>
<payment_method_type>credit_card</payment_method_type>
<bin_metadata>
<card_brand>DISCOVER</card_brand>
<card_category>PERSONAL</card_category>
<card_type>CREDIT</card_type>
<issuing_bank>DISCOVER BANK</issuing_bank>
<issuing_country_iso_number>840</issuing_country_iso_number>
<issuing_country_iso_a2_code>US</issuing_country_iso_a2_code>
<issuing_country_iso_a3_code>USA</issuing_country_iso_a3_code>
<issuing_country_iso_name>UNITED STATES</issuing_country_iso_name>
<issuing_bank_phone_number>1 (800) 347-7000</issuing_bank_phone_number>
<issuing_bank_website>HTTPS://WWW.DISCOVER.COM/</issuing_bank_website>
<bin_type>PERSONAL</bin_type>
<regulated>Y</regulated>
<max_pan_length>19</max_pan_length>
<message>Successful</message>
</bin_metadata>
<errors>
</errors>
<verification_value></verification_value>
<number>XXXX-XXXX-XXXX-1111</number>
<fingerprint>e3cef43464fc832f6e04f187df25af497994</fingerprint>
</payment_method>
</transaction>
Determine if a credit card is chargeable card and available for purchases. The retain_on_success
request parameter will automatically retain the card if it’s successfully verified.
Also used by Ebanx Gateway customers as part of the enrollment process for Mercado Pago recurring payments. To learn more about this visit Ebanx Gateway.
URL Parameters
Parameter | Description |
---|---|
gateway_token required |
The token of the gateway to execute against |
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
transaction | Root request element |
❯ payment_method_token required |
The token of the payment method to verify |
❯ retain_on_success optional |
If the card is verified, retain it so it can be used for future transactions |
❯ currency_code optional |
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars. |
❯ ip optional |
If the gateway requires an allowed IP address |
❯ sub_merchant_key optional |
The token of the sub-merchant to associate with the current transaction. If an invalid sub_merchant_key is passed through, the value defaults to null |
❯ sca_authentication_token optional |
The token received in response body of SCA Authenticate endpoint when performing an SCA Authentication on a specified payment method. See instructions to obtain |
❯ sca_provider_key optional |
SCA Provider token that performs a Spreedly 3DS2 Global authentication before attempting the gateway transaction. Please see our Spreedly 3DS2 Global Guide for more info. |
❯ sca_authentication_parameters optional |
Additional fields that are accepted by the Sca Authentication, including a test_scenario object to indicate valid 3DS2 test flow options and an exemption_type field to request an exemption. Please refer to our 3DS2 Global Guide to learn more. |
❯ gateway_specific_fields optional |
Unique optional fields that a gateway may require for certain customized options. To send a GSF it should be nested under gateway_specific_fields and under the gateway’s name, i.e. gateway_type . Please refer to using a payment method for more info. |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction(s) | Root element |
❯ token | The token uniquely identifying this transaction at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ message | A human-readable string indicating the result of the transaction |
❯ gateway_transaction_id | The id of the transaction at the gateway. To be used when corresponding with the gateway or reconciling transactions |
❯ retain_on_success | If the payment method was set to be retained on successful completion of the transaction. To determine if the payment method was actually retained, see the payment_method/storage_state field |
❯ payment_method_added | If the payment method was added as part of this transaction (i.e. a direct pass-in of the payment information) vs. using an already tokenized payment method |
❯ response | Unmodified details of the gateway response, including the message and error_code , if applicable. For failed transactions these fields can help determine the root cause |
❯ payment_method | The payment method used in this transaction |
❯ merchant_profile_key | The token of the Merchant Profile associated with the gateway used for the transaction |
❯ sub_merchant_key | The token of the sub-merchant associated with the transaction. |
❯ gateway_specific_response_fields | A hash containing unique optional fields that a gateway may return based on certain customized options. |
❯ transaction_metadata | The hash of key/value pairs that was included in the transaction request body. |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.