Braintree Grant Customer Token

Tokenizing granted nonces for use with Braintree payments

Create a Braintree grant customer token

Here is an example of a successful request for a Braintree grant tokenization to accept USD payment in the US.

Create customer token using a Braintree grant (nonce)

POST https://staging.api.xpay.xcover.com/customer-tokens/braintree-grant

Headers

Name
Type
Description

Authorization*

String

Bearer {{JWT}}

{
    "country": "US",
    "currency": "USD",
    "underwriter": "Asservo",
    "customer": {
      "email": "[email protected]"
    },
    "nonce": "fake-valid-no-billing-address-nonce"
}

Create customer token using a Braintree Shared Vault

POST https://staging.api.xpay.xcover.com/customer-tokens/braintree-grant

Headers

Name
Type
Description

Authorization*

String

Bearer {{JWT}}

{
    "country": "US",
    "currency": "USD",
    "customer": {
      "email": "[email protected]"
    },
    "shared_vault_token": "abc123"
}

Failure Scenarios

There are several reasons why a tokenization of a nonce may fail. Here are some examples.

Invalid or expired nonce

{
  "country": "US",
  "currency": "USD",
  "customer": {
  	"email": "[email protected]"
  },
  "nonce": "invalid-nonce"
}

Missing or invalid customer data

{
  "country": "US",
  "currency": "USD",
  "customer": {
  	"email": ""
  },
  "nonce": "fake-valid-no-billing-address-nonce"
}

Invalid underwriter / currency / country combination

{
  "country": "US",
  "currency": "GBP",
  "underwriter": "Non-existent Underwriter",
  "customer": {
  	"email": "[email protected]"
  },
  "nonce": "fake-valid-no-billing-address-nonce"
}

Last updated