{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"Taxes","type":"basic","slug":"taxes","excerpt":"","body":"Taxes are complicated, so to simplify the process of calculating and charging tax to customers, BlueSnap has partnered with [Avalara](https://www.avalara.com/us/en/index.html). Each of your products will have an associated tax code that is used in conjunction with your shopper's address and your business address to calculate the tax rate. BlueSnap makes it easy to create tax quotes and add taxes to transactions. \n\n**Sign up for the beta version [here](https://go.bluesnap.com/beta-program).** \n\nThis guide will cover the following topics: \n\n* [Implementation](#section-implementation)\n* [Separate authorization and capture](#section-separate-authorization-and-capture)\n* [Subscriptions](#section-subscriptions)\n* [Refunds](#section-refunds)\n\n# Implementation\nImplementing BlueSnap's tax feature consists of these steps: \n\n[1. Map your products to tax codes](#section-1-map-your-products-to-tax-codes)\n[2. Create a tax quote](#section-2-create-a-tax-quote)\n[3. Process the transaction](#section-3-process-the-transaction)\n\n## 1. Map your products to tax codes \nAvalara needs to know how to categorize each of your products and services to calculate taxes. In some instances, various product types, such as clothes, food, and video games, need to be taxed at different rates. Tax codes provide a method to categorize goods and services so Avalara can handle these variations. \n\nMap each of your products and services to its appropriate tax code. Refer to [Avalara's website](https://taxcode.avatax.avalara.com/) for a directory of tax codes. You will need to store the applicable tax codes on your side. \n\n## 2. Create a tax quote\nAs part of the checkout process, you'll need to calculate and display the tax amount to your shopper. To calculate the tax, send a [Create Tax Quote](/v8976-Tools/docs/create-tax-quote) request to BlueSnap.  \n\nThe response will include the tax for each item, the total tax, and the tax quote reference number (which allows you to reference the tax quote in the future), in addition to other details. At this point, you'll need to display the sales tax to the shopper.    \n\n### Tax quote expiration\nA tax quote will expire 24 hours after its creation unless you send the transaction to BlueSnap before then. If a tax quote expires before the transaction has been sent to BlueSnap, you'll need to create a new one. \n\n## 3. Process the transaction\nTo process the transaction, include the total transaction amount (including the total tax) in the `amount` property and include the tax quote reference number in the `taxReference` property. Below is a basic [Auth Capture](/v8976-JSON/docs/auth-capture) request and response. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions \\\\\\n-H 'Content-Type: application/json' \\\\ \\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"cardTransactionType\\\": \\\"AUTH_CAPTURE\\\",\\n  \\\"softDescriptor\\\": \\\"Test transaction\\\",\\n  \\\"amount\\\": 174.8,\\n  \\\"currency\\\": \\\"USD\\\",\\n  \\\"taxReference\\\": \\\"048deff0-a285-47e1-bc39-42f79bf0095b\\\",\\n  \\\"cardHolderInfo\\\": {\\n    \\\"firstName\\\": \\\"Jane\\\",\\n    \\\"lastName\\\": \\\"Smith\\\",\\n    \\\"zip\\\": \\\"92614\\\",\\n    \\\"country\\\": \\\"us\\\"\\n  },\\n  \\\"creditCard\\\": {\\n    \\\"cardNumber\\\": \\\"4263982640269299\\\",\\n    \\\"securityCode\\\": \\\"837\\\",\\n    \\\"expirationMonth\\\": \\\"02\\\",\\n    \\\"expirationYear\\\": \\\"2023\\\"\\n  }\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Auth Capture - Request\"\n    },\n    {\n      \"code\": \"{\\n  \\\"cardTransactionType\\\": \\\"AUTH_CAPTURE\\\",\\n  \\\"transactionId\\\": \\\"38646818\\\",\\n  \\\"softDescriptor\\\": \\\"Test transaction\\\",\\n  \\\"amount\\\": 174.8,\\n  \\\"usdAmount\\\": 174.8,\\n  \\\"currency\\\": \\\"USD\\\",\\n  \\\"avsResponseCode\\\": \\\"N\\\",\\n  \\\"transactionApprovalDate\\\": \\\"08/26/2020\\\",\\n  \\\"transactionApprovalTime\\\": \\\"01:17:01\\\",\\n  \\\"cardHolderInfo\\\": {\\n    \\\"firstName\\\": \\\"Jane\\\",\\n    \\\"lastName\\\": \\\"Smith\\\",\\n    \\\"country\\\": \\\"us\\\",\\n    \\\"zip\\\": \\\"92614\\\"\\n  },\\n  \\\"vaultedShopperId\\\": 19671044,\\n  \\\"creditCard\\\": {\\n    \\\"cardLastFourDigits\\\": \\\"9299\\\",\\n    \\\"cardType\\\": \\\"VISA\\\",\\n    \\\"cardSubType\\\": \\\"CREDIT\\\",\\n    \\\"cardCategory\\\": \\\"PLATINUM\\\",\\n    \\\"binCategory\\\": \\\"CONSUMER\\\",\\n    \\\"issuingBank\\\": \\\"ALLIED IRISH BANKS PLC\\\",\\n    \\\"issuingCountryCode\\\": \\\"ie\\\"\\n  },\\n  \\\"processingInfo\\\": {\\n    \\\"processingStatus\\\": \\\"success\\\",\\n    \\\"cvvResponseCode\\\": \\\"NR\\\",\\n    \\\"authorizationCode\\\": \\\"587327\\\",\\n    \\\"avsResponseCodeZip\\\": \\\"N\\\",\\n    \\\"avsResponseCodeAddress\\\": \\\"N\\\",\\n    \\\"avsResponseCodeName\\\": \\\"U\\\"\\n  },\\n  \\\"fraudResultInfo\\\": {\\n    \\\"deviceDataCollector\\\": \\\"N\\\"\\n  },\\n  \\\"taxReference\\\": \\\"048deff0-a285-47e1-bc39-42f79bf0095b\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ]\n}\n[/block]\nThe tax amount is finalized once the transaction has been sent to BlueSnap and the shopper's bank has authorized the purchase. This means the shopper will be charged the amount that was authorized, even if tax rates change in the span of time between the authorization and when their funds are captured.  \n\nIf the shopper's payment method is declined, you can retry the purchase with another payment method using the same tax quote, as long as the tax quote is not expired (see [Tax quote expiration](#section-tax-quote-expiration)).   \n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Tax reporting\",\n  \"body\": \"Avalara maintains a record of all taxes owed based on sales. They will work with you to ensure proper tax reporting.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Invoices\",\n  \"body\": \"Merchants who are using BlueSnap’s Payment API with Avalara and want to include tax data on their shoppers' invoices/receipts will need to generate these documents outside of BlueSnap.\"\n}\n[/block]\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n<hr>\n\n# Separate authorization and capture\nYou might choose to separate the card authorization and capture steps for a variety of reasons, such as you sell physical goods, or the product or service will not be ready to be delivered at the time of purchase. This section covers how to include taxes in this scenario.\n\nBefore beginning, make sure you've [created a tax quote](#section-2-create-a-tax-quote) for the transaction. Once complete and you're ready to start processing the transaction, send an [Auth Only](/v8976-JSON/docs/auth-only) request to BlueSnap. As part of the required properties, be sure to specify the following:\n\n* `amount` - The total transaction amount, including tax. \n* `taxReference` - The tax quote reference number.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions \\\\\\n-H 'Content-Type: application/json' \\\\ \\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"cardTransactionType\\\": \\\"AUTH_ONLY\\\",\\n  \\\"softDescriptor\\\": \\\"Test transaction\\\",\\n  \\\"amount\\\": 174.8,\\n  \\\"currency\\\": \\\"USD\\\",\\n  \\\"taxReference\\\": \\\"048deff0-a285-47e1-bc39-42f79bf0095b\\\",\\n  \\\"cardHolderInfo\\\": {\\n    \\\"firstName\\\": \\\"Jane\\\",\\n    \\\"lastName\\\": \\\"Smith\\\",\\n    \\\"zip\\\": \\\"92614\\\",\\n    \\\"country\\\": \\\"us\\\"\\n  },\\n  \\\"creditCard\\\": {\\n    \\\"cardNumber\\\": \\\"4263982640269299\\\",\\n    \\\"securityCode\\\": \\\"837\\\",\\n    \\\"expirationMonth\\\": \\\"02\\\",\\n    \\\"expirationYear\\\": \\\"2023\\\"\\n  }\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Auth Only - Request \"\n    }\n  ]\n}\n[/block]\nWhen the goods or services are ready to be delivered, send a [Capture](/v8976-JSON/docs/capture) request to BlueSnap. The following example shows a Capture request for the full authorization amount.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/transactions \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"cardTransactionType\\\": \\\"CAPTURE\\\",\\n  \\\"transactionId\\\": \\\"1011671985\\\"\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Capture - Request \"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Please note that partial captures are not supported at this time.\"\n}\n[/block]\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n<hr>\n\n# Subscriptions\nIf you're using [BlueSnap's Subscription Engine](/v8976-JSON/docs/subscription-management#section-bluesnap-subscription-billing-engine), you might want to include tax with each subscription charge. This section covers how to accomplish this. \n\nSee: \n* [Create a subscription with tax](#section-create-a-subscription-with-tax)\n* [Update a subscription that includes tax](#section-update-a-subscription-that-includes-tax)\n\n## Create a subscription with tax\nFollow the below steps to create a subscription with tax. \n\n1. [Create a tax quote](/v8976-Tools/docs/create-tax-quote) for the **initial charge amount** of the subscription. For example, you might offer a special discount on the first month of the subscription. Take note of the `taxReference` value from the API response. \n<span></span>\n**Note:** If the initial and recurring charge amounts are the same, then you only need to create one tax quote. You can skip the next step. \n\n2. [Create a tax quote](/v8976-Tools/docs/create-tax-quote) for the **recurring charge amount** of the subscription. For example, if you offer a special discount for the first subscription charge, then subsequent charges will be the standard price. Take note of the `taxReference` value from the API response.  \n\n3. Send a [Create Subscription](/v8976-JSON/docs/create-subscription) request and include `initialTaxReference` (set to the value from step 1) and `recurringTaxReference` (set to the value from step 2). \n<span></span>\n**Note:** If the initial and recurring charge amounts are the same, you can simply pass one of `initialTaxReference` or `recurringTaxReference` set to the value from step 1. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"payerInfo\\\": {\\n    \\\"zip\\\": 92614,\\n    \\\"firstName\\\": \\\"John\\\",\\n    \\\"lastName\\\": \\\"Doe\\\",\\n    \\\"phone\\\": 1234567890\\n  },\\n  \\\"paymentSource\\\": {\\n    \\\"creditCardInfo\\\": {\\n      \\\"creditCard\\\": {\\n        \\\"expirationYear\\\": 2023,\\n        \\\"securityCode\\\": 111,\\n        \\\"expirationMonth\\\": \\\"07\\\",\\n        \\\"cardNumber\\\": 4111111111111111\\n      }\\n    }\\n  },\\n  \\\"planId\\\": 2212064,\\n  \\\"transactionFraudInfo\\\": {\\\"fraudSessionId\\\": 1234},\\n  \\\"initialTaxReference\\\": \\\"88abb3f8-d5bf-481f-8298-4a16e8cef94d\\\",\\n  \\\"recurringTaxReference\\\": \\\" a98d7dc5-d5f4-428a-8481-3fc131f0444b\\\"\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Create Subscription - Request\"\n    }\n  ]\n}\n[/block]\n## Update a subscription that includes tax\nIf you need to update a subscription's **plan** or **recurring charge amount**, [create a tax quote](/v8976-Tools/docs/create-tax-quote) for the new charge amount. Then, send an [Update Subscription](/v8976-JSON/docs/update-subscription) request with `recurringTaxReference`. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/subscriptions/8491543 \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"overrideRecurringChargeAmount\\\": 44,\\n  \\\"planId\\\": 2212064,\\n  \\\"recurringTaxReference\\\": \\\"667195a5-2249-49b6-bb7e-724eb16b3508\\\"\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Update Subscription - Request\"\n    }\n  ]\n}\n[/block]\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n<hr>\n\n# Refunds\nTo refund a transaction that involves taxes, you'll send a [Refund](/v8976-JSON/docs/refund) request to BlueSnap. \n\nTo issue a **full refund**, simply omit the `amount` property from the request body (A code sample for a full refund can be found [here](/v8976-JSON-Draft/docs/refund#section-request-examples)). The total transaction amount, including tax, will be refunded in full. \n\nTo issue a **partial refund**, include the following parameters in the request body. \n* `taxAmount` - The tax amount to be refunded. \n* `amount` - The total amount (including tax) to be refunded. \n\nFor example, suppose the original transaction total was $105 for a shirt and necklace. The shopper wants a refund for the shirt that costs $50 before tax. Suppose the tax amount for the shirt was $2.50. The total tax amount to be refunded would be $2.50 (specified by the `taxAmount` property) and the total refund amount would be $52.50 (specified by the `amount` property). \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/1039287997 \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n{\\n  \\\"amount\\\": 52.50,\\n  \\\"taxAmount\\\": 2.50\\n}'\",\n      \"language\": \"curl\",\n      \"name\": \"Partial refund with tax - Request\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"You might already store details about transactions on your side, such as transaction ID, transaction total, items purchased, and the shopper's ID. In addition to these details, we recommend storing the tax amount for each item purchased. \\n\\nThis simplifies the refund process, as you will already have the transaction total and tax amounts stored in your database.\",\n  \"title\": \"Storing tax amounts\"\n}\n[/block]\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","updates":[],"order":30,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"6183ed028202aa00161024e1","createdAt":"2020-08-31T20:31:38.152Z","user":"5ea72d649148ff00653f6bbc","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Guides","slug":"topics","order":7,"from_sync":false,"reference":false,"_id":"6183ed028202aa001610248e","version":"6183ed028202aa00161024e9","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2015-11-03T20:45:01.593Z","__v":0},"version":{"version":"8976-Basics","version_clean":"8976.0.0-Basics","codename":"3.40 Release","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["6183ed028202aa0016102488","6183ed028202aa0016102489","6183ed028202aa001610248a","6183ed028202aa001610248b","6183ed028202aa001610248c","6183ed028202aa001610248d","5beb278ac442ab0213f00990","6183ed028202aa001610248e","5c3f542c12c4ac004bc51718","6183ed028202aa001610248f","5df806ccecebde0059f17225","5dfa8a8f340c2b007418eb8a","6183ed028202aa0016102490","5e597199fd2b0200117c2c1c"],"_id":"6183ed028202aa00161024e9","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"60f9b8e6969e03006edca94a","createdAt":"2018-04-23T14:36:48.535Z","releaseDate":"2018-04-23T14:36:48.535Z"},"project":"57336fd5a6a9c40e00e13a0b","__v":0,"parentDoc":null}

Taxes are complicated, so to simplify the process of calculating and charging tax to customers, BlueSnap has partnered with Avalara. Each of your products will have an associated tax code that is used in conjunction with your shopper's address and your business address to calculate the tax rate. BlueSnap makes it easy to create tax quotes and add taxes to transactions.

Sign up for the beta version here.

This guide will cover the following topics:

Implementation

Implementing BlueSnap's tax feature consists of these steps:

1. Map your products to tax codes
2. Create a tax quote
3. Process the transaction

1. Map your products to tax codes

Avalara needs to know how to categorize each of your products and services to calculate taxes. In some instances, various product types, such as clothes, food, and video games, need to be taxed at different rates. Tax codes provide a method to categorize goods and services so Avalara can handle these variations.

Map each of your products and services to its appropriate tax code. Refer to Avalara's website for a directory of tax codes. You will need to store the applicable tax codes on your side.

2. Create a tax quote

As part of the checkout process, you'll need to calculate and display the tax amount to your shopper. To calculate the tax, send a Create Tax Quote request to BlueSnap.

The response will include the tax for each item, the total tax, and the tax quote reference number (which allows you to reference the tax quote in the future), in addition to other details. At this point, you'll need to display the sales tax to the shopper.

Tax quote expiration

A tax quote will expire 24 hours after its creation unless you send the transaction to BlueSnap before then. If a tax quote expires before the transaction has been sent to BlueSnap, you'll need to create a new one.

3. Process the transaction

To process the transaction, include the total transaction amount (including the total tax) in the amount property and include the tax quote reference number in the taxReference property. Below is a basic Auth Capture request and response.

curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions \
-H 'Content-Type: application/json' \ 
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "cardTransactionType": "AUTH_CAPTURE",
  "softDescriptor": "Test transaction",
  "amount": 174.8,
  "currency": "USD",
  "taxReference": "048deff0-a285-47e1-bc39-42f79bf0095b",
  "cardHolderInfo": {
    "firstName": "Jane",
    "lastName": "Smith",
    "zip": "92614",
    "country": "us"
  },
  "creditCard": {
    "cardNumber": "4263982640269299",
    "securityCode": "837",
    "expirationMonth": "02",
    "expirationYear": "2023"
  }
}'
{
  "cardTransactionType": "AUTH_CAPTURE",
  "transactionId": "38646818",
  "softDescriptor": "Test transaction",
  "amount": 174.8,
  "usdAmount": 174.8,
  "currency": "USD",
  "avsResponseCode": "N",
  "transactionApprovalDate": "08/26/2020",
  "transactionApprovalTime": "01:17:01",
  "cardHolderInfo": {
    "firstName": "Jane",
    "lastName": "Smith",
    "country": "us",
    "zip": "92614"
  },
  "vaultedShopperId": 19671044,
  "creditCard": {
    "cardLastFourDigits": "9299",
    "cardType": "VISA",
    "cardSubType": "CREDIT",
    "cardCategory": "PLATINUM",
    "binCategory": "CONSUMER",
    "issuingBank": "ALLIED IRISH BANKS PLC",
    "issuingCountryCode": "ie"
  },
  "processingInfo": {
    "processingStatus": "success",
    "cvvResponseCode": "NR",
    "authorizationCode": "587327",
    "avsResponseCodeZip": "N",
    "avsResponseCodeAddress": "N",
    "avsResponseCodeName": "U"
  },
  "fraudResultInfo": {
    "deviceDataCollector": "N"
  },
  "taxReference": "048deff0-a285-47e1-bc39-42f79bf0095b"
}

The tax amount is finalized once the transaction has been sent to BlueSnap and the shopper's bank has authorized the purchase. This means the shopper will be charged the amount that was authorized, even if tax rates change in the span of time between the authorization and when their funds are captured.

If the shopper's payment method is declined, you can retry the purchase with another payment method using the same tax quote, as long as the tax quote is not expired (see Tax quote expiration).

Tax reporting

Avalara maintains a record of all taxes owed based on sales. They will work with you to ensure proper tax reporting.

Invoices

Merchants who are using BlueSnap’s Payment API with Avalara and want to include tax data on their shoppers' invoices/receipts will need to generate these documents outside of BlueSnap.



Back to Top


Separate authorization and capture

You might choose to separate the card authorization and capture steps for a variety of reasons, such as you sell physical goods, or the product or service will not be ready to be delivered at the time of purchase. This section covers how to include taxes in this scenario.

Before beginning, make sure you've created a tax quote for the transaction. Once complete and you're ready to start processing the transaction, send an Auth Only request to BlueSnap. As part of the required properties, be sure to specify the following:

  • amount - The total transaction amount, including tax.
  • taxReference - The tax quote reference number.
curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions \
-H 'Content-Type: application/json' \ 
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "cardTransactionType": "AUTH_ONLY",
  "softDescriptor": "Test transaction",
  "amount": 174.8,
  "currency": "USD",
  "taxReference": "048deff0-a285-47e1-bc39-42f79bf0095b",
  "cardHolderInfo": {
    "firstName": "Jane",
    "lastName": "Smith",
    "zip": "92614",
    "country": "us"
  },
  "creditCard": {
    "cardNumber": "4263982640269299",
    "securityCode": "837",
    "expirationMonth": "02",
    "expirationYear": "2023"
  }
}'

When the goods or services are ready to be delivered, send a Capture request to BlueSnap. The following example shows a Capture request for the full authorization amount.

curl -v -X PUT https://sandbox.bluesnap.com/services/2/transactions \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "cardTransactionType": "CAPTURE",
  "transactionId": "1011671985"
}'

Please note that partial captures are not supported at this time.



Back to Top


Subscriptions

If you're using BlueSnap's Subscription Engine, you might want to include tax with each subscription charge. This section covers how to accomplish this.

See:

Create a subscription with tax

Follow the below steps to create a subscription with tax.

  1. Create a tax quote for the initial charge amount of the subscription. For example, you might offer a special discount on the first month of the subscription. Take note of the taxReference value from the API response.

    Note: If the initial and recurring charge amounts are the same, then you only need to create one tax quote. You can skip the next step.

  2. Create a tax quote for the recurring charge amount of the subscription. For example, if you offer a special discount for the first subscription charge, then subsequent charges will be the standard price. Take note of the taxReference value from the API response.

  3. Send a Create Subscription request and include initialTaxReference (set to the value from step 1) and recurringTaxReference (set to the value from step 2).

    Note: If the initial and recurring charge amounts are the same, you can simply pass one of initialTaxReference or recurringTaxReference set to the value from step 1.

curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "payerInfo": {
    "zip": 92614,
    "firstName": "John",
    "lastName": "Doe",
    "phone": 1234567890
  },
  "paymentSource": {
    "creditCardInfo": {
      "creditCard": {
        "expirationYear": 2023,
        "securityCode": 111,
        "expirationMonth": "07",
        "cardNumber": 4111111111111111
      }
    }
  },
  "planId": 2212064,
  "transactionFraudInfo": {"fraudSessionId": 1234},
  "initialTaxReference": "88abb3f8-d5bf-481f-8298-4a16e8cef94d",
  "recurringTaxReference": " a98d7dc5-d5f4-428a-8481-3fc131f0444b"
}'

Update a subscription that includes tax

If you need to update a subscription's plan or recurring charge amount, create a tax quote for the new charge amount. Then, send an Update Subscription request with recurringTaxReference.

curl -v -X PUT https://sandbox.bluesnap.com/services/2/recurring/subscriptions/8491543 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "overrideRecurringChargeAmount": 44,
  "planId": 2212064,
  "recurringTaxReference": "667195a5-2249-49b6-bb7e-724eb16b3508"
}'



Back to Top


Refunds

To refund a transaction that involves taxes, you'll send a Refund request to BlueSnap.

To issue a full refund, simply omit the amount property from the request body (A code sample for a full refund can be found here). The total transaction amount, including tax, will be refunded in full.

To issue a partial refund, include the following parameters in the request body.

  • taxAmount - The tax amount to be refunded.
  • amount - The total amount (including tax) to be refunded.

For example, suppose the original transaction total was $105 for a shirt and necklace. The shopper wants a refund for the shirt that costs $50 before tax. Suppose the tax amount for the shirt was $2.50. The total tax amount to be refunded would be $2.50 (specified by the taxAmount property) and the total refund amount would be $52.50 (specified by the amount property).

curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions/refund/1039287997 \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
  "amount": 52.50,
  "taxAmount": 2.50
}'

Storing tax amounts

You might already store details about transactions on your side, such as transaction ID, transaction total, items purchased, and the shopper's ID. In addition to these details, we recommend storing the tax amount for each item purchased.

This simplifies the refund process, as you will already have the transaction total and tax amounts stored in your database.