{"_id":"5c6c238ff7d548003953559e","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"5c6c238ff7d54800395355a0","project":"57336fd5a6a9c40e00e13a0b","__v":1,"forked_from":"5beb278ac442ab0213f009cf","createdAt":"2018-04-23T14:36:48.535Z","releaseDate":"2018-04-23T14:36:48.535Z","categories":["5c6c238ff7d548003953555d","5c6c238ff7d548003953555e","5c6c238ff7d548003953555f","5c6c238ff7d5480039535560","5c6c238ff7d5480039535561","5c6c238ff7d5480039535562","5beb278ac442ab0213f00990","5c6c238ff7d5480039535563","5c3f542c12c4ac004bc51718","5c928dba4aa821001ae4f050"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Main","version_clean":"8976.0.0-Basics","version":"8976-Basics"},"category":{"_id":"5c6c238ff7d5480039535563","version":"5c6c238ff7d54800395355a0","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-03T20:45:01.593Z","from_sync":false,"order":7,"slug":"topics","title":"Guides"},"user":"5beb1b96bc2003003ecd645e","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-02-14T21:32:13.720Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"This page describes the process of completing a transaction when using either the following integrations:\n* [iOS SDK](doc:ios-sdk) \n* [Android SDK](doc:android-sdk) \n* [Embedded Checkout](doc:embedded-checkout) \n* [Payment Request API (W3C)](doc:payment-request-api) \n\nTo make the payment, you need a valid token.  Refer to the information in the relevant integration guide above for details.\n\nThe token is used to submit the purchase details to BlueSnap servers in one of the flows above.  After that is done you make a server-to-server API call. \n* For one-time payments, use [Create Transactions API](#section-card-transactions-api) \n\n* For a subscriptions, use either of the following:\n     *  [Recurring Subscription API](#section-recurring-subscription-api)\n     *  [Merchant-Managed Subscription API](#section-merchant-managed-subscription-api)\n\nThe following describes how your API requests should look, regardless of the payment method and regardless of whether the shopper is new or returning.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note:\",\n  \"body\": \"All the user's details (including billing and shipping info and credit card details) and the fraud session ID are included in the token; therefore, you do not need to include this information in the request.\"\n}\n[/block]\n##Card Transactions API\n\nFor one-time payments, send an HTTP `POST` request to `/services/2/transactions` in the relevant BlueSnap environment. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n\\t\\\"cardTransactionType\\\": \\\"AUTH_CAPTURE\\\",\\n\\t\\\"amount\\\": 25.00, \\n\\t\\\"currency\\\": \\\"USD\\\", \\n\\t\\\"pfToken\\\": \\\"812f6ee706e463d3276e3abeb21fa94072e40695ed423ddac244409b3b652eff_\\\"\\n}'\",\n      \"language\": \"json\",\n      \"name\": \"Auth Capture example\"\n    }\n  ]\n}\n[/block]\nThe `cardTransactionType` may change if you want to split between an Auth and an Auth capture, refer to our  [Auth Capture](https://developers.bluesnap.com/v8976-JSON/docs/auth-capture) and [Auth Only](https://developers.bluesnap.com/v8976-JSON/docs/auth-only) documentation for more details.\n<br />\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n<hr />\n##Recurring Subscription API\n\nFor creating a regular subscription, send an HTTP `POST` request to `/services/2/recurring/subscriptions` in the relevant BlueSnap environment. \n\nThe following charges for the subscription are managed by BlueSnap, according to the subscription plan. For more information on how to create subscription plans, refer to our [Create Plan](https://developers.bluesnap.com/v8976-JSON/docs/create-plan) and [Create Subscription](https://developers.bluesnap.com/v8976-JSON/docs/create-subscription) documentation for more details.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n\\t\\\"planId\\\": 2283845, \\n\\t\\\"paymentSource\\\": {\\n\\t   \\\"pfToken\\\": \\\"07ca959efe86d79f70919edc6b057e18b886096e72cb0a7f50707ff6c2e4a739_\\\"\\n\\t}\\n}'\",\n      \"language\": \"json\",\n      \"name\": \"Create Subscription example\"\n    }\n  ]\n}\n[/block]\n<br />\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n<hr />\n\n##Merchant-Managed Subscription API\n\nUnlike the recurring subscription described above, this subscription type is not managed by BlueSnap; the following charges for the subscription are managed by the merchant.  For more information refer to our  [Merchant-Managed Subscription](https://developers.bluesnap.com/v8976-JSON/docs/subscription-management#section-merchant-managed-subscriptions) documentation.\n\nFor creating a merchant-managed subscription, send an HTTP `POST` request to `/services/2/recurring/ondemand` of the relevant BlueSnap environment. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/ondemand \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"amount\\\": 45, \\n  \\\"currency\\\": \\\"USD\\\",\\n  \\\"paymentSource\\\":{\\n      \\\"pfToken\\\": \\\"770993ac06710e3aa6705afe3e49c22904908e187520c37ccf8abb6d80cfb80b_\\\"\\n  }\\n}'\",\n      \"language\": \"json\",\n      \"name\": \"Create Merchant-Managed Subscription example\"\n    }\n  ]\n}\n[/block]\n<br />\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n<hr />\n\n\nFor more information about our Payment API, refer to our [Payment API](https://developers.bluesnap.com/v8976-JSON/docs/bluesnap-payment-api-json) reference documentation.","excerpt":"","slug":"completing-tokenized-payments","type":"basic","title":"Completing Tokenized Payments"}

Completing Tokenized Payments


This page describes the process of completing a transaction when using either the following integrations:

To make the payment, you need a valid token. Refer to the information in the relevant integration guide above for details.

The token is used to submit the purchase details to BlueSnap servers in one of the flows above. After that is done you make a server-to-server API call.

The following describes how your API requests should look, regardless of the payment method and regardless of whether the shopper is new or returning.

Note:

All the user's details (including billing and shipping info and credit card details) and the fraud session ID are included in the token; therefore, you do not need to include this information in the request.

Card Transactions API

For one-time payments, send an HTTP POST request to /services/2/transactions in the relevant BlueSnap environment.

curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
	"cardTransactionType": "AUTH_CAPTURE",
	"amount": 25.00, 
	"currency": "USD", 
	"pfToken": "812f6ee706e463d3276e3abeb21fa94072e40695ed423ddac244409b3b652eff_"
}'

The cardTransactionType may change if you want to split between an Auth and an Auth capture, refer to our Auth Capture and Auth Only documentation for more details.


Back to Top


Recurring Subscription API

For creating a regular subscription, send an HTTP POST request to /services/2/recurring/subscriptions in the relevant BlueSnap environment.

The following charges for the subscription are managed by BlueSnap, according to the subscription plan. For more information on how to create subscription plans, refer to our Create Plan and Create Subscription documentation for more details.

curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
	"planId": 2283845, 
	"paymentSource": {
	   "pfToken": "07ca959efe86d79f70919edc6b057e18b886096e72cb0a7f50707ff6c2e4a739_"
	}
}'



Back to Top


Merchant-Managed Subscription API

Unlike the recurring subscription described above, this subscription type is not managed by BlueSnap; the following charges for the subscription are managed by the merchant. For more information refer to our Merchant-Managed Subscription documentation.

For creating a merchant-managed subscription, send an HTTP POST request to /services/2/recurring/ondemand of the relevant BlueSnap environment.

curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/ondemand \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "amount": 45, 
  "currency": "USD",
  "paymentSource":{
      "pfToken": "770993ac06710e3aa6705afe3e49c22904908e187520c37ccf8abb6d80cfb80b_"
  }
}'



Back to Top


For more information about our Payment API, refer to our Payment API reference documentation.