Transaction Examples: Capture

Capture

The Capture transaction allows merchants to finalize a previously authorized transaction, and submit it for clearing and settlement. An example is when online retailers initiate an Authorization transaction to reserve funds by the card issuer prior to the shipment/delivery (i.e., fulfillment) of the goods, and then once fulfillment has been completed the transaction is captured and submitted for settlement. A Capture is also referred to as a Pre-Authorization Completion transaction or more simply as a Completion transaction.

Capture Approved

A Capture is a linked transaction. Like a Matched Refund, it is linked to a purchase by requiring a previous (original) Gateway-assigned Transaction ID. Note that the field must match the original authorization amount.

Capture Approved Request

XML

JSON

PHP (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/php

Python (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/python

Go (XML)

https://github.com/Clearent-Gateway/API-Examples/tree/go

C# (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/C#

Java (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/java

VB.net (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/vbnet

Capture Approved Response

XML

JSON

Capture with Tip

Capture Approved with Tip Amount

Tips are handled with an Authorization and Capture method (not a SALE). The Authorization is sent for the bill amount then later a Capture transactions includes the tip amount field to update the total amount charged to the credit card.
Note that the field should still match the original authorization amount, regardless of whether a tip amount is included.

Capture Approved with Tip Amount Request

XML

JSON

PHP (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/php

Python (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/python

Go (XML)

https://github.com/Clearent-Gateway/API-Examples/tree/go

C# (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/C#

Java (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/java

VB.net (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/vbnet

Capture Approved with Tip Amount Response

XML

JSON

Capture with Tip Adjust

A tip amount can be adjusted by updating the tip-amount field on a Capture transaction. A request is submitted by using the HTTP PUT method. The amount you put in the tip-amount field will be the new amount of the tip. For example, let’s say the original tip was 50.00 and you want the new tip to be 5.00. You would pass 5.00 in the tip-amount field. The URL must include the id of the Capture transaction in the following form:

https://gateway-sb.clearent.net/rest/v2/transactions/66937

Using PUT to Adjust Tip

The body of the HTTP PUT method must contain the api-key field and the tip-amount field with the new value for the tip amount.

REQUEST

PUT /rest/v2/transactions/66937 HTTP/1.1
Host: gateway-sb.clearent.net
accept: application/xml
api-key: YOURAPIKEYHERE
content-type: application/xml

Request

XML

JSON

PHP (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/php

Python (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/python

Go (XML)

https://github.com/Clearent-Gateway/API-Examples/tree/go

C# (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/C#

Java (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/java

VB.net (JSON)

https://github.com/Clearent-Gateway/API-Examples/tree/vbnet

Capture Approved with Tip Adjust Response

XML

JSON

Using GET to See Changes

When you are doing a GET for the transaction with the adjusted tip, YOU MUST USE THE CAPTURE transaction id. You should see the field updated to the amount passed in the PUT. In XML, you will see two additional fields: tip-adjusted and tip-adjusted-amount. The tip-adjusted field will be a 1 for true and 0 for false. While tip-adjusted-amount will be the difference between the new tip amount and the original tip amount.

For example, when a 50.00 tip amount is adjusted to a 5.00 tip amount, you will have a tip-amount of 5.00, a tip-adjusted of 1 and tip-adjusted-amount of 45.00.

Get Response

XML

JSON