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.
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
endusing 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[
{
"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"
}
}
]Response headers
x-request-id
string
required
{
"error": "string"
}Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
{
"error": "string"
}Response headers
x-request-id
string
required
{
"error": "string",
"merchantAccountID": "string",
"paymentMethodData": "string"
}Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Headers
X-Moov-Version
string
v2026.04.00
Path parameters
accountID
string
required
Body
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
gatewayMerchantId
value passed to Google Pay when constructing the PaymentDataRequest. card-gateway validates
that the decrypted gatewayMerchantId matches this value.
paymentMethodData
object
required
paymentMethodData object from Google Pay's
PaymentData response.
Show child attributes
info
object
required
Show child attributes
cardDetails
string
required
cardNetwork
string<enum>
required
AMEX,
DISCOVER,
INTERAC,
JCB,
MASTERCARD,
VISA,
OTHER
assuranceDetails
object
Show child attributes
accountVerified
boolean
cardHolderAuthenticated
boolean
billingAddress
object
Billing address as returned by Google Pay.
Refer to Google's documentation for more information.
Show child attributes
address1
string
address2
string
address3
string
administrativeArea
string
countryCode
string
locality
string
name
string
phoneNumber
string
postalCode
string
sortingCode
string
cardFundingSource
string<enum>
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
type
string<enum>
required
PAYMENT_GATEWAY.
PAYMENT_GATEWAY
description
string
type
string<enum>
CARD.
CARD
Response
googlePay
object
Show child attributes
brand
string<enum>
required
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
debit,
credit,
prepaid,
unknown
dynamicLastFour
string
4 characters
required
expiration
object
required
Show child attributes
month
string
2 characters
required
year
string
2 characters
required
fingerprint
string
<=100 characters
required
tokenID
string
required
authMethod
string<enum>
PAN_ONLY,
CRYPTOGRAM_3DS
issuerCountry
string
paymentMethodID
string
paymentMethodType
string<enum>
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