Overview

Through Bring Your Own Token (BYOT), merchants who tokenize cards with another Payment Service Provider (PSP) or who vault Network Tokens themselves can use their existing Network Tokens with Braintree.

Creating transactionsAnchorIcon

Creating a transaction with a network token is a two-step process. First, a network token single-use payment method must be created using the tokenizeNetworkToken mutation. The response will contain the single-use payment method ID which will then be used with the authorizeCreditCard or chargeCreditCard  mutation to create the transaction. The required parameters differ based on whether a customer initiated transaction (CIT) or a merchant initiated transaction (MIT) is being created.

Customer initiated transactionsAnchorIcon

This flow is used for all CIT transactions including the first in a recurring series.

Step 1: Create single-use payment methodAnchorIcon

The tokenizeNetworkToken mutation is used to create a single-use payment method. The response will contain the single-use payment method ID which will then be used to create a transaction.

Required parametersAnchorIcon

  • Network token expirationMonth and expirationYear
  • Network token number
  • cryptogram
  • origin = "NETWORK_TOKEN"
  • sourceCardLast4 Refer to NetworkTokenInput for additional detail.
    1. Mutation
    mutation TokenizeNetworkToken($input: TokenizeNetworkTokenInput!) {
      tokenizeNetworkToken(input: $input) {
        paymentMethod {
          id
          usage
        }
      }
    }
    1. Variables
    { "input": { "clientMutationId": "abc123", "networkToken": { "expirationYear": 2024, "expirationMonth": 12, "cryptogram": "/wAAAAAAAcb8AlGUF/1JQEkAAAA=", "number": 4111111111111111, "originDetails": { "origin": "NETWORK_TOKEN", "sourceCardLast4": "1234" } } } }
    1. Response
    { "data": { "tokenizeNetworkToken": { "paymentMethod": { "id": "id_of_payment_method", "usage": "SINGLE_USE" } } }, "extensions": { "requestId": "a-uuid-for-the-request" } }

Step 2: create transactionAnchorIcon

The authorizeCreditCard or chargeCreditCard mutation is then used to create the transaction providing the paymentMethodIdobtained in step 1.

  1. Mutation
mutation ChargeCreditCard($input: ChargeCreditCardInput!) {
  chargeCreditCard(input: $input) {
    transaction {
      id
      status
      paymentMethodSnapshot {
        __typename
        ... on CreditCardTransactionDetails {
          processedWithCardOnFileNetworkToken
        }
      }
    }
  }
}
  1. Variables
{ "input": { "paymentMethodId": "id_of_payment_method", "transaction": { "amount": "10.00" } } }
  1. Response
{ "data": { "chargeCreditCard": { "transaction": { "id": "id_of_transaction", "status": "SUBMITTED_FOR_SETTLEMENT", "paymentMethodSnapshot": { "__typename": "CreditCardTransactionDetails", "processedWithCardOnFileNetworkToken": true } } } }, "extensions": { "requestId": "a-uuid-for-the-request" } }

Merchant initiated transactionsAnchorIcon

This flow is to be used for all MIT transactions including subsequent transactions in a recurring series.

Step 1: Create single-use payment methodAnchorIcon

The tokenizeNetworkToken mutation is used to create a single-use payment method. The response will contain the single-use payment method ID which will then be used to create a transaction. A cryptogram is not required for the MIT flow.

Required parametersAnchorIcon

  • Network token expirationMonth and expirationYear     
  • Network token number     
  • origin = "NETWORK_TOKEN"     
  • sourceCardLast4 Refer to NetworkTokenInput for additional detail.

  1. Mutation
mutation TokenizeNetworkToken($input: TokenizeNetworkTokenInput!) {
  tokenizeNetworkToken(input: $input) {
    paymentMethod {
      id
      usage
    }
  }
}
  1. Variables
{ "input": { "clientMutationId": "abc123", "networkToken": { "expirationYear": 2024, "expirationMonth": 12, "number": 4111111111111111, "originDetails": { "origin": "NETWORK_TOKEN", "sourceCardLast4": "1234" } } } }
  1. Response
{ "data": { "tokenizeNetworkToken": { "paymentMethod": { "id": "id_of_payment_method", "usage": "SINGLE_USE" } } }, "extensions": { "requestId": "a-uuid-for-the-request" } }

Step 2: create transactionAnchorIcon

The authorizeCreditCard or chargeCreditCard mutation is then used to create the transaction providing the paymentMethodId obtained in step 1. As a cryptogram is not provided in the MIT flow, additional parameters are required including a network transaction (NTI) using verifyingNetworkTransactionId.

Required parametersAnchorIcon
  • paymentInitiator = "RECURRING", "UNSCHEDULED", or "INSTALLMENT"     
  • externalVault.status = "VAULTED"     
  • externalVault.verifyingNetworkTransactionId
    1. Mutation
    mutation ChargeCreditCard($input: ChargeCreditCardInput!) {
      chargeCreditCard(input: $input) {
        transaction {
          id
          status
          paymentMethodSnapshot {
            __typename
            ... on CreditCardTransactionDetails {
              processedWithCardOnFileNetworkToken
            }
          }
        }
      }
    }
    1. Variables
    { "input": { "paymentMethodId": "id_of_payment_method", "transaction": { "amount": "10.00", "paymentInitiator": "RECURRING" }, "options": { "externalVault": { "status": "VAULTED", "verifyingNetworkTransactionId": "123456789012345" } } } }
    1. Response
    { "data": { "chargeCreditCard": { "transaction": { "id": "id_of_transaction", "status": "SUBMITTED_FOR_SETTLEMENT", "paymentMethodSnapshot": { "__typename": "CreditCardTransactionDetails", "processedWithCardOnFileNetworkToken": true } } } }, "extensions": { "requestId": "a-uuid-for-the-request" } }