Calculate Prorated Surcharge

The Calculate Prorated Surcharge request determines the prorated surcharge amount of a transaction. After you provide the partial amount to capture/refund and the surcharge token in the request, the API will return the prorated surcharge.

This call is optional for partial captures/refunds, but highly recommended. If you don't call this API, BlueSnap will split the total refund amount between the invoice and surcharge.

For more information about working with surcharges, see the Surcharges tutorial.

Capture Example

ScenarioInvoice CapturedSurcharge CapturedTotal Captured
$40 invoice with Prorate API$40.00$1.20$41.20
$40 invoice without Prorate API$38.83$1.17$40.00

Refund Example

ScenarioInvoice RefundedSurcharge RefundedTotal Refunded
Full Refund$100.00$3.00$103.00
$40 refund without Prorate API$38.83$1.17$40.00
$40 refund with Prorate API$40.00$1.20$41.20

Request Content

Send a surcharge-calculation object, with the following:

PropertyTypeRequired
amountstringrequired
surcharge-infocontainerrequired; (refer to surcharge-info)

Response Details

If successful, the response HTTP status code is 200 OK.
The response contains the surcharge-calculation object.

Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/surcharge/calculate-prorated \
-H 'Content-Type: application/xml' \
-H 'Accept: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<surcharge-calculation xmlns="http://ws.plimus.com">
	<amount>40.00</amount>
	<surcharge-info>
		<surcharge-token>eyJhbGciOiJI**********</surcharge-token>
	</surcharge-info>
</surcharge-calculation>'

Response Examples

<?xml version="1.0" encoding="UTF-8"?>
<surcharge-calculation xmlns="http://ws.plimus.com">
	<amount>20.00</amount>
	<currency>USD</currency>
	<surcharge-info>
		<surcharge-reference>103</surcharge-reference>
		<surcharge-amount>1.2</surcharge-amount>
		<surcharge-rate>2.40</surcharge-rate>
		<description>Surcharge calculated successfully</description>
		<surcharge-token>eyJhbGciOiJI**********</surcharge-token>
	</surcharge-info>
</surcharge-calculation>