{"_id":"59dfa5848b51880010b74ae6","category":{"_id":"59dfa5828b51880010b74abd","version":"59dfa5828b51880010b74ab6","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-10-19T18:31:30.299Z","from_sync":false,"order":6,"slug":"vaulted-shopper-service","title":"Vaulted Shoppers"},"parentDoc":null,"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"59dfa5828b51880010b74ab6","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-10-12T17:25:22.850Z","releaseDate":"2017-10-12T17:25:22.850Z","categories":["59dfa5828b51880010b74ab7","59dfa5828b51880010b74ab8","59dfa5828b51880010b74ab9","59dfa5828b51880010b74aba","59dfa5828b51880010b74abb","59dfa5828b51880010b74abc","59dfa5828b51880010b74abd","59dfa5828b51880010b74abe","59dfa5828b51880010b74abf","59dfa5828b51880010b74ac0","59dfa5828b51880010b74ac1","59dfa5828b51880010b74ac2","59dfa5828b51880010b74ac3","59dfa5828b51880010b74ac4","59dfa5828b51880010b74ac5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.23 Release","version_clean":"8976.0.0-JSON","version":"8976-JSON"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-28T20:04:43.276Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"language":"text","code":""}]},"settings":"57ee593a21ceb20e0061959e","examples":{"codes":[]},"method":"post","auth":"optional","params":[],"url":"/vaulted-shoppers"},"isReference":true,"order":0,"body":"The Create Vaulted Shopper request enables you to store a shopper's details (including payment info) securely in BlueSnap. BlueSnap will provide a token (`vaultedShopperId`) for that saved shopper.\n\nYou can then use the `vaultedShopperId` in order to complete payment transactions, improve the checkout experience for a returning shopper, and update the shopper's payment details. For an example of using the `vaultedShopperId` for a returning shopper, see [Returning shopper tutorial](doc:returning-shopper-tutorial).\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"* Each vaulted shopper can have multiple credit cards.\\n* If you add a credit card to a vaulted shopper, BlueSnap will validate the card before adding it to the shopper. \\n* To create a shopper with wallet details for MasterPass or Visa Checkout, including the payment info and billing and shipping info, you will simply include the `walletId` in the request. For details, see:\\n  * [MasterPass Guide](/v1.0/docs/masterpass)\\n  * [Visa Checkout Guide](/v1.0/docs/visa-checkout)\"\n}\n[/block]\n<a class=\"btn btn-success\" href=\"#section-api-explorer-api-version-2-0-\" role=\"button\">Try it in the API Explorer</a>\n\n###Request Content\n\nSend a **[vaultedShopper](doc:vaulted-shopper)** object, with the following:\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`paymentSources` &nbsp;&nbsp;&nbsp; *object* &nbsp;&nbsp;&nbsp;optional (see [paymentSources](doc:payment-sources))\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`firstName` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required** if `walletId` is not sent</span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`lastName` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required** if `walletId` is not sent</span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`softDescriptor` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`descriptorPhoneNumber` *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`merchantShopperId` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`country` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`state` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`city` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`address` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`address2` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`email` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`zip` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`phone` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`companyName` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp; <span style=\"color:#F37500\">**required** for Corporate ECP accounts</span>\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`shopperCurrency` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;optional\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`shippingContactInfo` &nbsp;&nbsp;&nbsp; *object* &nbsp;&nbsp;&nbsp;optional (see [shippingContactInfo](doc:shipping-contact-info))\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`walletId` &nbsp;&nbsp;&nbsp; *long* &nbsp;&nbsp;&nbsp;optional &nbsp; Include if adding details for MasterPass or Visa Checkout \n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`transactionFraudInfo` &nbsp;&nbsp;&nbsp; *object* &nbsp;&nbsp;&nbsp;optional (see [transactionFraudInfo](doc:transaction-fraud-info))\n\n###Response Details\nThe response content depends on which version of the API you are using (see [Authentication & headers](/v1.0/docs/authentication)), as follows:\n\n**API version 2.0**\nIf successful, the response HTTP status code is 200 OK.\nThe response includes the [vaultedShopper](doc:vaulted-shopper) object, which contains all details that are saved for that shopper.\nThe `vaultedShopperId` appears in the response body, as well as in the URL in the location header. In the example below, the `vaultedShopperId` is **20848977**.\n\n**API version 1.0**\nIf successful, the response HTTP status code is 201 Created.\nThe `vaultedShopperId` appears in the URL in the location header. In the example below, the `vaultedShopperId` is **19549020**.\nThere is no content in the response body.\n\n<hr>\n\n##Examples\n\n###Request Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\"\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Create Vaulted Shopper Request: basic\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n    \\\"paymentSources\\\": {\\\"creditCardInfo\\\": [{\\\"creditCard\\\": {\\n        \\\"expirationYear\\\": 2018,\\n        \\\"securityCode\\\": 837,\\n        \\\"expirationMonth\\\": \\\"02\\\",\\n        \\\"cardNumber\\\": 4263982640269299\\n    }}]},\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\"\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"with credit card\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n    \\\"paymentSources\\\": {\\\"creditCardInfo\\\": [{\\n        \\\"billingContactInfo\\\": {\\n            \\\"zip\\\": \\\"01752\\\",\\n            \\\"country\\\": \\\"US\\\",\\n            \\\"firstName\\\": \\\"billingFirstName\\\",\\n            \\\"lastName\\\": \\\"billingLastName\\\",\\n            \\\"address2\\\": \\\"Apt 1\\\",\\n            \\\"address1\\\": \\\"10 Main St\\\",\\n            \\\"state\\\": \\\"MA\\\",\\n            \\\"email\\\": \\\"email:::at:::example.com\\\"\\n        },\\n        \\\"creditCard\\\": {\\n            \\\"expirationYear\\\": 2018,\\n            \\\"securityCode\\\": 837,\\n            \\\"expirationMonth\\\": \\\"02\\\",\\n            \\\"cardNumber\\\": 4263982640269299\\n        }\\n    }]},\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\"\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"with credit card and billing info\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n    \\\"paymentSources\\\": {\\\"creditCardInfo\\\": [{\\n        \\\"billingContactInfo\\\": {\\n            \\\"zip\\\": \\\"01752\\\",\\n            \\\"country\\\": \\\"US\\\",\\n            \\\"firstName\\\": \\\"billingFirstName\\\",\\n            \\\"lastName\\\": \\\"billingLastName\\\",\\n            \\\"address2\\\": \\\"Apt 1\\\",\\n            \\\"address1\\\": \\\"10 Main St\\\",\\n            \\\"state\\\": \\\"MA\\\",\\n            \\\"email\\\": \\\"email@example.com\\\"\\n        },\\n        \\\"creditCard\\\": {\\n            \\\"expirationYear\\\": 2018,\\n            \\\"securityCode\\\": 837,\\n            \\\"expirationMonth\\\": \\\"02\\\",\\n            \\\"cardNumber\\\": 4263982640269299\\n        }\\n    }]},\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\",\\n    \\\"transactionFraudInfo\\\": {\\n        \\\"shopperIpAddress\\\": \\\"123.12.134.1\\\",\\n        \\\"fraudSessionId\\\": 1234,\\n        \\\"company\\\": \\\"company\\\",\\n        \\\"shippingContactInfo\\\": {\\n            \\\"zip\\\": \\\"shippingZip\\\",\\n            \\\"country\\\": \\\"US\\\",\\n            \\\"firstName\\\": \\\"shippingLastName\\\",\\n            \\\"lastName\\\": \\\"shippingFirstName\\\",\\n            \\\"city\\\": \\\"shippingCity\\\",\\n            \\\"address2\\\": \\\"shippingAddress2\\\",\\n            \\\"address1\\\": \\\"shippingAddress1\\\",\\n            \\\"state\\\": \\\"AL\\\"\\n        }\\n    }\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"with credit card, billing info and fraud info\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n    \\\"paymentSources\\\": {\\\"creditCardInfo\\\": [{\\\"creditCard\\\": {\\n        \\\"expirationYear\\\": 2016,\\n        \\\"encryptedCardNumber\\\": \\\"$bsjs_1_0_3$B23uuxq8drUwOYZm3wZi+Qm69V5GPEt8PEio+Edwcm8akczQSK7odgLQH/Au+VqOCsGspW1Q9mPyQIzGLSZLVToAQVfq5C1ld+2ogIIsDL32Hd6IojboLyVlYT1FvPQoDyz19K6N0CUHh5uk0kCLuHSUyjvoJH38ojHZifbJSm/7S5vAtiuC3BJt2z8k9nauQaAXkbyoAYwrS1yDpqOt2k2lGhKcmdQ4ImDR0RL8m8xig6sFrki9oqo3Mju/M5r7wXXVTf7TMtWiQbzdfREOxKUnviXJZpncdHqVjj5GvPYun2qgopKVKr8F5+yd19TVW2gvA1kXBkXonFL9159Gxg==$zckJgo2i8jXDiAHwVVHBKypXFnWqF2e+6luBkmtQQRKniDXyXaalRVKLtYscBaGd$W7Ojqk1Q2iOJVeGL39RAsZTtfup3f1deSzvxrvC9rXA=\\\",\\n        \\\"encryptedSecurityCode\\\": \\\"$bsjs_1_0_3$MB1nBpok/YkuWPG1/7e6dyFFhDPHB8p8E9Yo+0YHHV+xkHuzFKr02wAnE8PJ8QCzWH+2ctXy5FN6wLKjwFrfTOgy0BJ9k9+NDEe8mhsu66wMlyc3lnwrbvMRCWN1O+5gUNCFExj7B0mDtf4gtxecXs74KZ5l5dbpGWdKUk5i7OewWyTqsONbn9taLfVBOwuIOy2Jgi4fx+yB8Q05KdZeHSNSBJh8H/47AUNAn5dM+d9iO6yGQB3obzEzzR3UtHlkGR52ZsgbbFh0JMm9lBM2ClgYM8jvmQjS9HX2ojt1fkbhuPEb1IY/M498a+1wDPpI4aMfDxO1lSpJneRSpY5k4g==$XaKq1NbPcS0iHy9N9jHekEIByHYS4G3wJXlC9EQjAGM=$BJn6X6mBYGUo8Eoq4RQz69gsi4Azl8jT973mNpG9Yuo=\\\",\\n        \\\"cardType\\\": \\\"VISA\\\",\\n        \\\"expirationMonth\\\": \\\"07\\\"\\n    }}]},\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\"\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"with encrypted card details\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\\"walletId\\\": 21}'\",\n      \"language\": \"curl\",\n      \"name\": \"with wallet ID\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n    \\\"paymentSources\\\": {\\\"creditCardInfo\\\": [{\\\"pfToken\\\": \\\"9688f4f6945f615b1ab6954ceb5dbf67f63d6b41fa27dbff6ac342cff9bf50fc_\\\"}]},\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\"\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"with Hosted Payment Fields token\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n    \\\"zip\\\": 12345,\\n    \\\"country\\\": \\\"us\\\",\\n    \\\"paymentSources\\\": {\\\"ecpInfo\\\": {\\\"ecp\\\": {\\n        \\\"routingNumber\\\": \\\"011075150\\\",\\n        \\\"accountType\\\": \\\"CONSUMER_CHECKING\\\",\\n        \\\"accountNumber\\\": 4099999992\\n    }}},\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\",\\n    \\\"phone\\\": 1234567890\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"with ACH/ECP\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n    \\\"paymentSources\\\": {\\\"creditCardInfo\\\": [{\\\"creditCard\\\": {\\n        \\\"expirationYear\\\": 2018,\\n        \\\"securityCode\\\": 837,\\n        \\\"expirationMonth\\\": \\\"02\\\",\\n        \\\"cardNumber\\\": 4263982640269299\\n    }}]},\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\",\\n    \\\"softDescriptor\\\": \\\"MYCOMPANY\\\"\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"with credit card and soft descriptor\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"firstName\\\": \\\"Jane\\\", \\n  \\\"lastName\\\": \\\"Shopper\\\", \\n  \\\"zip\\\": \\\"12345\\\", \\n  \\\"country\\\": \\\"fr\\\",\\n  \\\"phone\\\": \\\"1234567890\\\", \\n  \\\"paymentSources\\\": {\\n    \\\"sepaDirectDebitInfo\\\": [{ \\\"sepaDirectDebit\\\": {\\n          \\\"iban\\\": \\\"DE09100100101234567893\\\"\\n    }}]}\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"with SEPA Direct Debit\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"paymentSources\\\": {\\\"creditCardInfo\\\": [{\\n        \\\"billingContactInfo\\\": {\\n            \\\"firstName\\\": \\\"FirstName\\\",\\n            \\\"lastName\\\": \\\"LastName\\\",\\n            \\\"city\\\": \\\"\\\"\\n        },\\n        \\\"processingInfo\\\": {\\n            \\\"avsResponseCodeAddress\\\": \\\"U\\\",\\n            \\\"cvvResponseCode\\\": \\\"MA\\\",\\n            \\\"avsResponseCodeName\\\": \\\"U\\\",\\n            \\\"avsResponseCodeZip\\\": \\\"U\\\"\\n        },\\n        \\\"fraudResultInfo\\\": {\\\"deviceDataCollector\\\": \\\"N\\\"},\\n        \\\"creditCard\\\": {\\n            \\\"expirationYear\\\": 2018,\\n            \\\"cardLastFourDigits\\\": 9299,\\n            \\\"cardSubType\\\": \\\"CREDIT\\\",\\n            \\\"cardType\\\": \\\"VISA\\\",\\n          \\t\\\"cardCategory\\\": \\\"CLASSIC\\\",\\n            \\\"expirationMonth\\\": \\\"02\\\"\\n        }\\n    }]},\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\",\\n    \\\"vaultedShopperId\\\": 20848977,\\n    \\\"shopperCurrency\\\": \\\"USD\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Create Vaulted Shopper Response: 200 OK - API v2.0\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 201 Created\\nLocation: https://sandbox.bluesnap.com/services/2/vaulted-shoppers/19549020\",\n      \"language\": \"http\",\n      \"name\": \"201 Created - API v1.0\"\n    }\n  ]\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##Example Descriptions\nFor details about the above examples, see:\n  * [Basic Create Vaulted Shopper](create-vaulted-shopper#section-basic-create-vaulted-shopper)\n  * [Create Vaulted Shopper with credit card](create-vaulted-shopper#section-create-vaulted-shopper-with-credit-card)\n  * [Create Vaulted Shopper with credit card and billing info](create-vaulted-shopper#section-create-vaulted-shopper-with-credit-card-and-billing-info)\n  * [Create Vaulted Shopper with credit card, billing info and fraud info](create-vaulted-shopper#section-create-vaulted-shopper-with-credit-card-billing-info-and-fraud-info)\n  * [Create Vaulted Shopper with encrypted credit card](create-vaulted-shopper#section-create-vaulted-shopper-with-encrypted-credit-card)\n  * [Create Vaulted Shopper with wallet](create-vaulted-shopper#section-create-vaulted-shopper-with-wallet)\n  * [Create Vaulted Shopper with Hosted Payment Fields token](create-vaulted-shopper#section-create-vaulted-shopper-with-hosted-payment-fields-token)\n  * [Create Vaulted Shopper with ACH/ECP info](create-vaulted-shopper#section-create-vaulted-shopper-with-ach-ecp-info)\n  * [Create Vaulted Shopper with credit card and soft descriptor](#section-create-vaulted-shopper-with-credit-card-and-soft-descriptor)\n  * [Create Vaulted Shopper with SEPA Direct Debit](#section-create-vaulted-shopper-with-sepa-direct-debit)\n\n###Basic Create Vaulted Shopper\nThis example shows a basic Create Vaulted Shopper request that saves the shopper in BlueSnap without any information about the shopper's payment methods.\n\n###Create Vaulted Shopper with credit card\nTo save credit card information for the shopper, you'll need to include the `creditCardInfo` property within the `paymentSources` object in your request. See [creditCardInfo](doc:credit-card-info). Note that you must meet specific [PCI compliance](/v1.0/docs/pci-compliance) requirements in order to send unencrypted card details.\n\nAbove is an example of a request with an unencrypted credit card number.\n\n###Create Vaulted Shopper with credit card and billing info\nOptionally, you can include the shopper's billing info in the `creditCardInfo` property within the `paymentSources` object in your request. See [creditCardInfo](doc:credit-card-info). This can help improve the experience for returning shoppers, because you can save time by pre-populating the checkout form with their billing details.\n\nAbove is an example of a request with credit card details along with billing info.\n\n###Create Vaulted Shopper with credit card, billing info and fraud info\nOptionally, you can include fraud info in the request, so that your fraud checks can run and verify that you are not saving a shopper with payment info that is suspected to be fraudulent.\n\nAbove is an example of a request with that includes fraud info such as the shopper's IP address and shipping address.\n\n###Create Vaulted Shopper with encrypted credit card\nYour [PCI compliance](/v1.0/docs/pci-compliance) requirements and API permission level may require that you send credit card data in encrypted format only. To do this, you'll need to include the`encryptedCardNumber` and `encryptedSecurityCode` properties within the [creditCardInfo](doc:credit-card-info) object in your request.\n\nAbove is an example of a request with an encrypted credit card number.\n\n###Create Vaulted Shopper with wallet\nTo create a shopper with wallet details, including the payment info and billing and shipping info, you will simply include the `walletId` in the request. No other elements are required. \n\nFor details, see:\n  * [MasterPass Guide](/v1.0/docs/masterpass)\n  * [Visa Checkout Guide](/v1.0/docs/visa-checkout)\n\nAbove is an example of a request with a wallet ID.\n\n###Create Vaulted Shopper with Hosted Payment Fields token\nIf you are using BlueSnap's [Hosted Payment Fields](/v4.0/docs/hosted-payment-fields), you can save the shopper's payment information from the Hosted Payment Fields by including the token within the `pfToken` property in your request.\n\nAbove is an example of a request with the Hosted Payment Fields token.\n\n###Create Vaulted Shopper with ACH/ECP info\nTo save ACH/ECP account info for a shopper, include the [ecpInfo](doc:ecp-info) element in your request. Only one ACH/ECP account can be saved per shopper.\n\n###Create Vaulted Shopper with credit card and soft descriptor\nThe above example shows how to create a shopper with a credit card and soft descriptor, which is the description that may appear on the shopper's bank statement when BlueSnap validates the card before adding it to the shopper. \n\n###Create Vaulted Shopper with SEPA Direct Debit \nThe above example shows a Create Vaulted Shopper request with bank account details for the [SEPA Direct Debit](/v1.0/docs/sepa-direct-debit) payment method. Include the shopper's bank account details within `paymentSources` > `sepaDirectDebitInfo` > `sepaDirectDebit`. The shopper may have more than one saved bank accounts with the SEPA Direct Debit payment method. \n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##API Explorer\nTo test out a call, enter the request content below and then click **Try it!**\n\n**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.*\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"paymentSources\\\": {\\\"creditCardInfo\\\": [{\\\"creditCard\\\": {\\n        \\\"expirationYear\\\": 2018,\\n        \\\"securityCode\\\": 837,\\n        \\\"expirationMonth\\\": \\\"02\\\",\\n        \\\"cardNumber\\\": 4263982640269299\\n    }}]},\\n    \\\"firstName\\\": \\\"FirstName\\\",\\n    \\\"lastName\\\": \\\"LastName\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"create-vaulted-shopper","type":"post","title":"Create Vaulted Shopper"}

postCreate Vaulted Shopper


Definition

{{ api_url }}{{ page_api_url }}

Documentation

The Create Vaulted Shopper request enables you to store a shopper's details (including payment info) securely in BlueSnap. BlueSnap will provide a token (vaultedShopperId) for that saved shopper.

You can then use the vaultedShopperId in order to complete payment transactions, improve the checkout experience for a returning shopper, and update the shopper's payment details. For an example of using the vaultedShopperId for a returning shopper, see Returning shopper tutorial.

  • Each vaulted shopper can have multiple credit cards.
  • If you add a credit card to a vaulted shopper, BlueSnap will validate the card before adding it to the shopper.
  • To create a shopper with wallet details for MasterPass or Visa Checkout, including the payment info and billing and shipping info, you will simply include the walletId in the request. For details, see:

Try it in the API Explorer

Request Content

Send a vaultedShopper object, with the following:

      paymentSources     object    optional (see paymentSources)

      firstName     string    required if walletId is not sent

      lastName     string    required if walletId is not sent

      softDescriptor     string    optional

      descriptorPhoneNumber string    optional

      merchantShopperId     string    optional

      country     string    optional

      state     string    optional

      city     string    optional

      address     string    optional

      address2     string    optional

      email     string    optional

      zip     string    optional

      phone     string    optional

      companyName     string     required for Corporate ECP accounts

      shopperCurrency     string    optional

      shippingContactInfo     object    optional (see shippingContactInfo)

      walletId     long    optional   Include if adding details for MasterPass or Visa Checkout

      transactionFraudInfo     object    optional (see transactionFraudInfo)

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.
The vaultedShopperId appears in the response body, as well as in the URL in the location header. In the example below, the vaultedShopperId is 20848977.

API version 1.0
If successful, the response HTTP status code is 201 Created.
The vaultedShopperId appears in the URL in the location header. In the example below, the vaultedShopperId is 19549020.
There is no content in the response body.


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "firstName": "FirstName",
    "lastName": "LastName"
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "paymentSources": {"creditCardInfo": [{"creditCard": {
        "expirationYear": 2018,
        "securityCode": 837,
        "expirationMonth": "02",
        "cardNumber": 4263982640269299
    }}]},
    "firstName": "FirstName",
    "lastName": "LastName"
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "paymentSources": {"creditCardInfo": [{
        "billingContactInfo": {
            "zip": "01752",
            "country": "US",
            "firstName": "billingFirstName",
            "lastName": "billingLastName",
            "address2": "Apt 1",
            "address1": "10 Main St",
            "state": "MA",
            "email": "email@example.com"
        },
        "creditCard": {
            "expirationYear": 2018,
            "securityCode": 837,
            "expirationMonth": "02",
            "cardNumber": 4263982640269299
        }
    }]},
    "firstName": "FirstName",
    "lastName": "LastName"
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "paymentSources": {"creditCardInfo": [{
        "billingContactInfo": {
            "zip": "01752",
            "country": "US",
            "firstName": "billingFirstName",
            "lastName": "billingLastName",
            "address2": "Apt 1",
            "address1": "10 Main St",
            "state": "MA",
            "email": "email@example.com"
        },
        "creditCard": {
            "expirationYear": 2018,
            "securityCode": 837,
            "expirationMonth": "02",
            "cardNumber": 4263982640269299
        }
    }]},
    "firstName": "FirstName",
    "lastName": "LastName",
    "transactionFraudInfo": {
        "shopperIpAddress": "123.12.134.1",
        "fraudSessionId": 1234,
        "company": "company",
        "shippingContactInfo": {
            "zip": "shippingZip",
            "country": "US",
            "firstName": "shippingLastName",
            "lastName": "shippingFirstName",
            "city": "shippingCity",
            "address2": "shippingAddress2",
            "address1": "shippingAddress1",
            "state": "AL"
        }
    }
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "paymentSources": {"creditCardInfo": [{"creditCard": {
        "expirationYear": 2016,
        "encryptedCardNumber": "$bsjs_1_0_3$B23uuxq8drUwOYZm3wZi+Qm69V5GPEt8PEio+Edwcm8akczQSK7odgLQH/Au+VqOCsGspW1Q9mPyQIzGLSZLVToAQVfq5C1ld+2ogIIsDL32Hd6IojboLyVlYT1FvPQoDyz19K6N0CUHh5uk0kCLuHSUyjvoJH38ojHZifbJSm/7S5vAtiuC3BJt2z8k9nauQaAXkbyoAYwrS1yDpqOt2k2lGhKcmdQ4ImDR0RL8m8xig6sFrki9oqo3Mju/M5r7wXXVTf7TMtWiQbzdfREOxKUnviXJZpncdHqVjj5GvPYun2qgopKVKr8F5+yd19TVW2gvA1kXBkXonFL9159Gxg==$zckJgo2i8jXDiAHwVVHBKypXFnWqF2e+6luBkmtQQRKniDXyXaalRVKLtYscBaGd$W7Ojqk1Q2iOJVeGL39RAsZTtfup3f1deSzvxrvC9rXA=",
        "encryptedSecurityCode": "$bsjs_1_0_3$MB1nBpok/YkuWPG1/7e6dyFFhDPHB8p8E9Yo+0YHHV+xkHuzFKr02wAnE8PJ8QCzWH+2ctXy5FN6wLKjwFrfTOgy0BJ9k9+NDEe8mhsu66wMlyc3lnwrbvMRCWN1O+5gUNCFExj7B0mDtf4gtxecXs74KZ5l5dbpGWdKUk5i7OewWyTqsONbn9taLfVBOwuIOy2Jgi4fx+yB8Q05KdZeHSNSBJh8H/47AUNAn5dM+d9iO6yGQB3obzEzzR3UtHlkGR52ZsgbbFh0JMm9lBM2ClgYM8jvmQjS9HX2ojt1fkbhuPEb1IY/M498a+1wDPpI4aMfDxO1lSpJneRSpY5k4g==$XaKq1NbPcS0iHy9N9jHekEIByHYS4G3wJXlC9EQjAGM=$BJn6X6mBYGUo8Eoq4RQz69gsi4Azl8jT973mNpG9Yuo=",
        "cardType": "VISA",
        "expirationMonth": "07"
    }}]},
    "firstName": "FirstName",
    "lastName": "LastName"
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{"walletId": 21}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-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 POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "zip": 12345,
    "country": "us",
    "paymentSources": {"ecpInfo": {"ecp": {
        "routingNumber": "011075150",
        "accountType": "CONSUMER_CHECKING",
        "accountNumber": 4099999992
    }}},
    "firstName": "FirstName",
    "lastName": "LastName",
    "phone": 1234567890
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "paymentSources": {"creditCardInfo": [{"creditCard": {
        "expirationYear": 2018,
        "securityCode": 837,
        "expirationMonth": "02",
        "cardNumber": 4263982640269299
    }}]},
    "firstName": "FirstName",
    "lastName": "LastName",
    "softDescriptor": "MYCOMPANY"
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/vaulted-shoppers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "firstName": "Jane", 
  "lastName": "Shopper", 
  "zip": "12345", 
  "country": "fr",
  "phone": "1234567890", 
  "paymentSources": {
    "sepaDirectDebitInfo": [{ "sepaDirectDebit": {
          "iban": "DE09100100101234567893"
    }}]}
}'

Response Examples

{
    "paymentSources": {"creditCardInfo": [{
        "billingContactInfo": {
            "firstName": "FirstName",
            "lastName": "LastName",
            "city": ""
        },
        "processingInfo": {
            "avsResponseCodeAddress": "U",
            "cvvResponseCode": "MA",
            "avsResponseCodeName": "U",
            "avsResponseCodeZip": "U"
        },
        "fraudResultInfo": {"deviceDataCollector": "N"},
        "creditCard": {
            "expirationYear": 2018,
            "cardLastFourDigits": 9299,
            "cardSubType": "CREDIT",
            "cardType": "VISA",
          	"cardCategory": "CLASSIC",
            "expirationMonth": "02"
        }
    }]},
    "firstName": "FirstName",
    "lastName": "LastName",
    "vaultedShopperId": 20848977,
    "shopperCurrency": "USD"
}
HTTP/ 1.1 201 Created
Location: https://sandbox.bluesnap.com/services/2/vaulted-shoppers/19549020

Back to Top


Example Descriptions

For details about the above examples, see:

Basic Create Vaulted Shopper

This example shows a basic Create Vaulted Shopper request that saves the shopper in BlueSnap without any information about the shopper's payment methods.

Create Vaulted Shopper with credit card

To save credit card information for the shopper, you'll need to include the creditCardInfo property within the paymentSources object in your request. See creditCardInfo. Note that you must meet specific PCI compliance requirements in order to send unencrypted card details.

Above is an example of a request with an unencrypted credit card number.

Create Vaulted Shopper with credit card and billing info

Optionally, you can include the shopper's billing info in the creditCardInfo property within the paymentSources object in your request. See creditCardInfo. This can help improve the experience for returning shoppers, because you can save time by pre-populating the checkout form with their billing details.

Above is an example of a request with credit card details along with billing info.

Create Vaulted Shopper with credit card, billing info and fraud info

Optionally, you can include fraud info in the request, so that your fraud checks can run and verify that you are not saving a shopper with payment info that is suspected to be fraudulent.

Above is an example of a request with that includes fraud info such as the shopper's IP address and shipping address.

Create Vaulted Shopper with encrypted credit card

Your PCI compliance requirements and API permission level may require that you send credit card data in encrypted format only. To do this, you'll need to include theencryptedCardNumber and encryptedSecurityCode properties within the creditCardInfo object in your request.

Above is an example of a request with an encrypted credit card number.

Create Vaulted Shopper with wallet

To create a shopper with wallet details, including the payment info and billing and shipping info, you will simply include the walletId in the request. No other elements are required.

For details, see:

Above is an example of a request with a wallet ID.

Create Vaulted Shopper with Hosted Payment Fields token

If you are using BlueSnap's Hosted Payment Fields, you can save the shopper's payment information from the Hosted Payment Fields by including the token within the pfToken property in your request.

Above is an example of a request with the Hosted Payment Fields token.

Create Vaulted Shopper with ACH/ECP info

To save ACH/ECP account info for a shopper, include the ecpInfo element in your request. Only one ACH/ECP account can be saved per shopper.

Create Vaulted Shopper with credit card and soft descriptor

The above example shows how to create a shopper with a credit card and soft descriptor, which is the description that may appear on the shopper's bank statement when BlueSnap validates the card before adding it to the shopper.

Create Vaulted Shopper with SEPA Direct Debit

The above example shows a Create Vaulted Shopper request with bank account details for the SEPA Direct Debit payment method. Include the shopper's bank account details within paymentSources > sepaDirectDebitInfo > sepaDirectDebit. The shopper may have more than one saved bank accounts with the SEPA Direct Debit payment method.



Back to Top


API Explorer

To test out a call, enter the request content below 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": 2018,
        "securityCode": 837,
        "expirationMonth": "02",
        "cardNumber": 4263982640269299
    }}]},
    "firstName": "FirstName",
    "lastName": "LastName"
}

User Information

Try It Out


post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}