{"_id":"5bedbcf19b49e8004462d192","category":{"_id":"5bedbcf09b49e8004462d0d5","version":"5bedbcf19b49e8004462d199","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-01-13T18:38:47.347Z","from_sync":false,"order":5,"slug":"ecp-transaction-service","title":"Subscriptions"},"parentDoc":null,"project":"57336fd5a6a9c40e00e13a0b","user":"560d5913af97231900938124","version":{"_id":"5bedbcf19b49e8004462d199","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5bcf3922e8455d049c357ed7","createdAt":"2018-04-24T15:33:45.744Z","releaseDate":"2018-04-24T15:33:45.744Z","categories":["5bedbcf09b49e8004462d0d0","5bedbcf09b49e8004462d0d1","5bedbcf09b49e8004462d0d2","5bedbcf09b49e8004462d0d3","5bedbcf09b49e8004462d0d4","5bedbcf09b49e8004462d0d5","5bedbcf09b49e8004462d0d6","5bedbcf09b49e8004462d0d7","5bedbcf09b49e8004462d0d8","5bedbcf09b49e8004462d0d9","5bedbcf09b49e8004462d0da"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.28 Release","version_clean":"8976.0.0-Extended","version":"8976-Extended"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-26T19:08:38.252Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","examples":{"codes":[]},"method":"get","auth":"optional","params":[],"url":""},"isReference":true,"order":5,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/subscriptions/:subscription-id/switch-charge-amount?underlyingsku=:sku-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 contract (SKU). \n\nThis request does not move the subscription to the new contract, 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 (SKU ID 111111) today. To do this, you would send a GET request in this format:\\n`services/2/subscriptions/98989/switch-charge-amount?underlyingsku=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 `underlyingsku` ID (the ID of the SKU to which you want to change the subscription), in the format:\n`services/2/subscriptions/{subscription-id}/switch-charge-amount?underlyingsku={Sku ID}`\n\nFor example:\n`services/2/subscriptions/98989/switch-charge-amount?underlyingsku=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)).\nFor details about possible errors, see: [General Errors](doc:general-errors), [Payment & Processor Errors](doc:payment-errors), and [Fraud Errors](doc:fraud-errors).\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/subscriptions/98989/switch-charge-amount?underlyingsku=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":"endpoint","title":"Retrieve Subscription Switch Charge Amount"}

getRetrieve Subscription Switch Charge Amount


Definition

https://sandbox.bluesnap.com/services/2/subscriptions/:subscription-id/switch-charge-amount?underlyingsku=:sku-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 contract (SKU).

This request does not move the subscription to the new contract, 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 (SKU ID 111111) today. To do this, you would send a GET request in this format:
services/2/subscriptions/98989/switch-charge-amount?underlyingsku=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 underlyingsku ID (the ID of the SKU to which you want to change the subscription), in the format:
services/2/subscriptions/{subscription-id}/switch-charge-amount?underlyingsku={Sku ID}

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

Response Details

If successful, the response HTTP status code is 200 OK.
The response contains the retrieved price resource (see price).
For details about possible errors, see: General Errors, Payment & Processor Errors, and Fraud Errors.


Examples

Request Example

curl -v -X GET https://sandbox.bluesnap.com/services/2/subscriptions/98989/switch-charge-amount?underlyingsku=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>