Transactions
GET /v1/gateways/<gateway_token>/transactions.<format>?order=desc HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Example response has been truncated for brevity
HTTPS/1.1 200 OK
{
"transactions": [
{
"on_test_gateway": true,
"created_at": "2021-06-01T18:12:58Z",
"updated_at": "2021-06-01T18:12:58Z",
"succeeded": true,
"state": "succeeded",
"token": "HTDLYnmo52ZEKrpLgW5mmFw3Mss",
"transaction_type": "Purchase",
"order_id": null,
"ip": null,
"description": null,
"email": null,
"merchant_name_descriptor": null,
"merchant_location_descriptor": null,
"merchant_profile_key": null,
"gateway_specific_fields": null,
"gateway_specific_response_fields": {
},
"gateway_transaction_id": "50",
"gateway_latency_ms": 0,
"stored_credential_initiator": null,
"stored_credential_reason_type": null,
"warning": null,
"application_id": null,
"amount": 100,
"currency_code": "USD",
"retain_on_success": false,
"payment_method_added": false,
"smart_routed": false,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "test",
"response": {
"success": true,
"message": "Successful purchase",
"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": "2021-06-01T18:12:58Z",
"updated_at": "2021-06-01T18:12:58Z"
},
"shipping_address": {
"name": "Newfirst Newlast",
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null
},
"api_urls": [
{
"referencing_transaction": [
]
},
{
"failover_transaction": [
]
}
],
"attempt_3dsecure": false,
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2021-06-01T18:12:57Z",
"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"
},
"callback_url": null,
"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": true,
"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",
"errors": [
],
"fingerprint": "e3cef43464fc832f6e04f187df25af497994",
"verification_value": "",
"number": "XXXX-XXXX-XXXX-1111"
}
}
]
}
<transactions>
<transaction>
<on_test_gateway type="boolean">true</on_test_gateway>
<created_at type="dateTime">2021-06-01T18:12:58Z</created_at>
<updated_at type="dateTime">2021-06-01T18:12:58Z</updated_at>
<succeeded type="boolean">true</succeeded>
<state>succeeded</state>
<token>HTDLYnmo52ZEKrpLgW5mmFw3Mss</token>
<transaction_type>Purchase</transaction_type>
<order_id nil="true"></order_id>
<ip nil="true"></ip>
<description nil="true"></description>
<email nil="true"></email>
<merchant_name_descriptor nil="true"></merchant_name_descriptor>
<merchant_location_descriptor nil="true"></merchant_location_descriptor>
<merchant_profile_key nil="true"></merchant_profile_key>
<gateway_specific_fields nil="true"></gateway_specific_fields>
<gateway_specific_response_fields>
</gateway_specific_response_fields>
<gateway_transaction_id>50</gateway_transaction_id>
<gateway_latency_ms type="integer">0</gateway_latency_ms>
<stored_credential_initiator nil="true"></stored_credential_initiator>
<stored_credential_reason_type nil="true"></stored_credential_reason_type>
<warning nil="true"></warning>
<application_id nil="true"></application_id>
<amount type="integer">100</amount>
<currency_code>USD</currency_code>
<retain_on_success type="boolean">false</retain_on_success>
<payment_method_added type="boolean">false</payment_method_added>
<smart_routed type="boolean">false</smart_routed>
<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"></address1>
<address2 nil="true"></address2>
<city nil="true"></city>
<state nil="true"></state>
<zip nil="true"></zip>
<country nil="true"></country>
<phone_number nil="true"></phone_number>
</shipping_address>
<response>
<success type="boolean">true</success>
<message>Successful purchase</message>
<avs_code nil="true"></avs_code>
<avs_message nil="true"></avs_message>
<cvv_code nil="true"></cvv_code>
<cvv_message nil="true"></cvv_message>
<pending type="boolean">false</pending>
<result_unknown type="boolean">false</result_unknown>
<error_code nil="true"></error_code>
<error_detail nil="true"></error_detail>
<cancelled type="boolean">false</cancelled>
<fraud_review nil="true"></fraud_review>
<created_at type="dateTime">2021-06-01T18:12:58Z</created_at>
<updated_at type="dateTime">2021-06-01T18:12:58Z</updated_at>
</response>
<api_urls>
</api_urls>
<payment_method>
<token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
<created_at>2017-06-26T17:04:38Z</created_at>
<updated_at>2021-06-01T18:12:57Z</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>
</metadata>
<callback_url nil="true"></callback_url>
<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"></address1>
<address2 nil="true"></address2>
<city nil="true"></city>
<state nil="true"></state>
<zip nil="true"></zip>
<country nil="true"></country>
<phone_number nil="true"></phone_number>
<company nil="true"></company>
<full_name>Newfirst Newlast</full_name>
<eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
<shipping_address1 nil="true"></shipping_address1>
<shipping_address2 nil="true"></shipping_address2>
<shipping_city nil="true"></shipping_city>
<shipping_state nil="true"></shipping_state>
<shipping_zip nil="true"></shipping_zip>
<shipping_country nil="true"></shipping_country>
<shipping_phone_number nil="true"></shipping_phone_number>
<payment_method_type>credit_card</payment_method_type>
<errors>
</errors>
<verification_value></verification_value>
<number>XXXX-XXXX-XXXX-1111</number>
<fingerprint>e3cef43464fc832f6e04f187df25af497994</fingerprint>
</payment_method>
<attempt_3dsecure type="boolean">false</attempt_3dsecure>
</transaction>
</transactions>
Get an ordered and paginated list of transactions executed against a specific gateway.
URL Parameters
Parameter | Description |
---|---|
gateway_token required |
The token of the gateway to execute against |
format required |
One of json or xml |
order | The order of the returned list. Default is asc , which returns the oldest records first. To list newer records first, use desc . |
since_token | The token of the item to start from (e.g., the last token received in the previous list if iterating through records) |
state | The transaction state on which to filter the returned list. Can be one of succeeded , failed , gateway_processing_failed , gateway_processing_result_unknown . |
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. |