{"_id":"5bcf3922e8455d049c357e2e","category":{"_id":"5bcf3922e8455d049c357e12","version":"5bcf3922e8455d049c357ed7","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-05-12T15:22:00.041Z","from_sync":false,"order":4,"slug":"coupon","title":"Catalog"},"parentDoc":null,"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","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:22:40.970Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[]},"settings":"","auth":"optional","params":[],"url":""},"isReference":true,"order":10,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/coupons/:coupon-id</span>\nhttps<span>://sandbox.bluesnap.com/services/2/coupons/resolve?couponcode=:couponcode</span>\n\n<hr>\n\n##Documentation\nThe Retrieve Coupon request enables you to retrieve details of an existing coupon. You can retrieve it based either on the coupon ID or the coupon code.\n\n###Request Content\n**Retrieve based on coupon ID**\nEnter the `shopper-id` into the web service URL, in the format:\n`services/2/coupons/{coupon-id}`\n\nFor example:\n`services/2/coupons/149920`\n\n**Retrieve based on coupon code**\nEnter the coupon code into the web service URL, in the format:\n`services/2/coupons/resolve?couponcode={couponcode}`\n\nFor example:\n`services/2/coupons/resolve?couponcode=50off`\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response contains the retrieved `coupon-info` resource.\nFor details about possible errors, see: [General Errors](doc:general-errors) and [Catalog Errors](doc:catalog-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/coupons/149920 \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"Retrieve Coupon Request: by coupon ID\"\n    },\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/coupons/resolve?couponcode=testcode2 \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='\",\n      \"language\": \"curl\",\n      \"name\": \"by coupon code\"\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<coupon-info xmlns=\\\"http://ws.plimus.com\\\">\\n  <coupon-id>149920</coupon-id>\\n  <product-owner-id>397248</product-owner-id>\\n  <coupon-name>test-coupon</coupon-name>\\n  <coupon-display-name>test-coupon</coupon-display-name>\\n  <minimal-amount>0</minimal-amount>\\n  <usage-count-limit>99999</usage-count-limit>\\n  <coupon-effective-date>29-Jun-17</coupon-effective-date>\\n  <one-per-email>false</one-per-email>\\n  <apply-recurring-charges>false</apply-recurring-charges>\\n  <coupon-discount-policy>\\n    <coupon-discount-type>PRICE</coupon-discount-type>\\n    <coupon-price>\\n      <price-discounts>\\n        <price-discount>\\n          <currency>USD</currency>\\n          <amount>20.00</amount>\\n        </price-discount>\\n      </price-discounts>\\n    </coupon-price>\\n  </coupon-discount-policy>\\n  <coupon-rules>\\n    <applied-skus-rule>INCLUDE_All</applied-skus-rule>\\n  </coupon-rules>\\n  <coupon-codes-info>\\n    <coupon-code-info>\\n      <coupon-code>testcode</coupon-code>\\n      <coupon-code-usage>2</coupon-code-usage>\\n    </coupon-code-info>\\n  </coupon-codes-info>\\n</coupon-info>\",\n      \"language\": \"xml\",\n      \"name\": \"Retrieve Coupon Response: by coupon ID\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<coupon-info xmlns=\\\"http://ws.plimus.com\\\">\\n  <coupon-id>150400</coupon-id>\\n  <product-owner-id>397248</product-owner-id>\\n  <coupon-name>test-coupon2</coupon-name>\\n  <coupon-display-name>test-coupon2</coupon-display-name>\\n  <minimal-amount>10</minimal-amount>\\n  <usage-count-limit>99999</usage-count-limit>\\n  <coupon-effective-date>11-Aug-17</coupon-effective-date>\\n  <one-per-email>true</one-per-email>\\n  <apply-recurring-charges>false</apply-recurring-charges>\\n  <coupon-discount-policy>\\n    <coupon-discount-type>PERCENT</coupon-discount-type>\\n    <coupon-percent>\\n      <percent-discount>20</percent-discount>\\n    </coupon-percent>\\n  </coupon-discount-policy>\\n  <coupon-rules>\\n    <applied-skus-rule>EXCLUDE_ALL</applied-skus-rule>\\n    <coupon-exceptions>\\n      <sku-id>2180434</sku-id>\\n    </coupon-exceptions>\\n  </coupon-rules>\\n  <coupon-codes-info>\\n    <coupon-code-info>\\n      <coupon-code>testcode2</coupon-code>\\n      <coupon-code-usage>0</coupon-code-usage>\\n    </coupon-code-info>\\n  </coupon-codes-info>\\n</coupon-info>\",\n      \"language\": \"xml\",\n      \"name\": \"by coupon code\"\n    }\n  ]\n}\n[/block]\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","excerpt":"","slug":"retrieve-coupon","type":"endpoint","title":"Retrieve Coupon"}

getRetrieve Coupon


Definition

https://sandbox.bluesnap.com/services/2/coupons/:coupon-id
https://sandbox.bluesnap.com/services/2/coupons/resolve?couponcode=:couponcode


Documentation

The Retrieve Coupon request enables you to retrieve details of an existing coupon. You can retrieve it based either on the coupon ID or the coupon code.

Request Content

Retrieve based on coupon ID
Enter the shopper-id into the web service URL, in the format:
services/2/coupons/{coupon-id}

For example:
services/2/coupons/149920

Retrieve based on coupon code
Enter the coupon code into the web service URL, in the format:
services/2/coupons/resolve?couponcode={couponcode}

For example:
services/2/coupons/resolve?couponcode=50off

Response Details

If successful, the response HTTP status code is 200 OK.
The response contains the retrieved coupon-info resource.
For details about possible errors, see: General Errors and Catalog Errors.


Examples

Request Examples

curl -v -X GET https://sandbox.bluesnap.com/services/2/coupons/149920 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
curl -v -X GET https://sandbox.bluesnap.com/services/2/coupons/resolve?couponcode=testcode2 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='

Response Examples

<?xml version="1.0" encoding="UTF-8"?>
<coupon-info xmlns="http://ws.plimus.com">
  <coupon-id>149920</coupon-id>
  <product-owner-id>397248</product-owner-id>
  <coupon-name>test-coupon</coupon-name>
  <coupon-display-name>test-coupon</coupon-display-name>
  <minimal-amount>0</minimal-amount>
  <usage-count-limit>99999</usage-count-limit>
  <coupon-effective-date>29-Jun-17</coupon-effective-date>
  <one-per-email>false</one-per-email>
  <apply-recurring-charges>false</apply-recurring-charges>
  <coupon-discount-policy>
    <coupon-discount-type>PRICE</coupon-discount-type>
    <coupon-price>
      <price-discounts>
        <price-discount>
          <currency>USD</currency>
          <amount>20.00</amount>
        </price-discount>
      </price-discounts>
    </coupon-price>
  </coupon-discount-policy>
  <coupon-rules>
    <applied-skus-rule>INCLUDE_All</applied-skus-rule>
  </coupon-rules>
  <coupon-codes-info>
    <coupon-code-info>
      <coupon-code>testcode</coupon-code>
      <coupon-code-usage>2</coupon-code-usage>
    </coupon-code-info>
  </coupon-codes-info>
</coupon-info>
<?xml version="1.0" encoding="UTF-8"?>
<coupon-info xmlns="http://ws.plimus.com">
  <coupon-id>150400</coupon-id>
  <product-owner-id>397248</product-owner-id>
  <coupon-name>test-coupon2</coupon-name>
  <coupon-display-name>test-coupon2</coupon-display-name>
  <minimal-amount>10</minimal-amount>
  <usage-count-limit>99999</usage-count-limit>
  <coupon-effective-date>11-Aug-17</coupon-effective-date>
  <one-per-email>true</one-per-email>
  <apply-recurring-charges>false</apply-recurring-charges>
  <coupon-discount-policy>
    <coupon-discount-type>PERCENT</coupon-discount-type>
    <coupon-percent>
      <percent-discount>20</percent-discount>
    </coupon-percent>
  </coupon-discount-policy>
  <coupon-rules>
    <applied-skus-rule>EXCLUDE_ALL</applied-skus-rule>
    <coupon-exceptions>
      <sku-id>2180434</sku-id>
    </coupon-exceptions>
  </coupon-rules>
  <coupon-codes-info>
    <coupon-code-info>
      <coupon-code>testcode2</coupon-code>
      <coupon-code-usage>0</coupon-code-usage>
    </coupon-code-info>
  </coupon-codes-info>
</coupon-info>