Captures API
POST /api/v1/payment-sessions/:paymentSessionId/captures
Create a capture for the session. This is asynchronous and returns 202 Accepted immediately.
Request Body
{
requestId: string; // Idempotency key
captureAmount: string; // e.g., "10.00"
finalCapture?: boolean; // default: true
}Response (202 Accepted)
{
paymentCaptureId: string;
createdAt: string; // ISO 8601
captureAmount: string;
refundAmount: string;
finalCapture: boolean;
status: "CAPTURING";
}Rules
captureAmount≤capturableAmountIf
finalCaptureistrue, any remainder is refunded to the userOnly
FUNDEDsessions can be captured; during capture, the session status isCAPTURING
Example
curl -X POST https://api.example.com/api/v1/payment-sessions/ps_123/captures \
-H "Authorization: Bearer <MERCHANT_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{ "requestId":"cap-001", "captureAmount":"10.00", "finalCapture":true }'GET /api/v1/payment-sessions/:paymentSessionId/captures/:paymentCaptureId
Retrieve details of a specific capture.
Response
{
paymentCaptureId: string;
createdAt: string; // ISO 8601
finalCapture: boolean;
captureAmount: string;
refundAmount: string; // If applicable
status: "CAPTURING" | "CAPTURED" | "ERROR";
transactionHash?: string; // Present when CAPTURED
error?: string; // Present when ERROR
}Example
curl -X GET https://api.grain.inc/api/v1/payment-sessions/ps_123/captures/pc_123Last updated

