{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/transactions/approval","auth":"optional","settings":"57ee593a21ceb20e0061959e","results":{"codes":[{"code":"","language":"text"}]},"method":"put","examples":{"codes":[]},"params":[{"name":"transactionid","type":"string","default":"","desc":"either `transactionid` or `merchanttransactionid` <b>is required</b> <br />ID of the transaction to be approved/declined","required":false,"in":"query","ref":"","_id":"57b6ec9e49a12a0e007b469d"},{"name":"merchanttransactionid","type":"string","default":"","desc":"either `transactionid` or `merchanttransactionid` <b>is required</b> <br />merchant's transaction ID number for the transaction to be approved/declined","required":false,"in":"query","ref":"","_id":"5e5d566681704f00186f00c4"},{"name":"approvetransaction","type":"boolean","default":"true","desc":"Set to `true` to approve the transaction or to `false` to decline the transaction. Default value is `true`.","required":false,"in":"query","ref":"","_id":"5ed51e1bd6b31c07c13ff5e2"}]},"next":{"description":"","pages":[]},"title":"Merchant Approve Transaction","type":"endpoint","slug":"merchant-approval","excerpt":"","body":"[block:html]\n{\n  \"html\": \"<script>\\n  // hide body textbox of API Explorer\\n $(document).ready(function() {\\n  $(\\\"textarea[placeholder='Body Content']\\\").hide();  \\n }); \\n</script> \"\n}\n[/block]\nThe Merchant Approve Transaction request lets you approve or decline transactions with invoice status of PENDING_MERCHANT_REVIEW.\n\n<a class=\"btn btn-success\" href=\"#section-api-explorer\" role=\"button\">Try it in the API Explorer</a>\n\n###Request Content\nThe request must include either the `transactionid` or `merchanttransactionid`.  \n\nFor example: \n\n>`services/2/transactions/approval?transactionid=38612140&approvetransaction=true`\n\nOR\n\n>`services/2/transactions/approval?merchanttransactionid=MyUniqueMTI&approvetransaction=true`\n\n**Note:** If `approvetransaction` is not included, `true` is assumed.\n\n###Response Details\nIf successful, the response HTTP status code is 204.\nThe response will be in `MerchantApprovalResource` and contain the following parameters. \n\n**Possible Responses**\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Case\",\n    \"h-1\": \"Examples\",\n    \"h-2\": \"with merchantTransactionId\",\n    \"0-0\": \"**Approve**\",\n    \"1-0\": \"* Auth Only (with amount > 0)\",\n    \"1-1\": \"with `transactionId`\\n```json\\n{\\n  \\\"transactionId\\\": \\\"38611602\\\",\\n  \\\"transactionStatus\\\": \\\"Waiting\\\"\\n}\\n```\\n\\nwith `merchantTransactionId`\\n```json\\n{\\n  \\\"transactionId\\\": \\\"38611602\\\",\\n  \\\"transactionStatus\\\": \\\"Waiting\\\",\\n  \\\"merchantTransactionId\\\": \\\"merchantTransactionId122222\\\"\\n}\\n```\",\n    \"1-2\": \"\",\n    \"2-0\": \"* Auth Only (with amount = 0)\\n* Auth Capture \\n* Create PayPal Transaction \\n* Create Local Bank Transfer Transaction\",\n    \"2-1\": \"with `transactionId`\\n```json\\n{\\n  \\\"transactionId\\\": \\\"38611602\\\",\\n  \\\"transactionStatus\\\": \\\"Approved\\\"\\n}\\n```\\n\\nwith `merchantTransactionId`\\n```json\\n{\\n  \\\"transactionId\\\": \\\"38611602\\\",\\n  \\\"transactionStatus\\\": \\\"Approved\\\",\\n  \\\"merchantTransactionId\\\": \\\"merchantTransactionId122222\\\"\\n}\\n```\",\n    \"2-2\": \"\",\n    \"3-0\": \"* Create Subscription \\n* Create Merchant-Managed Subscription\",\n    \"3-1\": \"with `transactionId` \\n```json\\n{\\n  \\\"subscriptionId\\\": 39606170,\\n  \\\"transactionId\\\": \\\"38611602\\\",\\n  \\\"transactionStatus\\\": \\\"Approved\\\"\\n}\\n```\\n\\nwith `merchantTransactionId`\\n```json\\n{\\n  \\\"subscriptionId\\\": 39606170,\\n  \\\"transactionId\\\": \\\"38611602\\\",\\n  \\\"transactionStatus\\\": \\\"Approved\\\",\\n  \\\"merchantTransactionId\\\": \\\"merchantTransactionId122222\\\"\\n}\\n```\",\n    \"3-2\": \"\",\n    \"4-0\": \"**Decline**\",\n    \"5-0\": \"* Create Local Bank Transfer Transaction\",\n    \"5-1\": \"with `transactionId`\\n```json\\n{\\n  \\\"transactionId\\\": \\\"38523084\\\",\\n  \\\"transactionStatus\\\": \\\"Short OrderContext Declined By Vendor &#x28;Refund Needed&#x29;\\\"\\n}\\n```\\n\\nwith `merchantTransactionId`\\n```json\\n{\\n  \\\"transactionId\\\": \\\"38523084\\\",\\n  \\\"transactionStatus\\\": \\\"Short OrderContext Declined By Vendor &#x28;Refund Needed&#x29;\\\",\\n  \\\"merchantTransactionId\\\": \\\"merchantTransactionId122222\\\"\\n}\\n```\",\n    \"5-2\": \"\",\n    \"6-0\": \"* all others\",\n    \"6-1\": \"with `transactionId`\\n```json\\n{\\n  \\\"transactionId\\\": \\\"38611592\\\",\\n  \\\"transactionStatus\\\": \\\"Canceled\\\"\\n}\\n```\\n\\nwith `merchantTransactionId`\\n```json\\n{\\n  \\\"transactionId\\\": \\\"38611592\\\",\\n  \\\"transactionStatus\\\": \\\"Canceled\\\",\\n  \\\"merchantTransactionId\\\": \\\"merchantTransactionId122222\\\"\\n}\\n```\",\n    \"6-2\": \"\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]\n<hr>\n\n##Example\n\n###Request Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/transactions/approval?transactionid=38612140&approvetransaction=true \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n      \"language\": \"curl\",\n      \"name\": \"Request: Approve transaction\"\n    },\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/transactions/approval?transactionid=38612140&approvetransaction=false \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n      \"language\": \"curl\",\n      \"name\": \"Request: Decline transaction\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"transactionId\\\": \\\"38611602\\\",\\n\\t\\\"transactionStatus\\\": \\\"Approved\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response:  200 OK with Transaction ID\"\n    },\n    {\n      \"code\": \"{\\n\\t\\\"transactionId\\\": \\\"38611602\\\",\\n\\t\\\"transactionStatus\\\": \\\"Approved\\\",\\n\\t\\\"merchantTransactionId\\\": \\\"merchantTransactionId122222\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"with Merchant Transaction ID\"\n    }\n  ]\n}\n[/block]\n<hr>\n\n##API Explorer\nTo test a call, enter an existing transaction ID or merchant transaction ID. This automatically inserts the ID into the request URL.","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5f43d7db37d54d01d8ef086e","project":"57336fd5a6a9c40e00e13a0b","version":{"version":"8976-JSON","version_clean":"8976.0.0-JSON","codename":"3.35 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5f43d7db37d54d01d8ef07cb","5f43d7db37d54d01d8ef07cc","5f43d7db37d54d01d8ef07cd","5f43d7db37d54d01d8ef07ce","5f43d7db37d54d01d8ef07cf","5f43d7db37d54d01d8ef07d0","5f43d7db37d54d01d8ef07d1","5f43d7db37d54d01d8ef07d2","5f43d7db37d54d01d8ef07d3","5f43d7db37d54d01d8ef07d4","5f43d7db37d54d01d8ef07d5","5f43d7db37d54d01d8ef07d6","5f43d7db37d54d01d8ef07d7","5f43d7db37d54d01d8ef07d8","5f43d7db37d54d01d8ef07d9","5f43d7db37d54d01d8ef07da","5f43d7db37d54d01d8ef07db","5f45521ec5bfe9005a858533"],"_id":"5f43d7db37d54d01d8ef0876","project":"57336fd5a6a9c40e00e13a0b","__v":1,"forked_from":"5ed0377101fdb400214dedaa","createdAt":"2018-04-24T15:22:41.561Z","releaseDate":"2018-04-24T15:22:41.561Z"},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Fraud Review","slug":"fraud-review","order":10,"from_sync":false,"reference":false,"_id":"5f43d7db37d54d01d8ef07da","project":"57336fd5a6a9c40e00e13a0b","version":"5f43d7db37d54d01d8ef0876","createdAt":"2020-03-02T19:01:01.717Z","__v":0},"user":"5beb1b96bc2003003ecd645e","createdAt":"2020-03-02T18:04:23.387Z","__v":83,"parentDoc":null}

putMerchant Approve Transaction


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

transactionid:
string
either `transactionid` or `merchanttransactionid` <b>is required</b> <br />ID of the transaction to be approved/declined
merchanttransactionid:
string
either `transactionid` or `merchanttransactionid` <b>is required</b> <br />merchant's transaction ID number for the transaction to be approved/declined
approvetransaction:
booleantrue
Set to `true` to approve the transaction or to `false` to decline the transaction. Default value is `true`.

Documentation

The Merchant Approve Transaction request lets you approve or decline transactions with invoice status of PENDING_MERCHANT_REVIEW.

Try it in the API Explorer

Request Content

The request must include either the transactionid or merchanttransactionid.

For example:

services/2/transactions/approval?transactionid=38612140&approvetransaction=true

OR

services/2/transactions/approval?merchanttransactionid=MyUniqueMTI&approvetransaction=true

Note: If approvetransaction is not included, true is assumed.

Response Details

If successful, the response HTTP status code is 204.
The response will be in MerchantApprovalResource and contain the following parameters.

Possible Responses

Case
Examples

Approve

  • Auth Only (with amount > 0)

with transactionId

{
  "transactionId": "38611602",
  "transactionStatus": "Waiting"
}

with merchantTransactionId

{
  "transactionId": "38611602",
  "transactionStatus": "Waiting",
  "merchantTransactionId": "merchantTransactionId122222"
}
  • Auth Only (with amount = 0)
  • Auth Capture
  • Create PayPal Transaction
  • Create Local Bank Transfer Transaction

with transactionId

{
  "transactionId": "38611602",
  "transactionStatus": "Approved"
}

with merchantTransactionId

{
  "transactionId": "38611602",
  "transactionStatus": "Approved",
  "merchantTransactionId": "merchantTransactionId122222"
}
  • Create Subscription
  • Create Merchant-Managed Subscription

with transactionId

{
  "subscriptionId": 39606170,
  "transactionId": "38611602",
  "transactionStatus": "Approved"
}

with merchantTransactionId

{
  "subscriptionId": 39606170,
  "transactionId": "38611602",
  "transactionStatus": "Approved",
  "merchantTransactionId": "merchantTransactionId122222"
}

Decline

  • Create Local Bank Transfer Transaction

with transactionId

{
  "transactionId": "38523084",
  "transactionStatus": "Short OrderContext Declined By Vendor &#x28;Refund Needed&#x29;"
}

with merchantTransactionId

{
  "transactionId": "38523084",
  "transactionStatus": "Short OrderContext Declined By Vendor &#x28;Refund Needed&#x29;",
  "merchantTransactionId": "merchantTransactionId122222"
}
  • all others

with transactionId

{
  "transactionId": "38611592",
  "transactionStatus": "Canceled"
}

with merchantTransactionId

{
  "transactionId": "38611592",
  "transactionStatus": "Canceled",
  "merchantTransactionId": "merchantTransactionId122222"
}


Example

Request Example

curl -v -X PUT https://sandbox.bluesnap.com/services/2/transactions/approval?transactionid=38612140&approvetransaction=true \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
curl -v -X PUT https://sandbox.bluesnap.com/services/2/transactions/approval?transactionid=38612140&approvetransaction=false \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '

Response Examples

{
	"transactionId": "38611602",
	"transactionStatus": "Approved"
}
{
	"transactionId": "38611602",
	"transactionStatus": "Approved",
	"merchantTransactionId": "merchantTransactionId122222"
}


API Explorer

To test a call, enter an existing transaction ID or merchant transaction ID. This automatically inserts the ID into the request URL.


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