Update Vaulted Shopper

The Update Vaulted Shopper request enables you to update an existing vaulted shopper by changing their contact info, adding and deleting payment methods, or adding wallet details.

Note: We recommend that you first retrieve the vaulted shopper and then modify the desired property.

📘

  • Each vaulted shopper can have multiple credit cards.

  • If you send a credit card number that does not yet exist in that vaulted shopper, BlueSnap validates the card as part of adding it to the shopper.

  • If you send a credit card number that does exist in that vaulted shopper, BlueSnap validates the card and updates the shopper with any changes to that card's expiration date.

Try it in the API Explorer

Request Content

Send a vaultedShopper object, with the following:

      paymentSources     object    optional, can contain creditCardInfo (see paymentSources)
     firstName     string    required if walletId is not sent
     lastName     string    required if walletId is not sent
     merchantShopperId     string    optional
     softDescriptor     string    optional
     descriptorPhoneNumber string    optional
     country     string    optional
     state     string    optional
     address     string    optional
     address2     string    optional
     email     string    optional
     zip     string    optional
     phone     string    optional
     companyName     string     optional   Include if adding Corporate ECP account details
     shopperCurrency     string    optional
     shippingContactInfo     object    optional (see shippingContactInfo)
     walletId     long    optional   Include if adding wallet details for Visa Checkout
     transactionFraudInfo     object    optional (see transactionFraudInfo)
     threeDSecure     object    optional (see threeDSecure)
     chosenPaymentMethod     object    optional (see chosenPaymentMethod)

Response Details

The response content depends on which version of the API you are using (see Authentication & headers), as follows:

API version 2.0
If successful, the response HTTP status code is 200 OK.
The response includes the vaultedShopper object, which contains all details that are saved for that shopper.

API version 1.0
If successful, the response HTTP status code is 204 No Content.


##Examples

Request Examples

curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/19549048 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "paymentSources": {"creditCardInfo": [{"creditCard": {
        "expirationYear": 2023,
        "securityCode": 837,
        "expirationMonth": "02",
        "cardNumber": 4263982640269299
    }}]},
    "firstName": "FirstName",
    "lastName": "LastName",
    "softDescriptor": "MYCOMPANY"
}
curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/19549048 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{"walletId": 21}'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/19549048 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "paymentSources": {"creditCardInfo": [{
         "pfToken": "9688f4f6945f615b1ab6954ceb5dbf67f63d6b41fa27dbff6ac342cff9bf50fc_"
    }]},
    "firstName": "FirstName",
    "lastName": "LastName"
}
curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/21781965 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "firstName": "Jane",
    "lastName": "Shopper",
    "zip": "75001",
    "country": "fr", 
    "phone": "1234567890",
    "paymentSources": {
        "sepaDirectDebitInfo": [{ "sepaDirectDebit": {
        	"iban": "DE09100100101234567893"
          }}]}
}
curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/21781965 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{  
   "zip":"02453",
   "country":"us",
   "paymentSources":{  
      "ecpDetails":[  
         {  
            "billingContactInfo":{  
               "firstName":"FirstName 2",
               "lastName":"LastName 2"
            },
            "ecp":{  
               "routingNumber":"011075150",
               "accountType":"CONSUMER_SAVINGS",
               "accountNumber":"4099999992"
            }
         }
      ]
   },
   "firstName":"FirstName",
   "lastName":"LastName",
   "phone":"1234567890"
}
curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/19549048 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "firstName": "FirstName",
  "lastName": "LastName",
  "paymentSources": {"creditCardInfo": [{"creditCard": {
    "cardType": "VISA",
    "cardLastFourDigits": "9299"
    },
    "status": "D"}]}
}
curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/19549048 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "firstName": "John",
    "lastName": "Doe",
    "zip": "02453",
    "phone": "1234567890",
    "shopperCurrency": "USD",
    "paymentSources": {
        "ecpDetails": [
            {
                "billingContactInfo": {
                    "firstName": "John",
                    "lastName": "Doe",
                    "zip": "02453"
                },
                "ecp": {
                    "accountType": "CONSUMER_CHECKING",
                    "publicAccountNumber": "99992",
                    "publicRoutingNumber": "75150"
                },
                "status":"D"
            }
        ]
    }
}
curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/19549048 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "firstName": "FirstName",
    "lastName": "LastName",
    "country": "fr",
    "zip": "75001",
    "phone": "1234567890",
    "shopperCurrency": "USD",
    "paymentSources": {
        "sepaDirectDebitInfo": [
            {
                "billingContactInfo": {
                    "firstName": "FirstName",
                    "lastName": "LastName"
                },
                "sepaDirectDebit": {
                    "ibanFirstFour": "DE09",
                    "ibanLastFour": "7893"
                },
                "status":"D"
            }
        ]
    }
}
curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/29872832 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "firstName": "Jane",
  "lastName": "Shopper",
  "chosenPaymentMethod": {
    "chosenPaymentMethodType": "CC",
    "creditCard": {
      "cardLastFourDigits": "9299",
      "cardType": "VISA"
    }
  }
}'
curl -v -X PUT https://sandbox.bluesnap.com/services/2/vaulted-shoppers/19549048 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "paymentSources": {"creditCardInfo": [{"creditCard": {
        "cardLastFourDigits": "9299",
        "cardType": "VISA"
        "expirationMonth": "04",
        "expirationYear": "2023",
        "securityCode": 837
    }}]},
    "firstName": "FirstName",
    "lastName": "LastName"
}

Response Examples

{
  "vaultedShopperId": 19549048,
  "firstName": "FirstName",
  "lastName": "LastName",
  "country": "us",
  "zip": "02453",
  "phone": "1234567890",
  "shopperCurrency": "USD",
  "paymentSources": {
    "ecpDetails": [
      {
        "billingContactInfo": {
          "firstName": "FirstName",
          "lastName": "LastName"
        },
        "ecp": {
          "accountType": "CONSUMER_CHECKING",
          "publicAccountNumber": "99992",
          "publicRoutingNumber": "75150"
        },
        "dateCreated": "09/30/2020",
        "timeCreated": "05:59:40"
      },
      {
        "billingContactInfo": {
          "firstName": "FirstName 2",
          "lastName": "LastName 2"
        },
        "ecp": {
          "accountType": "CONSUMER_SAVINGS",
          "publicAccountNumber": "99992",
          "publicRoutingNumber": "75150"
        },
        "dateCreated": "09/30/2020",
        "timeCreated": "05:59:40"
      }
    ]
  },
  "fraudResultInfo": {"deviceDataCollector": "Y"},
  "dateCreated": "09/22/2020",
  "timeCreated": "13:41:10"
}
{
    "paymentSources": {"creditCardInfo": [{
        "billingContactInfo": {
            "firstName": "FirstName",
            "lastName": "LastName",
            "city": ""
        },
        "processingInfo": {
            "avsResponseCodeAddress": "U",
            "cvvResponseCode": "MA",
            "avsResponseCodeName": "U",
            "avsResponseCodeZip": "U"
        },
        "creditCard": {
            "expirationYear": 2023,
            "cardLastFourDigits": 9299,
            "cardSubType": "CREDIT",
            "cardType": "VISA",
            "expirationMonth": "02"
        }
    }]},
    "firstName": "FirstName",
    "lastName": "LastName",
    "vaultedShopperId": 19549048,
    "shopperCurrency": "USD",
    "lastPaymentInfo": {
        "paymentMethod": "CC",
        "creditCard": {
            "cardLastFourDigits": "0026",
            "cardType": "VISA",
            "cardCategory": "CLASSIC"
        }
    },
    "fraudResultInfo": {"deviceDataCollector": "N"}
}
HTTP/ 1.1 204 No Content

Example Descriptions

Add Credit Card

This example request shows how to add another credit card to an existing vaulted shopper.

Add Wallet Details using Wallet ID

This example request adds details from a wallet (e.g. Visa Checkout). This will add the credit card info from the wallet to the vaulted shopper.

Add Payment Details using Hosted Payment Fields token

This example request adds payment details collected by Hosted Payment Fields to the vaulted shopper.

Add bank account details for SEPA Direct Debit payment method

This example request adds bank account details for the SEPA Direct Debit payment method.

Update expiration date

This example request shows how to update the expiration date on a vaulted shopper credit card. For the update to happen, the full credit card number is not required. Include the cardLastFourDigits, the cardType, and either the expirationMonth, expirationYear, or both. The new card will then be authorized. Note: you are not required to specify the securityCode, but if it is present, it will be used in the authorization process.

Delete* credit card

This example request shows how to delete a credit card from a vaulted shopper. Include the status property in the request and set its value to D. Specify the card to be deleted by including cardType and cardLastFourDigits.

Delete* ACH/ECP

This example request shows how to delete an ACH/ECP payment method from a vaulted shopper. Include the status property in the request and set its value to D. Specify the ecpDetails to be deleted by including accountType, publicAccountNumber, and publicRoutingNumber.

Delete* SEPA

This example request shows how to delete a SEPA payment method from a vaulted shopper. Include the status property in the request and set its value to D. Specify the sepaDirectDebit to be deleted by including ibanFirstFour and ibanLastFour.

Add a chosen payment method

This example request shows how to specify a vaulted shopper's chosen (default) credit card from their saved credit cards. Include chosenPaymentMethod in the request with the card details. To create a transaction with the shopper's chosen card, simply omit the payment details from the transaction request. BlueSnap will use the shopper's default card to process the transaction.

* Notes on deleting a payment method
  • If you attempt to delete a payment method that is linked to a subscription, an error occurs. Send an Update Subscription request to either switch the shopper's payment source or to cancel the subscription, and then retry the Update Vaulted Shopper request to delete the payment method.

  • You cannot delete a payment method if there is a payment pending approval for the payment method.


Back to Top

API Explorer

To test out a call, in the vaultedShopperId field, enter the ID of an existing vaulted shopper. In the Body Content field, paste in the JSON portion of the request and then click Try it!

Tip: Use the JSON code below as a starting point. You can enter different parameters and test credit card numbers to see how your test scenario would work. The request headers, including authorization, are already built in for you in this test area, so you should not include them here.

{
    "paymentSources": {"creditCardInfo": [{"creditCard": {
        "expirationYear": 2023,
        "securityCode": 837,
        "expirationMonth": "02",
        "cardNumber": 4263982640269299
    }}]},
    "firstName": "FirstName",
    "lastName": "LastName"
}
Language
Authorization
:
Click Try It! to start a request and see the response here!