Create Wallet

Definition

https://sandbox.bluesnap.com/services/2/wallets


The Create Wallet request is where you provide the initial parameters required by the wallet processor to launch the wallet's payment page. The response includes the wallet token. Keep in mind, only payment methods supported by BlueSnap can be processed.

👍

This currently supports Apple Pay on the web and the Visa Checkout wallet. For detailed setup instructions, see:

For information on Google Pay, refer to our Google Pay™ Guide.


Apple Pay

JSON

JSON Request Content

Send a wallet object, with the following:

PropertyTypeRequired
walletTypestringrequired
validationUrlstringrequired
domainNamestringrequired
displayNamestringoptional

JSON Response Details

If successful, the response HTTP status code is 200 OK.
The response includes the wallet object with the following:

PropertyType
walletTypestring
walletTokenstring

JSON Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "walletType": "APPLE_PAY", 
  "validationUrl": "https://apple-pay-gateway-cert.apple.com/paymentservices/startSession", 
  "domainName": "merchant.com"
}'

Response Examples

{
    "walletType": "APPLE_PAY",
    "walletToken":"ImRhdGEiOiJuY1AvRitIUy8zeG5ISk1pSm9RbXhCMFd"
}

Note: Be sure that the domainName is the domain you registered during domain verification.

Back to Top

Visa Checkout

JSON

JSON Request Content

Send a wallet object, with the following:

PropertyTypeRequired
walletTypestringrequired
callIdstringrequired

JSON Response Details

If successful, the response HTTP status code is 200 OK.
The response includes the wallet object with the following:

PropertyType
walletIdlong
firstNamestring
lastNamestring
emailstring
countrystring
phonestring
creditCardobject
billingContactInfoobject
shippingContactInfoobject

JSON Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "callId": 5549711876630985101,
    "walletType": "VISA_CHECKOUT"
}'

Response Examples

{
    "country": "us",
    "walletId": 2203,
    "firstName": "Ben",
    "lastName": "Li",
    "billingContactInfo": {
        "zip": 12324,
        "country": "us",
        "firstName": "Ben",
        "lastName": "Li",
        "city": "Santa Barbara",
        "address1": "BlueSnap Street",
        "state": "CA"
    },
    "phone": 5032541004,
    "shippingContactInfo": {
        "zip": 12324,
        "country": "us",
        "firstName": "Ben",
        "lastName": "Li",
        "city": "Santa Barbara",
        "phone": 5032541004,
        "address1": "BlueSnap Street",
        "state": "CA"
    },
    "creditCard": {
        "expirationYear": 2020,
        "cardLastFourDigits": 4821,
        "cardType": "VISA",
      	"cardSubType": "CREDIT", 
      	"cardCategory": "CLASSIC",
        "expirationMonth": 8
    },
    "email": "ben.li@bluesnap.com"
}

Back to Top

Apple Pay

XML

XML Request Content

Send a wallet object, with the following:

PropertyTypeRequired
wallet-typestringrequired
validation-urlstringrequired
domain-namestringrequired
display-namestringoptional

XML Response Details

If successful, the response HTTP status code is 200 OK.
The response includes the wallet object with the following:

PropertyType
wallet-typestring
wallet-tokenstring

XML Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<wallet xmlns="http://ws.plimus.com">
   <wallet-type>APPLE_PAY</wallet-type>
   <validation-url>https://apple-pay-gateway-cert.apple.com/paymentservices/startSession</validation-url>
   <display-name>My store</display-name>
</wallet>'

Response Examples

<wallet xmlns="http://ws.plimus.com">
  <wallet-type>APPLE_PAY</wallet-type>
  <wallet-token>ImRhdGEiOiJuY1AvRitIUy8zeG5ISk1pSm9RbXhCMFd</wallet-token>
</wallet>

Note: Be sure that the domain-name is the domain you registered during domain verification.

Back to Top

Visa Checkout

XML

XML Request Content

wallet container    required, contains the following properties (see wallet):

PropertyTypeRequired
wallet-typestringrequired
store-idstringrequired - Extended Payment API only
call-idstringrequired

XML Response Details

If successful, the response HTTP status code is 200 OK.
The response includes the wallet resource with the following:

PropertyType
wallet-idlong
first-namestring
last-namestring
emailstring
countrystring
phonestring
credit-cardcontainer
billing-contact-infocontainer
shipping-contact-infocontainer

XML Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<wallet xmlns="http://ws.plimus.com">
   <wallet-type>VISA_CHECKOUT</wallet-type>
   <call-id>5549711876630985101</call-id>
</wallet>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<wallet xmlns="http://ws.plimus.com">
   <wallet-type>VISA_CHECKOUT</wallet-type>
   <store-id>16500</store-id>
   <call-id>5549711876630985101</call-id>
</wallet>'

Response Examples

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wallet xmlns="http://ws.plimus.com">
    <wallet-id>2203</wallet-id>
    <first-name>Ben</first-name>
    <last-name>Li</last-name>
    <email>ben.li&#x40;bluesnap.com</email>
    <country>us</country>
    <phone>5032541004</phone>
    <credit-card>
        <card-last-four-digits>4821</card-last-four-digits>
        <card-type>VISA</card-type>
        <card-sub-type>CREDIT</card-sub-type>
      	<card-category>CLASSIC</card-category>
        <expiration-month>8</expiration-month>
        <expiration-year>2020</expiration-year>
    </credit-card>
    <billing-contact-info>
        <first-name>Ben</first-name>
        <last-name>Li</last-name>
        <address1>BlueSnap Street</address1>
        <city>Santa Barbara</city>
        <state>CA</state>
        <zip>12324</zip>
        <country>us</country>
    </billing-contact-info>
    <shipping-contact-info>
        <first-name>Ben</first-name>
        <last-name>Li</last-name>
        <address1>BlueSnap Street</address1>
        <city> Santa Barbara </city>
        <state>CA</state>
        <zip>12324</zip>
        <country>us</country>
        <phone>5032541004</phone>
    </shipping-contact-info>
</wallet>

Back to Top