{"_id":"5bcf3922e8455d049c357ecc","category":{"_id":"5bcf3922e8455d049c357e13","version":"5bcf3922e8455d049c357ed7","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":"5bcf3922e8455d049c357ed7","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5b8ec6a1f8dd7c0003386069","createdAt":"2018-04-24T15:33:45.744Z","releaseDate":"2018-04-24T15:33:45.744Z","categories":["5bcf3922e8455d049c357e0e","5bcf3922e8455d049c357e0f","5bcf3922e8455d049c357e10","5bcf3922e8455d049c357e11","5bcf3922e8455d049c357e12","5bcf3922e8455d049c357e13","5bcf3922e8455d049c357e14","5bcf3922e8455d049c357e15","5bcf3922e8455d049c357e16","5bcf3922e8455d049c357e17","5bcf3922e8455d049c357e18"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.27.2 Release","version_clean":"8976.0.0-Extended","version":"8976-Extended"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-12T15:00:39.545Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[]},"settings":"","auth":"optional","params":[],"url":""},"isReference":true,"order":1,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/subscriptions/:subscription-id</span>\n\n<hr>\n\n##Documentation\nThe Retrieve Subscription request enables you to retrieve details of an existing subscription (a purchase with a recurring payment element), based on the subscription ID.\n\n###Request Content\nEnter the `subscription-id` into the web service URL, in the format:\n`services/2/subscriptions/{subscription-id}`\n\nFor example:\n`services/2/subscriptions/12345`\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you would like to receive details about all charges for the subscription in the response, include the `fulldescription` parameter in the web service URL. For example: \\n`services/2/subscriptions/39486350?fulldescription=true`\",\n  \"title\": \"Use fulldescription parameter to retrieve all details\"\n}\n[/block]\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response contains the retrieved `subscription` resource (see [subscription](doc:subscription)).\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 Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/subscriptions/5741000 \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"Retrieve Subscription Request\"\n    },\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/subscriptions/39486350?fulldescription=true \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"with `fulldescription` parameter\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<subscription xmlns=\\\"http://ws.plimus.com\\\">\\n  <subscription-id>39450214</subscription-id>\\n  <status>A</status>\\n  <underlying-sku-id>2178914</underlying-sku-id>\\n  <shopper-id>19484284</shopper-id>\\n  <credit-card>\\n    <card-last-four-digits>4444</card-last-four-digits>\\n    <card-type>Master Card</card-type>\\n    <card-sub-type>DEBIT</card-sub-type>\\n  </credit-card>\\n  <catalog-recurring-charge>\\n    <currency>USD</currency>\\n    <amount>1.00</amount>\\n  </catalog-recurring-charge>\\n  <charge-frequency>ONDEMAND</charge-frequency>\\n  <auto-renew>true</auto-renew>\\n  <last-charge-result>\\n    <result-code>SUCCESS</result-code>\\n  </last-charge-result>\\n  <subscription-charges>\\n    <url>https://sandbox.bluesnap.com/services/2/subscriptions/39450214/subscription-charges/50043</url>\\n    <url>https://sandbox.bluesnap.com/services/2/subscriptions/39450214/subscription-charges/48121</url>\\n  </subscription-charges>\\n</subscription>\",\n      \"language\": \"xml\",\n      \"name\": \"Retrieve Subscription Response\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<subscription xmlns=\\\"http://ws.plimus.com\\\">\\n   <subscription-id>39486350</subscription-id>\\n   <status>A</status>\\n   <underlying-sku-id>2178914</underlying-sku-id>\\n   <shopper-id>19505364</shopper-id>\\n   <credit-card>\\n      <card-last-four-digits>1111</card-last-four-digits>\\n      <card-type>Visa</card-type>\\n      <card-sub-type>CREDIT</card-sub-type>\\n      <card-category>CLASSIC</card-category>\\n   </credit-card>\\n   <catalog-recurring-charge>\\n      <currency>USD</currency>\\n      <amount>1.00</amount>\\n   </catalog-recurring-charge>\\n   <charge-frequency>ONDEMAND</charge-frequency>\\n   <auto-renew>true</auto-renew>\\n   <last-charge-result>\\n      <result-code>SUCCESS</result-code>\\n   </last-charge-result>\\n   <subscription-charges>\\n      <subscription-charge>\\n         <charge-info />\\n         <charge-invoice-info>\\n            <date-created>11-Nov-14</date-created>\\n            <invoice-id>38442304</invoice-id>\\n            <invoice-amount>5.00</invoice-amount>\\n            <invoice-currency>USD</invoice-currency>\\n         </charge-invoice-info>\\n      </subscription-charge>\\n      <subscription-charge>\\n         <charge-info>\\n            <charge-description>some text</charge-description>\\n         </charge-info>\\n         <charge-invoice-info>\\n            <date-created>11-Nov-15</date-created>\\n            <invoice-id>38442336</invoice-id>\\n            <invoice-amount>1.00</invoice-amount>\\n            <invoice-currency>USD</invoice-currency>\\n         </charge-invoice-info>\\n      </subscription-charge>\\n      <subscription-charge>\\n         <charge-info>\\n            <charge-description>some text</charge-description>\\n         </charge-info>\\n         <charge-invoice-info>\\n            <date-created>11-Nov-15</date-created>\\n            <invoice-id>38442334</invoice-id>\\n            <invoice-amount>1.00</invoice-amount>\\n            <invoice-currency>USD</invoice-currency>\\n         </charge-invoice-info>\\n      </subscription-charge>\\n   </subscription-charges>\\n</subscription>\",\n      \"language\": \"xml\",\n      \"name\": \"with `fulldescription` parameter\"\n    }\n  ]\n}\n[/block]\n<hr>\n\n##Example Descriptions\n\n###Retrieve Subscription\nThe example above shows how to retrieve a subscription. The response includes URLs that you can use to retrieve more details about each charge for this subscription.\n\n###Retrieve Subscription (fulldescription)\nThe example above shows how to retrieve a subscription. The request includes the `fulldescription` parameter in order to receive complete details about each subscription charge in the response.\n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","excerpt":"","slug":"retrieve-subscription","type":"endpoint","title":"Retrieve Subscription"}

getRetrieve Subscription


Definition

https://sandbox.bluesnap.com/services/2/subscriptions/:subscription-id


Documentation

The Retrieve Subscription request enables you to retrieve details of an existing subscription (a purchase with a recurring payment element), based on the subscription ID.

Request Content

Enter the subscription-id into the web service URL, in the format:
services/2/subscriptions/{subscription-id}

For example:
services/2/subscriptions/12345

Use fulldescription parameter to retrieve all details

If you would like to receive details about all charges for the subscription in the response, include the fulldescription parameter in the web service URL. For example:
services/2/subscriptions/39486350?fulldescription=true

Response Details

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


Examples

Request Examples

curl -v -X GET https://sandbox.bluesnap.com/services/2/subscriptions/5741000 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
curl -v -X GET https://sandbox.bluesnap.com/services/2/subscriptions/39486350?fulldescription=true \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='

Response Examples

<?xml version="1.0" encoding="UTF-8"?>
<subscription xmlns="http://ws.plimus.com">
  <subscription-id>39450214</subscription-id>
  <status>A</status>
  <underlying-sku-id>2178914</underlying-sku-id>
  <shopper-id>19484284</shopper-id>
  <credit-card>
    <card-last-four-digits>4444</card-last-four-digits>
    <card-type>Master Card</card-type>
    <card-sub-type>DEBIT</card-sub-type>
  </credit-card>
  <catalog-recurring-charge>
    <currency>USD</currency>
    <amount>1.00</amount>
  </catalog-recurring-charge>
  <charge-frequency>ONDEMAND</charge-frequency>
  <auto-renew>true</auto-renew>
  <last-charge-result>
    <result-code>SUCCESS</result-code>
  </last-charge-result>
  <subscription-charges>
    <url>https://sandbox.bluesnap.com/services/2/subscriptions/39450214/subscription-charges/50043</url>
    <url>https://sandbox.bluesnap.com/services/2/subscriptions/39450214/subscription-charges/48121</url>
  </subscription-charges>
</subscription>
<?xml version="1.0" encoding="UTF-8"?>
<subscription xmlns="http://ws.plimus.com">
   <subscription-id>39486350</subscription-id>
   <status>A</status>
   <underlying-sku-id>2178914</underlying-sku-id>
   <shopper-id>19505364</shopper-id>
   <credit-card>
      <card-last-four-digits>1111</card-last-four-digits>
      <card-type>Visa</card-type>
      <card-sub-type>CREDIT</card-sub-type>
      <card-category>CLASSIC</card-category>
   </credit-card>
   <catalog-recurring-charge>
      <currency>USD</currency>
      <amount>1.00</amount>
   </catalog-recurring-charge>
   <charge-frequency>ONDEMAND</charge-frequency>
   <auto-renew>true</auto-renew>
   <last-charge-result>
      <result-code>SUCCESS</result-code>
   </last-charge-result>
   <subscription-charges>
      <subscription-charge>
         <charge-info />
         <charge-invoice-info>
            <date-created>11-Nov-14</date-created>
            <invoice-id>38442304</invoice-id>
            <invoice-amount>5.00</invoice-amount>
            <invoice-currency>USD</invoice-currency>
         </charge-invoice-info>
      </subscription-charge>
      <subscription-charge>
         <charge-info>
            <charge-description>some text</charge-description>
         </charge-info>
         <charge-invoice-info>
            <date-created>11-Nov-15</date-created>
            <invoice-id>38442336</invoice-id>
            <invoice-amount>1.00</invoice-amount>
            <invoice-currency>USD</invoice-currency>
         </charge-invoice-info>
      </subscription-charge>
      <subscription-charge>
         <charge-info>
            <charge-description>some text</charge-description>
         </charge-info>
         <charge-invoice-info>
            <date-created>11-Nov-15</date-created>
            <invoice-id>38442334</invoice-id>
            <invoice-amount>1.00</invoice-amount>
            <invoice-currency>USD</invoice-currency>
         </charge-invoice-info>
      </subscription-charge>
   </subscription-charges>
</subscription>


Example Descriptions

Retrieve Subscription

The example above shows how to retrieve a subscription. The response includes URLs that you can use to retrieve more details about each charge for this subscription.

Retrieve Subscription (fulldescription)

The example above shows how to retrieve a subscription. The request includes the fulldescription parameter in order to receive complete details about each subscription charge in the response.



Back to Top