{"_id":"59dfa5868b51880010b74af6","category":{"_id":"59dfa5828b51880010b74ab8","version":"59dfa5828b51880010b74ab6","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-10-15T15:28:41.796Z","from_sync":false,"order":1,"slug":"payment-transaction-service","title":"Card Transactions"},"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"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":"2015-10-21T17:17:37.750Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"put","results":{"codes":[{"code":"","language":"text"}]},"settings":"57ee593a21ceb20e0061959e","auth":"optional","params":[],"url":"/transactions"},"isReference":true,"order":2,"body":"Capture is a request that submits a previously authorized transaction for settlement (i.e. payment by the shopper).\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Auth Only required before Capture\",\n  \"body\": \"Before you can send a transaction for capture, you must send it for authorization using the [Auth Only](doc:auth-only) request.\\n\\nThe capture will be performed based on the details that were in the Auth Only request (amount, currency, credit card, etc.).\"\n}\n[/block]\n<a class=\"btn btn-success\" href=\"#section-api-explorer\" role=\"button\">Try it in the API Explorer</a>\n\n###Request Content\n\nSend a **[cardTransaction](doc:card-transaction)** object, with the following:\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cardTransactionType` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>, value must be **CAPTURE**\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`transactionId` &nbsp;&nbsp;&nbsp; *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>, value must be the transaction ID from the [Auth Only](doc:auth-only) response\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`vendorInfo` *container* &nbsp;&nbsp;&nbsp;optional &nbsp;&nbsp;&nbsp; applicable if using marketplace vendor (see [vendorInfo](doc:vendorinfo-1))\n\n###Response Details\n\nIf successful, the response HTTP status code is 200 OK and contains the [**cardTransaction**](doc:card-transaction) object. The `transactionId` in the response will match the `transactionId` for the initial [Auth Only](doc:auth-only).\n\n<hr>\n\n##Example\n\n###Request Example\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    \\\"cardTransactionType\\\": \\\"CAPTURE\\\",\\n    \\\"transactionId\\\": 1011671985\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Capture: Basic\"\n    },\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  \\\"cardTransactionType\\\": \\\"CAPTURE\\\",\\n  \\\"transactionId\\\": 1014627701,\\n  \\\"vendorInfo\\\": {\\n      \\\"vendorId\\\": 10398032\\n    }\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"with vendor info\"\n    }\n  ]\n}\n[/block]\n###Response Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"amount\\\": 11,\\n    \\\"vaultedShopperId\\\": 1234,\\n    \\\"recurringTransaction\\\": \\\"ECOMMERCE\\\",\\n    \\\"processingInfo\\\": {\\\"processingStatus\\\": \\\"SUCCESS\\\"},\\n    \\\"softDescriptor\\\": \\\"BLS*DescTest\\\",\\n    \\\"cardHolderInfo\\\": {\\n        \\\"firstName\\\": \\\"test first name\\\",\\n        \\\"lastName\\\": \\\"test last name\\\",\\n      \\t\\\"zip\\\": \\\"123456\\\"\\n    },\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"creditCard\\\": {\\n        \\\"cardLastFourDigits\\\": \\\"0026\\\",\\n        \\\"cardSubType\\\": \\\"CREDIT\\\",\\n        \\\"cardType\\\": \\\"VISA\\\",\\n      \\t\\\"cardCategory\\\": \\\"CLASSIC\\\"\\n    },\\n    \\\"cardTransactionType\\\": \\\"CAPTURE\\\",\\n    \\\"transactionId\\\": 1011671985\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - Basic\"\n    },\n    {\n      \"code\": \"{\\n    \\\"cardTransactionType\\\": \\\"CAPTURE\\\",\\n    \\\"vendorInfo\\\": {\\n        \\\"vendorId\\\": 10398032,\\n        \\\"commissionPercent\\\": 20\\n    },\\n    \\\"transactionId\\\": \\\"1014627755\\\",\\n    \\\"recurringTransaction\\\": \\\"ECOMMERCE\\\",\\n    \\\"softDescriptor\\\": \\\"BLS&#x2a;DescTest\\\",\\n    \\\"amount\\\": 11,\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"cardHolderInfo\\\": {\\n        \\\"firstName\\\": \\\"test first name\\\",\\n        \\\"lastName\\\": \\\"test last name\\\",\\n        \\\"zip\\\": \\\"123456\\\"\\n    },\\n    \\\"vaultedShopperId\\\": 22028689,\\n    \\\"creditCard\\\": {\\n        \\\"cardLastFourDigits\\\": \\\"9299\\\",\\n        \\\"cardType\\\": \\\"VISA\\\",\\n        \\\"cardSubType\\\": \\\"CREDIT\\\",\\n        \\\"cardCategory\\\": \\\"GOLD\\\"\\n    },\\n    \\\"processingInfo\\\": {\\n        \\\"processingStatus\\\": \\\"SUCCESS\\\",\\n        \\\"cvvResponseCode\\\": \\\"MA\\\",\\n        \\\"avsResponseCodeZip\\\": \\\"U\\\",\\n        \\\"avsResponseCodeAddress\\\": \\\"U\\\",\\n        \\\"avsResponseCodeName\\\": \\\"U\\\"\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"with vendor info\"\n    }\n  ]\n}\n[/block]\n<hr>\n  \n##Example Descriptions\n\n###Capture: Basic\nThe example above shows a Capture request, where the transaction ID received for the initial [Auth Only](doc:auth-only) for this transaction was **1011671985**.\n\n###Capture: with vendor info\nThis example shows a Capture request with a marketplace vendor. By including `vendorId` inside `vendorInfo` in the request, the vendor will be linked to the transaction at the capture step. For more information, visit the [Marketplace Guide](/v1.0/docs/processing-transactions). \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 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    \\\"cardTransactionType\\\": \\\"CAPTURE\\\",\\n    \\\"transactionId\\\": 1011671985\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"capture","type":"put","title":"Capture"}

Definition

{{ api_url }}{{ page_api_url }}

Documentation

Capture is a request that submits a previously authorized transaction for settlement (i.e. payment by the shopper).

Auth Only required before Capture

Before you can send a transaction for capture, you must send it for authorization using the Auth Only request.

The capture will be performed based on the details that were in the Auth Only request (amount, currency, credit card, etc.).

Try it in the API Explorer

Request Content

Send a cardTransaction object, with the following:

      cardTransactionType     string    required, value must be CAPTURE

      transactionId     string    required, value must be the transaction ID from the Auth Only response

      vendorInfo container    optional     applicable if using marketplace vendor (see vendorInfo)

Response Details

If successful, the response HTTP status code is 200 OK and contains the cardTransaction object. The transactionId in the response will match the transactionId for the initial Auth Only.


Example

Request Example

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": "CAPTURE",
    "transactionId": 1011671985
}'
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": "CAPTURE",
  "transactionId": 1014627701,
  "vendorInfo": {
      "vendorId": 10398032
    }
}'

Response Example

{
    "amount": 11,
    "vaultedShopperId": 1234,
    "recurringTransaction": "ECOMMERCE",
    "processingInfo": {"processingStatus": "SUCCESS"},
    "softDescriptor": "BLS*DescTest",
    "cardHolderInfo": {
        "firstName": "test first name",
        "lastName": "test last name",
      	"zip": "123456"
    },
    "currency": "USD",
    "creditCard": {
        "cardLastFourDigits": "0026",
        "cardSubType": "CREDIT",
        "cardType": "VISA",
      	"cardCategory": "CLASSIC"
    },
    "cardTransactionType": "CAPTURE",
    "transactionId": 1011671985
}
{
    "cardTransactionType": "CAPTURE",
    "vendorInfo": {
        "vendorId": 10398032,
        "commissionPercent": 20
    },
    "transactionId": "1014627755",
    "recurringTransaction": "ECOMMERCE",
    "softDescriptor": "BLS&#x2a;DescTest",
    "amount": 11,
    "currency": "USD",
    "cardHolderInfo": {
        "firstName": "test first name",
        "lastName": "test last name",
        "zip": "123456"
    },
    "vaultedShopperId": 22028689,
    "creditCard": {
        "cardLastFourDigits": "9299",
        "cardType": "VISA",
        "cardSubType": "CREDIT",
        "cardCategory": "GOLD"
    },
    "processingInfo": {
        "processingStatus": "SUCCESS",
        "cvvResponseCode": "MA",
        "avsResponseCodeZip": "U",
        "avsResponseCodeAddress": "U",
        "avsResponseCodeName": "U"
    }
}


Example Descriptions

Capture: Basic

The example above shows a Capture request, where the transaction ID received for the initial Auth Only for this transaction was 1011671985.

Capture: with vendor info

This example shows a Capture request with a marketplace vendor. By including vendorId inside vendorInfo in the request, the vendor will be linked to the transaction at the capture step. For more information, visit the Marketplace Guide.



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 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.

{
    "cardTransactionType": "CAPTURE",
    "transactionId": 1011671985
}

User Information

Try It Out


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