See also the Braintree_PaymentMethod response object.

availability

The Grant API is currently in a limited release. To determine whether it's right for your needs and to request access to the API, contact commerceinfrastructure@braintreepayments.com.

The Grant API allows you to give another Braintree merchant controlled access to one of your customer's payment methods.

PHP
$gateway = new Braintree_Gateway([
    'accessToken' => useAccessTokenForMerchant,
]);

gateway->paymentMethod()->grant(
  'the_token',
  ['allow_vaulting' => false, 'include_billing_postal_code' => true]
);
Arguments
sharedPaymentMethodToken required, string

The alphanumeric value that references a specific payment method stored in your Vault.

Additional Parameters
'allowVaulting' boolean

Whether or not the receiving merchant may use the resulting nonce to store the payment method in their own Vault for future use.

'includeBillingPostalCode' boolean

If true, any payment methods or transactions created using the nonce will include the billing postal code from your Vault record.

'revokeAfter' DateTime

A datetime, specified to the hour, after which the grant will automatically be revoked. The datetime should be in ISO 8601 format.

Still have questions?

If you can’t find an answer, contact our Support team.