Kushki gateway guide

Quick Start

New to integrating Kushki with Spreedly? Here's your setup guide:

  1. Retrieve your Kushki credentials
    1. Contact Kushki to obtain the credentials required for your account configuration.
      • Public Merchant ID: required to create the gateway in Spreedly
      • Private Merchant ID: required for authentication with Kushki
    2. Some features also depend on gateway-side enablement in Kushki, including wallet support, network token handling, and country- or merchant-model-specific operations.
  2. Get familiar with the Spreedly API
    1. Review Spreedly API basics
    2. Understand the core concepts: Gateways, Payment Methods, and Transactions
  3. Add Kushki gateway to Spreedly in sandbox mode
📘

Review this documentation to understand more about how to test transactions.

Additional notes
  • Authorize and capture is supported only in Chile and Peru, and only for PEN, CLP, and UF.
  • Kushki supports stored credentials through Spreedly first-class stored credential fields on Authorize and Purchase requests.
  • Kushki supports CVV-less transactions through Spreedly on Authorize and Purchase requests.

Adding a Kushki Gateway

Request

curl https://core.spreedly.com/v1/gateways.xml \
  -u 'EnvironmentKey:AccessSecret' \
  -H 'Content-Type: application/xml' \
  -d '<gateway>
        <gateway_type>kushki</gateway_type>
        <public_merchant_id>Your Public Merchant Id</public_merchant_id>
        <private_merchant_id>Your Private Merchant Id</private_merchant_id>
      </gateway>'

Response

<gateway>
  <token>BfJS7t2FECNmGyilnHczpdszxyz</token>
  <gateway_type>kushki</gateway_type>
  <name>Kushki</name>
  <public_merchant_id>Your Public Merchant Id</public_merchant_id>
  <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_void type="boolean">true</supports_void>
    <supports_verify type="boolean">true</supports_verify>
    <supports_store type="boolean">true</supports_store>
    <supports_remove type="boolean">true</supports_remove>
    <supports_network_tokenization type="boolean">true</supports_network_tokenization>
    <supports_inquire_by_gateway_transaction_id type="boolean">true</supports_inquire_by_gateway_transaction_id>
    <supports_inquire_by_order_id type="boolean">false</supports_inquire_by_order_id>
    <supports_stored_stored_credentials type="boolean">true</supports_stored_stored_credentials>
  </characteristics>
</gateway>

Purchase

Request

curl https://core.spreedly.com/v1/gateways/[gateway_token]/purchase.xml \
  -u 'EnvironmentKey:AccessSecret' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <payment_method_token>payment_method_token</payment_method_token>
        <amount>1985</amount>
        <currency_code>USD</currency_code>
      </transaction>'

Third-party 3D Secure 2 auth data

Spreedly automatically handles the field mapping for sending third-party 3DS2 authentication data to Kushki. For more information about using this feature, see the 3DS2 Third-party Authentication Guide.

Spreedly fields map to the relevant Kushki fields as described in the following table. See the Kushki API reference for detailed descriptions of each field and guidance on when to use them.

Spreedly fieldKushki field
three_ds_versionspecificationVersion
ecommerce_indicatoreci
authentication_valuecavv
authentication_valueucaf
directory_server_transaction_iddirectoryServerTransactionID

Stored Credentials

For Kushki, sending stored credential fields can be done using Spreedly's first-class support. For any Authorize or Purchase request, include these fields:

  • stored_credential_initiator
  • stored_credential_reason_type

Spreedly maps these values to Kushki's card-on-file behavior.

First / credential-on-file setup (CIT)

reason_typeinitiator
recurringcardholder
installmentcardholder
unscheduledcardholder

Subsequent use

reason_typeinitiator
recurringmerchant
installmentmerchant
unscheduledmerchant
recurringcardholder
installmentcardholder
unscheduledcardholder

You can override the auto-mapped citMit value by passing the cit_mit gateway specific field. When provided, it takes precedence over the initiator and reason_type mapping and is sent to Kushki as-is.

<gateway_specific_fields>
  <kushki>
    <cit_mit>M103</cit_mit>
  </kushki>
</gateway_specific_fields>
📘

Learn more about how spreedly enables use of stored credentials by reviewing our Stored credentials Guide

Store

Store operation setup

Kushki stores payment methods through Kushki's payment credential creation endpoint and returns a credential identifier that Spreedly stores as the gateway-side vaulted asset. That stored credential can be reused on later Purchase and Authorize requests where supported. If Kushki returns an existing credential for the same card, Spreedly treats the store operation as successful and uses the existing credential identifier.

Gateway Specific Fields

Field NameTypeRequiredDescriptionExample
amountObjectNoDetailed amount breakdown for purchase and void transactions, including extra taxes for supported currencies.{"subtotal_iva":10,"subtotal_iva_0":4.95}
contact_detailsObjectNoCardholder contact information including document details and phone number in E.164 format.{"document_type":"CC","phone_number":"+593988734644"}
full_responseBooleanNoWhen true, allows response fields such as approval_code to be returned.true
metadataObjectNoAdditional metadata to record with purchase and authorize transactions.{"productos":"Bananas"}
monthsStringNoUsed for deferred transactions in Chile, Colombia, and Peru.1
deferred_grace_monthsStringNoDeferred transaction setting for Ecuador and Mexico.05
deferred_credit_typeStringNoDeferred transaction setting for Ecuador and Mexico.01
deferred_monthsStringNoDeferred transaction setting for Ecuador and Mexico.3
product_detailsObjectNoAdditional product information for purchase and authorize transactions.{"id":"abc123","title":"xzy123","price":20,"sku":"12345abcde","quantity":1}
device_typeStringNoDevice type passed to Kushki when supported by the request flow.mobile
requestor_idStringNoRequestor identifier for applicable token or authentication flows.requestor_123
network_token_sourceStringNoIdentifies the network token source when applicable.spreedly
authentication_levelStringNoAuthentication level for supported flows.01
mvvStringNoAdditional token-related value supported by Kushki.123
idempotency_keyStringNoUsed for idempotent void and refund requests. Sent as the Idempotency-Key header.550e8400-e29b-41d4-a716-446655440000
cit_mitStringNoOverrides auto-mapped stored credential transaction classification.M103

Example request with gateway specific fields

curl https://core.spreedly.com/v1/gateways/[gateway_token]/purchase.xml \
  -u 'EnvironmentKey:AccessSecret' \
  -H 'Content-Type: application/xml' \
  -d '<transaction>
        <payment_method_token>payment_method_token</payment_method_token>
        <amount>1985</amount>
        <currency_code>USD</currency_code>
        <gateway_specific_fields>
          <kushki>
            <amount>
              <subtotal_iva>10</subtotal_iva>
              <subtotal_iva_0>4.95</subtotal_iva_0>
              <ice>3.5</ice>
              <iva>1.4</iva>
            </amount>
            <contact_details>
              <document_type>CC</document_type>
              <document_number>1009283738</document_number>
              <email>[email protected]</email>
              <first_name>Diego</first_name>
              <last_name>Cadena</last_name>
              <phone_number>+593988734644</phone_number>
            </contact_details>
            <full_response>true</full_response>
            <metadata>
              <productos>Bananas</productos>
            </metadata>
            <months>1</months>
            <deferred_grace_months>05</deferred_grace_months>
            <deferred_credit_type>01</deferred_credit_type>
            <deferred_months>3</deferred_months>
            <product_details>
              <id>abc123</id>
              <title>xzy123</title>
              <price>20</price>
              <sku>12345abcde</sku>
              <quantity>1</quantity>
            </product_details>
          </kushki>
        </gateway_specific_fields>
      </transaction>'

Gateway Specific Response Fields

<transaction>
  <token>LLQG7bgxtplfEKt3Elvxyz</token>
  <transaction_type>Purchase</transaction_type>
  <gateway_specific_fields>
    <kushki>
      <full_response>true</full_response>
    </kushki>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
    <kushki>
      <approval_code>867530</approval_code>
    </kushki>
  </gateway_specific_response_fields>
</transaction>

Verify

Kushki supports verify requests through Spreedly.

Verify is used to validate that a card or payment method can be used with Kushki without creating a charge. Spreedly sends the request as an account validation transaction and maps Kushki's successful validation response back to a successful Spreedly Verify transaction.

Inquire

Spreedly can re-query a Kushki transaction's current status via inquire_by_gateway_transaction_id. It calls Kushki's GET /analytics/v2/transactions-list endpoint, filters by the ticket_number stored from the original transaction, and sends a from/to date range around the transaction's creation date. Inquire is supported for purchase, authorize, refund (credit), and general_credit.

Network Tokenization

Kushki supports receiving network tokens directly.

  • When an attempt_network_token: true request is made with a valid, active network token, Spreedly passes the network token to Kushki.
  • Spreedly also passes the scheme-generated cryptogram and any available TRID and ECI.
  • No additional account configuration with Kushki is required to begin using network tokens.

Apple Pay and Google Pay

Kushki supports Apple Pay and Google Pay payment methods.

  • Tokens collected through Apple Pay or Google Pay can be used in the same way as other payment methods on this gateway.
  • No additional configuration is required on Spreedly's side.
  • The merchant must enable Apple Pay and Google Pay directly on the Kushki side before using these wallet payment types through Spreedly.

Additional resources

📘

If you need support with this gateway, please contact Support at [email protected].

📘

Kushki Documentation: Reference, https://api-docs.kushkipagos.com/


Did this page help you?