Skip to main content

Step 4: Inspect a transaction

After the transaction has been created your application can retrieve the transaction ID posted in the form submission or if you have implemented the onComplete callback, by inspecting the transaction object passed with the callback.

Get transaction details

This transaction ID can be used with the SDK to fetch additional details about the transaction.

curl -i -X GET "https://api.{gr4vyId}" \
-H "Authorization: Bearer [JWT_TOKEN]"

The transaction includes details about the payment method used, and the status of the transaction.

"type": "transaction",
"id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
"status": "authorized",
"amount": 1299,
"currency": "USD",
"payment_method": {
"type": "payment-method",
"id": "77a76f7e-d2de-4bbc-ada9-d6a0015e6bd5",
"method": "card",
"status": "stored",
"token": "0123456789123458",
"details": {
"number": "XXXX XXXX XXXX 1111",
"expiration_date": "11 / 21",
"scheme": "visa"
API Reference

Visit the API reference documentation for full details about the transaction resource, and any other API.

Capture transaction

Although Gr4vy Embed allows for setting the intent to capture, in some cases it might be desirable to capture the transaction after it has been authorized.

bash curl -i -X POST https://api.{gr4vyId} \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{ "amount": 10000, }'

Partial capture

Some payment processors allow for partial processing. To capture a part of the authorized amount only, set the amount on the capture request to an amount lower than the originally authorized amount.