Retain
PUT /v1/gateways/<gateway_token>/retain.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
HTTPS/1.1 200 OK
{
"transaction": {
"token": "9EwxsDWR0g3EsE686j8qsX5gAuS",
"created_at": "2020-04-03T18:22:31Z",
"updated_at": "2020-04-03T18:22:31Z",
"succeeded": true,
"transaction_type": "RetainGateway",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway": {
"token": "RpnIaNabjy9E8Itba4JPV4Zgapz",
"gateway_type": "authorize_net",
"description": null,
"payment_methods": [
"credit_card",
"bank_account",
"apple_pay",
"third_party_token"
],
"state": "retained",
"created_at": "2020-04-03T18:22:31Z",
"updated_at": "2020-04-03T18:22:31Z",
"name": "Authorize.Net",
"login": "Your Authorize.Net API Login ID",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"verify",
"store",
"fraud_review"
],
"credentials": [
{
"name": "login",
"value": "Your Authorize.Net API Login ID"
}
],
"gateway_settings": {
"opt_out_recurring_default": null
},
"gateway_specific_fields": [
"customer_id",
"customer_profile_id",
"duplicate_window",
"disable_partial_auth",
"market_type",
"recurring",
"email_customer",
"header_email_receipt",
"line_items",
"po_number",
"tax_exempt",
"tax",
"duty",
"shipping",
"transaction_id",
"require_billing_address",
"customer_payment_profile_id",
"ship_from_address",
"summary_commodity_code",
"authentication_indicator",
"cardholder_authentication_value"
],
"redacted": false,
"sandbox": false
}
}
}
<transaction>
<token>7fQWQ3hA9sv80Gl5pLff4KPkG2d</token>
<created_at type="dateTime">2020-04-03T18:22:31Z</created_at>
<updated_at type="dateTime">2020-04-03T18:22:31Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>RetainGateway</transaction_type>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway>
<token>GULbQX8cBftv3qXyGGKsoowkRDy</token>
<gateway_type>authorize_net</gateway_type>
<name>Authorize.Net</name>
<description nil="true"></description>
<login>Your Authorize.Net API Login ID</login>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">false</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">false</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">false</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">false</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">false</supports_offsite_authorize>
<supports_3dsecure_purchase type="boolean">false</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">false</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">false</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">false</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">false</supports_remove>
<supports_fraud_review type="boolean">true</supports_fraud_review>
</characteristics>
<credentials>
<credential>
<name>login</name>
<value>Your Authorize.Net API Login ID</value>
</credential>
</credentials>
<gateway_settings>
<opt_out_recurring_default nil="true"></opt_out_recurring_default>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>customer_id</gateway_specific_field>
<gateway_specific_field>customer_profile_id</gateway_specific_field>
<gateway_specific_field>duplicate_window</gateway_specific_field>
<gateway_specific_field>disable_partial_auth</gateway_specific_field>
<gateway_specific_field>market_type</gateway_specific_field>
<gateway_specific_field>recurring</gateway_specific_field>
<gateway_specific_field>email_customer</gateway_specific_field>
<gateway_specific_field>header_email_receipt</gateway_specific_field>
<gateway_specific_field>line_items</gateway_specific_field>
<gateway_specific_field>po_number</gateway_specific_field>
<gateway_specific_field>tax_exempt</gateway_specific_field>
<gateway_specific_field>tax</gateway_specific_field>
<gateway_specific_field>duty</gateway_specific_field>
<gateway_specific_field>shipping</gateway_specific_field>
<gateway_specific_field>transaction_id</gateway_specific_field>
<gateway_specific_field>require_billing_address</gateway_specific_field>
<gateway_specific_field>customer_payment_profile_id</gateway_specific_field>
<gateway_specific_field>ship_from_address</gateway_specific_field>
<gateway_specific_field>summary_commodity_code</gateway_specific_field>
<gateway_specific_field>authentication_indicator</gateway_specific_field>
<gateway_specific_field>cardholder_authentication_value</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>third_party_token</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">false</sandbox>
<created_at type="dateTime">2020-04-03T18:22:30Z</created_at>
<updated_at type="dateTime">2020-04-03T18:22:31Z</updated_at>
</gateway>
</transaction>
When gateways are created via the API, they are automatically retained. However, gateways created via the unauthenticated API (e.g., from a browser/javascript library) are created in the “cached” state. Only by retaining a cached gateway will it be saved and available for future use.
URL Parameters
Parameter | Description |
---|---|
gateway_token required |
The token of the gateway to execute against |
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction | 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 | The gateway that was redacted |
❯❯ redacted | If the gateway is redacted |
❯❯ state | The new state of the gateway (retained ) |