Capture API

This API captures a transaction in the AUTHORIZED state, transferring the authorized amount from the customer’s account to the merchant's account.

Note
  • Partial capture of the authorized transaction amount is supported, provided the underlying gateway/processor also supports this functionality.

  • If amount parameter is not specified in the capture API request, the full authorized amount will be processed for Capture API.

Status Understanding:

Scroll inside to view more
Payment Gateway Response
Juspay Transaction Status
Description
Success
CHARGED
The Capture API was initiated, and the capture transaction was successfully completed.
Failed
CAPTURE_FAILED
The Capture API was initiated, but the capture transaction failed.
Accepted and pending by gateway
CAPTURE_INITIATED
The Capture API was initiated from Juspay and request pending at the gateway's end.
Timeout/ No response from gateway
AUTHORIZED
The Capture API request was initiated from Juspay, but the request got timed out, or no response was received from the gateway.
API Endpoints
Sandbox Link
POST
https://sandbox.juspay.in/v2/txns/{txn_uuid}/capture
Production Link
POST
https://api.juspay.in/v2/txns/{txn_uuid}/capture
Authorization Header
Headers
Path Params
Query Params
200 : Success
400 : Invalid Input data
401 : Authentication Failed

Error Codes

Scroll inside to view more
Scenario
Error Codes
Description
Sample Error Message
Performing Capture on AUTHENTICATION_FAILED transaction
400
Bad Request
{"error_message":"Cannot Capture AUTHENTICATION_FAILED Transaction","status":"Bad Request","error_code":"Invalid","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"Cannot Capture AUTHENTICATION_FAILED Transaction","code":"INVALID_INPUT","category":"USER_ERROR"}}
Performing Capture on Voided transaction
400
Bad Request
{"error_message":"Cannot Capture VOIDED Transaction","status":"Bad Request","error_code":"Invalid","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"Cannot Capture VOIDED Transaction","code":"INVALID_INPUT","category":"USER_ERROR"}}
Performing Capture on Charged transaction
400
Bad Request
{"error_message":"Cannot Capture CHARGED Transaction","status":"Bad Request","error_code":"Invalid","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"Cannot Capture CHARGED Transaction","code":"INVALID_INPUT","category":"USER_ERROR"}}
Passing Invalid txn_uuid in capture API request
400
Bad Request
{"status":"NOT_FOUND","error_info":{"user_message":"Cannot process your request as txn not found.","developer_message":"Txn not found.","code":"RESOURCE_NOT_FOUND","category":"USER_ERROR"},"status_id":40}
Passing orders in place of txns in capture curl
404
Not Found
Performing Capture on transaction which is in 'PENDING' status
400
Bad Request
{"error_message":"Cannot Capture PENDING_VBV Transaction","status":"Bad Request","error_code":"Invalid","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"Cannot Capture PENDING_VBV Transaction","code":"INVALID_INPUT","category":"USER_ERROR"}}
Last updated 9 months ago