{"_id":"59df6a533b756800107b204f","category":{"_id":"59df6a523b756800107b2027","version":"59df6a523b756800107b201e","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-27T10:22:06.636Z","from_sync":false,"order":8,"slug":"subscriptions","title":"Subscriptions"},"parentDoc":null,"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"59df6a523b756800107b201e","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-10-12T13:12:50.128Z","releaseDate":"2017-10-12T13:12:50.128Z","categories":["59df6a523b756800107b201f","59df6a523b756800107b2020","59df6a523b756800107b2021","59df6a523b756800107b2022","59df6a523b756800107b2023","59df6a523b756800107b2024","59df6a523b756800107b2025","59df6a523b756800107b2026","59df6a523b756800107b2027","59df6a523b756800107b2028","59df6a523b756800107b2029","59df6a523b756800107b202a","59df6a523b756800107b202b","59df6a523b756800107b202c","59df6a523b756800107b202d","59df6a523b756800107b202e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.23 Release","version_clean":"8976.0.0-XML","version":"8976-XML"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-29T19:23:55.868Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[{"code":"","language":"text"}]},"settings":"","auth":"optional","params":[],"url":""},"isReference":false,"order":12,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/recurring/subscriptions/:subscription-id/switch-charge-amount?newplanid=:plan-id</span>\n\n<hr>\n\n##Documentation\nThe Retrieve Subscription Switch Charge Amount request enables you to retrieve the amount that would be charged to a shopper if you changed the subscription to a different plan. If the switch would result in a negative balance, then the `value` parameter will show **0.00**.\n\nThis request does not move the subscription to the new plan, but just retrieves the switch price. To make the switch, use the [Update Subscription](doc:update-subscription) request.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Example:\",\n  \"body\": \"One of your shopper's subscriptions (subscription ID 98989) is currently associated with the silver plan, at a cost of $10 per month. It is halfway through the month, and you would like to find out how much the subscriber would be charged if you switched their subscription to the gold plan (ID 111111, cost of $20 per month) today. To do this, you would send a GET request in this format:\\n`services/2/recurring/subscriptions/98989/switch-charge-amount?newplanid=111111`\\n\\nSince the month is halfway over, half of the amount that was charged for the silver plan is remaining (i.e. $5). That amount would be applied to the charge for the gold plan, so the value returned would be **15.00**.\"\n}\n[/block]\n###Request Content\nEnter the `newplanid` ID (the ID of the plan to which you want to change the subscription), in the format:\n`services/2/recurring/subscriptions/{subscription-id}/switch-charge-amount?newplanid={plan-id}`\n\nFor example:\n`services/2/recurring/subscriptions/98989/switch-charge-amount?newplanid=111111`\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response contains the retrieved `price` resource (see [price](doc:price)).\n\n<hr>\n\n##Examples\n\n###Request Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/subscriptions/98989/switch-charge-amount?newplanid=111111 \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"Retrieve Subscription Charge Request\"\n    }\n  ]\n}\n[/block]\n###Response Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<price xmlns=\\\"http://ws.plimus.com\\\">\\n  <value>15.00</value>\\n  <currency>USD</currency>\\n</price>\",\n      \"language\": \"xml\",\n      \"name\": \"Retrieve Subscription Charge Response\"\n    }\n  ]\n}\n[/block]\n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","excerpt":"","slug":"retrieve-subscription-switch-charge-amount","type":"get","title":"Retrieve Subscription Switch Charge Amount"}

getRetrieve Subscription Switch Charge Amount


Definition

https://sandbox.bluesnap.com/services/2/recurring/subscriptions/:subscription-id/switch-charge-amount?newplanid=:plan-id


Documentation

The Retrieve Subscription Switch Charge Amount request enables you to retrieve the amount that would be charged to a shopper if you changed the subscription to a different plan. If the switch would result in a negative balance, then the value parameter will show 0.00.

This request does not move the subscription to the new plan, but just retrieves the switch price. To make the switch, use the Update Subscription request.

Example:

One of your shopper's subscriptions (subscription ID 98989) is currently associated with the silver plan, at a cost of $10 per month. It is halfway through the month, and you would like to find out how much the subscriber would be charged if you switched their subscription to the gold plan (ID 111111, cost of $20 per month) today. To do this, you would send a GET request in this format:
services/2/recurring/subscriptions/98989/switch-charge-amount?newplanid=111111

Since the month is halfway over, half of the amount that was charged for the silver plan is remaining (i.e. $5). That amount would be applied to the charge for the gold plan, so the value returned would be 15.00.

Request Content

Enter the newplanid ID (the ID of the plan to which you want to change the subscription), in the format:
services/2/recurring/subscriptions/{subscription-id}/switch-charge-amount?newplanid={plan-id}

For example:
services/2/recurring/subscriptions/98989/switch-charge-amount?newplanid=111111

Response Details

If successful, the response HTTP status code is 200 OK.
The response contains the retrieved price resource (see price).


Examples

Request Example

curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/subscriptions/98989/switch-charge-amount?newplanid=111111 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='

Response Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<price xmlns="http://ws.plimus.com">
  <value>15.00</value>
  <currency>USD</currency>
</price>