Create Google Pay token

Connect a Google Pay token to the specified account.

The paymentMethodData field should contain the paymentMethodData property from Google Pay's PaymentData response, passed through unmodified.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.write scope.

POST
/accounts/{accountID}/google-pay/tokens
cURL TypeScript PHP Java Python Ruby .NET
curl -X POST "https://api.moov.io/accounts/{accountID}/google-pay/tokens" \
  -H "Authorization: Bearer {token}" \
  -H "X-Moov-Version: v2026.04.00" \
  -d '{
  "merchantAccountID": "c5f78a7e-2fb0-4e4a-bcf0-9e1f8b0e5c7a",
  "paymentMethodData": {
    "info": {
      "cardNetwork": "VISA",
      "cardDetails": "1234"
    },
    "tokenizationData": {
      "type": "PAYMENT_GATEWAY",
      "token": "string"
    }
  }
}'
import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.googlePay.linkToken({
    accountID: "<id>",
    linkGooglePay: {
      merchantAccountID: "c5f78a7e-2fb0-4e4a-bcf0-9e1f8b0e5c7a",
      paymentMethodData: {
        type: "CARD",
        info: {
          cardNetwork: "VISA",
          cardDetails: "1234",
          cardFundingSource: "DEBIT",
          billingAddress: {
            countryCode: "US",
          },
        },
        tokenizationData: {
          type: "PAYMENT_GATEWAY",
          token: "<value>",
        },
      },
    },
  });

  console.log(result);
}

run();
declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$linkGooglePay = new Components\LinkGooglePay(
    merchantAccountID: 'c5f78a7e-2fb0-4e4a-bcf0-9e1f8b0e5c7a',
    paymentMethodData: new Components\GooglePayPaymentMethodData(
        type: Components\Type::Card,
        info: new Components\GooglePayCardInfo(
            cardNetwork: Components\CardNetwork::Visa,
            cardDetails: '1234',
            cardFundingSource: Components\CardFundingSource::Debit,
            billingAddress: new Components\GooglePayBillingAddress(
                countryCode: 'US',
            ),
        ),
        tokenizationData: new Components\GooglePayTokenizationData(
            type: Components\GooglePayTokenizationDataType::PaymentGateway,
            token: '<value>',
        ),
    ),
);

$response = $sdk->googlePay->linkToken(
    accountID: '<id>',
    linkGooglePay: $linkGooglePay

);

if ($response->linkedGooglePayPaymentMethods !== null) {
    // handle response
}
package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.*;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.errors.LinkGooglePayError;
import io.moov.sdk.models.operations.LinkGooglePayTokenResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws GenericError, LinkGooglePayError, Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        LinkGooglePayTokenResponse res = sdk.googlePay().linkToken()
                .accountID("<id>")
                .linkGooglePay(LinkGooglePay.builder()
                    .merchantAccountID("c5f78a7e-2fb0-4e4a-bcf0-9e1f8b0e5c7a")
                    .paymentMethodData(GooglePayPaymentMethodData.builder()
                        .info(GooglePayCardInfo.builder()
                            .cardNetwork(CardNetwork.VISA)
                            .cardDetails("1234")
                            .cardFundingSource(CardFundingSource.DEBIT)
                            .billingAddress(GooglePayBillingAddress.builder()
                                .countryCode("US")
                                .build())
                            .build())
                        .tokenizationData(GooglePayTokenizationData.builder()
                            .type(GooglePayTokenizationDataType.PAYMENT_GATEWAY)
                            .token("<value>")
                            .build())
                        .type(Type.CARD)
                        .build())
                    .build())
                .call();

        if (res.linkedGooglePayPaymentMethods().isPresent()) {
            System.out.println(res.linkedGooglePayPaymentMethods().get());
        }
    }
}
from moovio_sdk import Moov
from moovio_sdk.models import components


with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

    res = moov.google_pay.link_token(account_id="<id>", merchant_account_id="c5f78a7e-2fb0-4e4a-bcf0-9e1f8b0e5c7a", payment_method_data={
        "type": components.Type.CARD,
        "info": {
            "card_network": components.CardNetwork.VISA,
            "card_details": "1234",
            "card_funding_source": components.CardFundingSource.DEBIT,
            "billing_address": {
                "country_code": "US",
            },
        },
        "tokenization_data": {
            "type": components.GooglePayTokenizationDataType.PAYMENT_GATEWAY,
            "token": "<value>",
        },
    })

    # Handle response
    print(res)
require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new(
  security: Models::Components::Security.new(
    username: '',
    password: ''
  )
)
res = s.google_pay.link_token(account_id: '<id>', link_google_pay: Models::Components::LinkGooglePay.new(
  merchant_account_id: 'c5f78a7e-2fb0-4e4a-bcf0-9e1f8b0e5c7a',
  payment_method_data: Models::Components::GooglePayPaymentMethodData.new(
    type: Models::Components::GooglePayPaymentMethodDataType::CARD,
    info: Models::Components::GooglePayCardInfo.new(
      card_network: Models::Components::CardNetwork::VISA,
      card_details: '1234',
      card_funding_source: Models::Components::CardFundingSource::DEBIT,
      billing_address: Models::Components::GooglePayBillingAddress.new(
        country_code: 'US'
      )
    ),
    tokenization_data: Models::Components::GooglePayTokenizationData.new(
      type: Models::Components::GooglePayTokenizationDataType::PAYMENT_GATEWAY,
      token: '<value>'
    )
  )
))

unless res.linked_google_pay_payment_methods.nil?
  # handle response
end
using Moov.Sdk;
using Moov.Sdk.Models.Components;

var sdk = new MoovClient(security: new Security() {
    Username = "",
    Password = "",
});

var res = await sdk.GooglePay.LinkTokenAsync(
    accountID: "<id>",
    body: new LinkGooglePay() {
        MerchantAccountID = "c5f78a7e-2fb0-4e4a-bcf0-9e1f8b0e5c7a",
        PaymentMethodData = new GooglePayPaymentMethodData() {
            Type = GooglePayPaymentMethodDataType.Card,
            Info = new GooglePayCardInfo() {
                CardNetwork = CardNetwork.Visa,
                CardDetails = "1234",
                CardFundingSource = CardFundingSource.Debit,
                BillingAddress = new GooglePayBillingAddress() {
                    CountryCode = "US",
                },
            },
            TokenizationData = new GooglePayTokenizationData() {
                Type = GooglePayTokenizationDataType.PaymentGateway,
                Token = "<value>",
            },
        },
    }
);

// handle response
200 400 401 403 404 409 422 429 500 504
The request completed successfully.
application/json
[
  {
    "paymentMethodID": "string",
    "paymentMethodType": "moov-wallet",
    "googlePay": {
      "tokenID": "dcd471ec-7d5c-4016-865c-1e78c733bea2",
      "brand": "Visa",
      "cardType": "credit",
      "cardDisplayName": "7419",
      "fingerprint": "9948962d92a1ce40c9f918cd9ece3a22bde62fb325a2f1fe2e833969de672ba3",
      "expiration": {
        "month": "01",
        "year": "21"
      },
      "dynamicLastFour": "7419",
      "issuerCountry": "US",
      "authMethod": "PAN_ONLY"
    }
  }
]

x-request-id

string required
A unique identifier used to trace requests.
The server could not understand the request due to invalid syntax.
application/json
{
  "error": "string"
}

x-request-id

string required
A unique identifier used to trace requests.
The request contained missing or expired authentication.

x-request-id

string required
A unique identifier used to trace requests.
The user is not authorized to make the request.

x-request-id

string required
A unique identifier used to trace requests.
The requested resource was not found.

x-request-id

string required
A unique identifier used to trace requests.
The request conflicted with the current state of the target resource.
application/json
{
  "error": "string"
}

x-request-id

string required
A unique identifier used to trace requests.
The request was well-formed, but the contents failed validation. Check the request for missing or invalid fields.
application/json
{
  "error": "string",
  "merchantAccountID": "string",
  "paymentMethodData": "string"
}

x-request-id

string required
A unique identifier used to trace requests.
Request was refused due to rate limiting.

x-request-id

string required
A unique identifier used to trace requests.
The request failed due to an unexpected error.

x-request-id

string required
A unique identifier used to trace requests.
The request failed because a downstream service failed to respond.

x-request-id

string required
A unique identifier used to trace requests.

Headers

X-Moov-Version

string
Set this header to v2026.04.00 to use the API described in this specification. When omitted, the server defaults to v2024.01.00, which may not match the behavior documented here.
Possible values: v2026.04.00

Path parameters

accountID

string required
ID of the Moov account representing the cardholder.

Body

application/json

Links a Google Pay token to a Moov account.

The paymentMethodData field should contain the paymentMethodData property from the PaymentData response returned by Google Pay's client SDK. Pass it through unmodified.

merchantAccountID

string required
The merchant accountID this token was minted for. Must match the gatewayMerchantId value passed to Google Pay when constructing the PaymentDataRequest. card-gateway validates that the decrypted gatewayMerchantId matches this value.

paymentMethodData

object required
The paymentMethodData object from Google Pay's PaymentData response.
Show child attributes

info

object required
Unencrypted card metadata from CardInfo.
Show child attributes

cardDetails

string required
The last four digits of the card number.

cardNetwork

string<enum> required
The card network. One of AMEX, DISCOVER, INTERAC, JCB, MASTERCARD, VISA, or OTHER.
Possible values: AMEX, DISCOVER, INTERAC, JCB, MASTERCARD, VISA, OTHER

assuranceDetails

object
3-D Secure assurance details from Google Pay.
Show child attributes

accountVerified

boolean
Whether the returned payment credential can be used for a transaction.

cardHolderAuthenticated

boolean
Whether the card is verified via 3-D Secure authentication.

billingAddress

object

Billing address as returned by Google Pay.

Refer to Google's documentation for more information.

Show child attributes

address1

string
First line of the street address.

address2

string
Second line of the street address.

address3

string
Third line of the street address.

administrativeArea

string
State, province, or region.

countryCode

string
ISO 3166-1 alpha-2 country code.

locality

string
City, town, neighborhood, or suburb.

name

string
Name of the cardholder.

phoneNumber

string
Phone number.

postalCode

string
Postal or ZIP code.

sortingCode

string
Sorting code (used in some countries).

cardFundingSource

string<enum>
The funding source of the card. One of CREDIT, DEBIT, PREPAID, or UNKNOWN.
Possible values: CREDIT, DEBIT, PREPAID, UNKNOWN

tokenizationData

object required

Contains the encrypted payment token from Google Pay.

The token field is a JSON-encoded string containing the ECv2 encrypted payment token.

Show child attributes

token

string required
The ECv2 encrypted payment token, as a JSON-encoded string.

type

string<enum> required
The tokenization type. Always PAYMENT_GATEWAY.
Possible values: PAYMENT_GATEWAY

description

string
A user-facing description of the payment method.

type

string<enum>
The type of payment method. Always CARD.
Possible values: CARD

Response

application/json

googlePay

object
Describes a Google Pay token on a Moov account.
Show child attributes

brand

string<enum> required
The card brand.
Possible values: American Express, Discover, Mastercard, Visa, Unknown

cardDisplayName

string required

User-friendly name of the tokenized card returned by Google Pay.

It usually contains the last four digits of the underlying card. There is no standard format.

cardType

string<enum> required
The type of the card.
Possible values: debit, credit, prepaid, unknown

dynamicLastFour

string 4 characters required
The last four digits of the Google Pay token, which may differ from the tokenized card's last four digits.

expiration

object required
The expiration date of the card or token.
Show child attributes

month

string 2 characters required
Two-digit month the card expires.

year

string 2 characters required
Two-digit year the card expires.

fingerprint

string <=100 characters required
Uniquely identifies a linked payment card or token. For Apple Pay, the fingerprint is based on the tokenized card number and may vary based on the user's device. This field can be used to identify specific payment methods across multiple accounts on your platform.

tokenID

string required
The unique identifier of the Google Pay token.

authMethod

string<enum>
The authentication method used for the Google Pay token.
Possible values: PAN_ONLY, CRYPTOGRAM_3DS

issuerCountry

string
Country where the underlying card was issued.

paymentMethodID

string
The new payment method's ID.
ID of the payment method.

paymentMethodType

string<enum>
The payment method type that represents a payment rail and directionality
Possible values: moov-wallet, ach-debit-fund, ach-debit-collect, ach-credit-standard, ach-credit-same-day, rtp-credit, card-payment, push-to-card, pull-from-card, apple-pay, card-present-payment, instant-bank-credit, push-to-apple-pay, pull-from-apple-pay, google-pay, push-to-google-pay, pull-from-google-pay