{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"optional","results":{"codes":[{"code":"","language":"text"}]},"settings":"","examples":{"codes":[]},"method":"post","params":[]},"next":{"description":"","pages":[]},"title":"Create Wallet","type":"endpoint","slug":"create-wallet","excerpt":"","body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/wallets</span>\n\n<hr>\n\n##Documentation\nThe 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.\n[block:callout]\n{\n \"type\": \"success\",\n \"body\": \"This currently supports Apple Pay on the web, Masterpass, and Visa Checkout wallets. For detailed setup instructions, see:\\n * [Apple Pay in your website](/docs/apple-pay#section-implementing-apple-pay-in-your-website-or-ios-app)\\n * [Masterpass Guide](/docs/masterpass)\\n * [Visa Checkout Guide](/docs/visa-checkout)\"\n}\n[/block]\nFor information on Google Pay, refer to our [Google Pay™ Guide](https://support.bluesnap.com/docs/google-pay).\n[block:html]\n{\n \"html\": \"<ul class=\\\"nav nav-pills nav-justified\\\">\\n <li class=\\\"active\\\"><a data-toggle=\\\"pill\\\" href=\\\"#menujson\\\">JSON</a></li>\\n <li><a data-toggle=\\\"tab\\\" href=\\\"#menuxml\\\">XML</a></li>\\n</ul>\\n<div class=\\\"tab-content\\\">\\n <div id=\\\"menujson\\\" class=\\\"tab-pane fade in active\\\">\"\n}\n[/block]\n<br />\n[block:html]\n{\n \"html\": \"<ul class=\\\"nav nav-tabs\\\">\\n <li class=\\\"active\\\"><a data-toggle=\\\"tab\\\" href=\\\"#Apple-Pay\\\">Apple Pay</a></li>\\n <li><a data-toggle=\\\"tab\\\" href=\\\"#Masterpass\\\">Masterpass</a></li>\\n <li><a data-toggle=\\\"tab\\\" href=\\\"#Visa-Checkout\\\">Visa Checkout</a></li>\\n</ul>\\n<div class=\\\"tab-content\\\">\\n <div id=\\\"Apple-Pay\\\" class=\\\"tab-pane fade in active\\\">\"\n}\n[/block]\n##Apple Pay\n###JSON Request Content\nSend a **[wallet](doc:wallet-json)** object, with the following:\n\n `walletType` *string* <span style=\"color:#F37500\">**required**</span>\n\n `validationUrl` *string* <span style=\"color:#F37500\">**required**</span>\n\n `domainName` *string* <span style=\"color:#F37500\">**required**</span>\n\n `displayName` *string* optional\n\n###JSON Response Details \nIf successful, the response HTTP status code is 200 OK.\nThe response includes the [wallet](doc:wallet-json) object with the following:\n\n `walletType` *string*\n\n `walletToken` *string*\n\n<hr>\n\n##JSON Examples\n\n###Request Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n \\\"walletType\\\": \\\"APPLE_PAY\\\", \\n \\\"validationUrl\\\": \\\"https://apple-pay-gateway-cert.apple.com/paymentservices/startSession\\\", \\n \\\"domainName\\\": \\\"merchant.com\\\"\\n}'\",\n \"language\": \"curl\",\n \"name\": \"Apple Pay\"\n }\n ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"walletType\\\": \\\"APPLE_PAY\\\",\\n \\\"walletToken\\\":\\\"ImRhdGEiOiJuY1AvRitIUy8zeG5ISk1pSm9RbXhCMFd\\\"\\n}\",\n \"language\": \"json\",\n \"name\": \"200 OK - Apple Pay\"\n }\n ]\n}\n[/block]\n##Example Descriptions\n###Apple Pay Wallet\nFor Apple Pay, the request includes the `walletType`, `validationUrl`, and `domainName`. The response includes the `walletToken`. For more information, see [Apple Pay in your website](/docs/apple-pay#section-apple-pay-in-your-website). \n\n**Note**: Be sure that the `domainName` is the domain you registered during [domain verification](/docs/apple-pay#section-step-1-verify-your-domain).\n[block:html]\n{\n \"html\": \" </div>\\n <div id=\\\"Masterpass\\\" class=\\\"tab-pane fade\\\">\"\n}\n[/block]\n##Masterpass\n###JSON Request Content \nSend a **[wallet](doc:wallet-json)** object, with the following:\n\n `walletType` *string* <span style=\"color:#F37500\">**required**</span>\n\n `originUrl` *string* <span style=\"color:#F37500\">**required**</span>\n\n `returnUrl` *string* <span style=\"color:#F37500\">**required**</span>\n\n###JSON Response Details \nThe response includes the [wallet](doc:wallet-json) object with the following:\n\n `walletType` *string*\n\n `walletToken` *string*\n\n `merchantCheckoutId` *string*\n\n `allowedCardTypes` *string*\n\n<hr>\n\n##JSON Examples\n\n###Request Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n \\\"walletType\\\": \\\"MASTERPASS\\\",\\n \\\"originUrl\\\": \\\"http://www.originURL.com\\\",\\n \\\"returnUrl\\\": \\\"http://www.returnURL.com\\\"\\n}'\",\n \"language\": \"curl\",\n \"name\": \"Masterpass - Payment API\"\n }\n ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"allowedCardTypes\\\": \\\"master,amex,diners,discover,visa\\\",\\n \\\"walletType\\\": \\\"MASTERPASS\\\",\\n \\\"merchantCheckoutId\\\": \\\"a4a6w4vkqzjnzikhr6ihj1ikqnlqhu5ymb\\\",\\n \\\"walletToken\\\": \\\"f9babd23df00acc9b049ac4694d2344f8f73f4e8\\\"\\n}\",\n \"language\": \"json\",\n \"name\": \"200 OK - Masterpass \"\n }\n ]\n}\n[/block]\n##Example Descriptions\n###Masterpass Wallet\nFor Masterpass, the request includes the `originUrl` and the `returnUrl`. The response includes the token for the wallet, the merchant checkout ID for the session, and a list of the supported card types for the wallet.\nFor more information, see [Implementing Masterpass](/docs/masterpass#section-implementing-masterpass-via-the-api).\n[block:html]\n{\n \"html\": \" </div>\\n <div id=\\\"Visa-Checkout\\\" class=\\\"tab-pane fade\\\">\"\n}\n[/block]\n##Visa Checkout\n###JSON Request Content\nSend a **[wallet](doc:wallet-json)** object, with the following:\n\n `walletType` *string* <span style=\"color:#F37500\">**required**</span>\n\n `callId` *string* <span style=\"color:#F37500\">**required**</span>\n\n###JSON Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response includes the [wallet](doc:wallet-json) object with the following:\n\n `walletId` *long*\n\n `firstName` *string*\n\n `lastName` *string*\n\n `email` *string*\n\n `country` *string*\n\n `phone` *string*\n\n `creditCard` *object*\n\n `billingContactInfo` *object*\n\n `shippingContactInfo` *object*\n\n<hr>\n\n##JSON Examples\n\n###Request Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n \\\"callId\\\": 5549711876630985101,\\n \\\"walletType\\\": \\\"VISA_CHECKOUT\\\"\\n}'\",\n \"language\": \"curl\",\n \"name\": \"Visa Checkout - Payment API\"\n }\n ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"country\\\": \\\"us\\\",\\n \\\"walletId\\\": 2203,\\n \\\"firstName\\\": \\\"Ben\\\",\\n \\\"lastName\\\": \\\"Li\\\",\\n \\\"billingContactInfo\\\": {\\n \\\"zip\\\": 12324,\\n \\\"country\\\": \\\"us\\\",\\n \\\"firstName\\\": \\\"Ben\\\",\\n \\\"lastName\\\": \\\"Li\\\",\\n \\\"city\\\": \\\"Santa Barbara\\\",\\n \\\"address1\\\": \\\"BlueSnap Street\\\",\\n \\\"state\\\": \\\"CA\\\"\\n },\\n \\\"phone\\\": 5032541004,\\n \\\"shippingContactInfo\\\": {\\n \\\"zip\\\": 12324,\\n \\\"country\\\": \\\"us\\\",\\n \\\"firstName\\\": \\\"Ben\\\",\\n \\\"lastName\\\": \\\"Li\\\",\\n \\\"city\\\": \\\"Santa Barbara\\\",\\n \\\"phone\\\": 5032541004,\\n \\\"address1\\\": \\\"BlueSnap Street\\\",\\n \\\"state\\\": \\\"CA\\\"\\n },\\n \\\"creditCard\\\": {\\n \\\"expirationYear\\\": 2020,\\n \\\"cardLastFourDigits\\\": 4821,\\n \\\"cardType\\\": \\\"VISA\\\",\\n \\t\\\"cardSubType\\\": \\\"CREDIT\\\", \\n \\t\\\"cardCategory\\\": \\\"CLASSIC\\\",\\n \\\"expirationMonth\\\": 8\\n },\\n \\\"email\\\": \\\"ben.li@bluesnap.com\\\"\\n}\",\n \"language\": \"json\",\n \"name\": \"200 OK - Visa Checkout\"\n }\n ]\n}\n[/block]\n##Example Descriptions\n###Visa Checkout Wallet\nFor Visa Checkout, the request includes the `callId`. The response content includes the wallet ID and the checkout details.\nFor more information, see [Implementing Visa Checkout](/docs/visa-checkout#section-implementing-visa-checkout).\n[block:html]\n{\n \"html\": \"</div>\\n</div>\"\n}\n[/block]\n\n[block:html]\n{\n \"html\": \" </div>\\n <div id=\\\"menuxml\\\" class=\\\"tab-pane fade\\\">\"\n}\n[/block]\n<br />\n[block:html]\n{\n \"html\": \"<ul class=\\\"nav nav-tabs\\\">\\n <li class=\\\"active\\\"><a data-toggle=\\\"tab\\\" href=\\\"#Apple-Pay-XML\\\">Apple Pay</a></li>\\n <li><a data-toggle=\\\"tab\\\" href=\\\"#Masterpass-XML\\\">Masterpass</a></li>\\n <li><a data-toggle=\\\"tab\\\" href=\\\"#Visa-Checkout-XML\\\">Visa Checkout</a></li>\\n</ul>\\n<div class=\\\"tab-content\\\">\\n <div id=\\\"Apple-Pay-XML\\\" class=\\\"tab-pane fade in active\\\">\"\n}\n[/block]\n##Apple Pay\n###XML Request Content\nSend a **[wallet](doc:wallet)** object, with the following:\n\n `wallet-type` *string* <span style=\"color:#F37500\">**required**</span>\n\n `validation-url` *string* <span style=\"color:#F37500\">**required**</span>\n\n `domain-name` *string* <span style=\"color:#F37500\">**required**</span>\n\n `display-name` *string* optional\n\n###XML Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response includes the [wallet](doc:wallet) object with the following:\n\n `wallet-type` *string*\n\n `wallet-token` *string*\n\n<hr>\n\n##XML Examples\n\n###Request Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<wallet xmlns=\\\"http://ws.plimus.com\\\">\\n <wallet-type>APPLE_PAY</wallet-type>\\n <validation-url>https://apple-pay-gateway-cert.apple.com/paymentservices/startSession</validation-url>\\n <display-name>My store</display-name>\\n</wallet>'\",\n \"language\": \"curl\",\n \"name\": \"Apple Pay\"\n }\n ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<wallet xmlns=\\\"http://ws.plimus.com\\\">\\n <wallet-type>APPLE_PAY</wallet-type>\\n <wallet-token>ImRhdGEiOiJuY1AvRitIUy8zeG5ISk1pSm9RbXhCMFd</wallet-token>\\n</wallet>\",\n \"language\": \"xml\",\n \"name\": \"200 OK - Apple Pay\"\n }\n ]\n}\n[/block]\n##Example Descriptions\n###Apple Pay Wallet\nFor Apple Pay, the request includes the `wallet-type`, `validation-url`, and `domain-name`. The response includes the `wallet-token`. For more information, see [Apple Pay in your website](/docs/apple-pay#section-apple-pay-in-your-website). \n\n**Note**: Be sure that the `domain-name` is the domain you registered during [domain verification](/docs/apple-pay#section-step-1-verify-your-domain).\n[block:html]\n{\n \"html\": \" </div>\\n <div id=\\\"Masterpass-XML\\\" class=\\\"tab-pane fade\\\">\"\n}\n[/block]\n##Masterpass\n###XML Request Content\nSend a **[wallet](doc:wallet)** resource, with the following:\n\n `wallet-type` *string* <span style=\"color:#F37500\">**required**</span>\n\n `store-id` *string* <span style=\"color:#F37500\">**required** - Extended Payment API only</span>\n\n `origin-url` *string* <span style=\"color:#F37500\">**required**</span>\n\n `return-url` *string* <span style=\"color:#F37500\">**required**</span>\n\n###XML Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response includes the [wallet](doc:wallet) resource with the following:\n\n `wallet-type` *string*\n\n `wallet-token` *string*\n\n `merchant-checkout-id` *string*\n\n `allowed-card-types` *string*\n\n<hr>\n\n##XML Examples\n\n###Request Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<wallet xmlns=\\\"http://ws.plimus.com\\\">\\n <wallet-type>MASTERPASS</wallet-type>\\n <origin-url>http://www.originURL.com</origin-url>\\n <return-url>http://www.returnURL.com</return-url>\\n</wallet>'\",\n \"language\": \"curl\",\n \"name\": \"Masterpass - Payment API\"\n },\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<wallet xmlns=\\\"http://ws.plimus.com\\\">\\n <wallet-type>MASTERPASS</wallet-type>\\n <store-id>11580</store-id>\\n <origin-url>http://www.originURL.com</origin-url>\\n <return-url>http://www.returnURL.com</return-url>\\n</wallet>\",\n \"language\": \"xml\",\n \"name\": \"Masterpass with store-id - Extended Payment API\"\n }\n ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<?xml version=”1.0” encoding=”UTF-8” standalone=”yes”?>\\n<wallet xmlns=\\\"http://ws.plimus.com\\\">\\n <wallet-type>MASTERPASS</wallet-type>\\n <wallet-token>f9babd23df00acc9b049ac4694d2344f8f73f4e8</wallet-token>\\n <merchant-checkout-id>a4a6w4vkqzjnzikhr6ihj1ikqnlqhu5ymb</merchant-checkout-id>\\n <allowed-card-types>master,amex,diners,discover,visa</allowed-card-types>\\n</wallet>\",\n \"language\": \"xml\",\n \"name\": \"200 OK - Masterpass \"\n }\n ]\n}\n[/block]\n##Example Descriptions\n###Masterpass Wallet\nFor Masterpass, the request includes the `origin-url` and the `return-url`. The response includes the token for the wallet, the merchant checkout ID for the session, and a list of the supported card types for the wallet.\nFor more information, see [Implementing Masterpass](/docs/masterpass#section-implementing-masterpass-via-the-api).\n[block:html]\n{\n \"html\": \" </div>\\n <div id=\\\"Visa-Checkout-XML\\\" class=\\\"tab-pane fade\\\">\"\n}\n[/block]\n##Visa Checkout\n###XML Request Content\n`wallet` *container* <span style=\"color:#F37500\">**required**</span>, contains the following properties (see [wallet](doc:wallet)):\n\n `wallet-type` *string* <span style=\"color:#F37500\">**required**</span>\n\n `store-id` *string* <span style=\"color:#F37500\">**required** - Extended Payment API only</span>\n\n `call-id` *string* <span style=\"color:#F37500\">**required**</span>\n\n###XML Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response includes the [wallet](doc:wallet) resource with the following:\n\n `wallet-id` *long*\n\n `first-name` *string*\n\n `last-name` *string*\n\n `email` *string*\n\n `country` *string*\n\n `phone` *string*\n\n `credit-card` *container*\n\n `billing-contact-info` *container*\n\n `shipping-contact-info` *container*\n\n<hr>\n\n##XML Examples\n\n###Request Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<wallet xmlns=\\\"http://ws.plimus.com\\\">\\n <wallet-type>VISA_CHECKOUT</wallet-type>\\n <call-id>5549711876630985101</call-id>\\n</wallet>'\",\n \"language\": \"curl\",\n \"name\": \"Visa Checkout - Payment API\"\n },\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/wallets \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<wallet xmlns=\\\"http://ws.plimus.com\\\">\\n <wallet-type>VISA_CHECKOUT</wallet-type>\\n <store-id>16500</store-id>\\n <call-id>5549711876630985101</call-id>\\n</wallet>'\",\n \"language\": \"curl\",\n \"name\": \"Visa Checkout with store-id - Extended Payment API\"\n }\n ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<wallet xmlns=\\\"http://ws.plimus.com\\\">\\n <wallet-id>2203</wallet-id>\\n <first-name>Ben</first-name>\\n <last-name>Li</last-name>\\n <email>ben.li@bluesnap.com</email>\\n <country>us</country>\\n <phone>5032541004</phone>\\n <credit-card>\\n <card-last-four-digits>4821</card-last-four-digits>\\n <card-type>VISA</card-type>\\n <card-sub-type>CREDIT</card-sub-type>\\n \\t<card-category>CLASSIC</card-category>\\n <expiration-month>8</expiration-month>\\n <expiration-year>2020</expiration-year>\\n </credit-card>\\n <billing-contact-info>\\n <first-name>Ben</first-name>\\n <last-name>Li</last-name>\\n <address1>BlueSnap Street</address1>\\n <city>Santa Barbara</city>\\n <state>CA</state>\\n <zip>12324</zip>\\n <country>us</country>\\n </billing-contact-info>\\n <shipping-contact-info>\\n <first-name>Ben</first-name>\\n <last-name>Li</last-name>\\n <address1>BlueSnap Street</address1>\\n <city> Santa Barbara </city>\\n <state>CA</state>\\n <zip>12324</zip>\\n <country>us</country>\\n <phone>5032541004</phone>\\n </shipping-contact-info>\\n</wallet>\",\n \"language\": \"xml\",\n \"name\": \"200 OK - Visa Checkout\"\n }\n ]\n}\n[/block]\n##Example Descriptions\n###Visa Checkout Wallet\nFor Visa Checkout, the request includes the `call-id`. The response content includes the wallet ID and the checkout details.\nFor more information, see [Implementing Visa Checkout](/docs/visa-checkout#section-implementing-visa-checkout).\n[block:html]\n{\n \"html\": \"</div>\\n</div>\"\n}\n[/block]\n\n[block:html]\n{\n \"html\": \" </div>\\n</div>\"\n}\n[/block]\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","updates":[],"order":0,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"6019bc72944282005e966f8b","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Wallets","slug":"wallets","order":18,"from_sync":false,"reference":true,"_id":"6019bc72944282005e966f67","version":"6019bc72944282005e966fd4","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2016-05-17T12:18:27.941Z","__v":0},"parentDoc":null,"project":"57336fd5a6a9c40e00e13a0b","user":"560d5913af97231900938124","version":{"version":"8976-Tools","version_clean":"8976.0.0-Tools","codename":"Test release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["6019bc72944282005e966f62","6019bc72944282005e966f63","6019bc72944282005e966f64","6019bc72944282005e966f65","6019bc72944282005e966f66","6019bc72944282005e966f67","6019bc72944282005e966f68","6019bc72944282005e966f69","6019bc72944282005e966f6a","6019bc72944282005e966f6b","6019bc72944282005e966f6c","6019bc72944282005e966f6d","5b34c737e0dca2000311de6a","6019bc72944282005e966f6e","6019bc72944282005e966f6f","6019bc72944282005e966f70","6019bc72944282005e966f71","6019bc72944282005e966f72","6019bc72944282005e966f73","6019bc72944282005e966f74"],"_id":"6019bc72944282005e966fd4","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5fa1893ed2a2370028d24282","createdAt":"2018-04-23T15:17:35.680Z","releaseDate":"2018-04-23T15:17:35.680Z"},"createdAt":"2016-05-17T13:12:32.559Z","githubsync":"","__v":0}
postCreate Wallet
This currently supports Apple Pay on the web, Masterpass, and Visa Checkout wallets. For detailed setup instructions, see:
For information on Google Pay, refer to our Google Pay™ Guide.