PayFacto API - v2.0 - POST /charges/{chargeId}/captures

PayFacto API - v2.0 - POST /charges/{chargeId}/captures

PayFacto API - v2.0 - POST /charges/{chargeId}/captures

Captures the payment of an existing, previously uncaptured (pre-authorized) charge. The captured amount can be less than or equal to the authorized amount.

1

Prerequisites

πŸ”‘

Authentication β€” HTTP Basic Auth

All v2.0 endpoints use HTTP Basic Authentication. Set Authorization: Basic base64(username:password). Contact PayFacto for credentials.

πŸ“‹

Content-Type

All request bodies require Content-Type: application/json.

πŸ”„

Idempotency

Include Idempotency-Key header (max 64 chars) on POST requests. 200 = duplicate; 201 = newly created.

πŸ’΅

Amounts

All monetary amounts are positive integers in cents. $12.99 = 1299.

2

Request

POST   https://uat.ca.api.payfacto.cloud/payments/v1/charges/{chargeId}/captures

Path parameter

ParameterTypeDescription
chargeIdstring (UUID) Β· requiredID of the pre-authorized charge to capture.

Request body fields

FieldConstraintDescription
amountinteger Β· requiredAmount to capture in cents. Must be <= the authorized amount.
statementDescriptorstring Β· optionalOverride descriptor. Max 23 chars.
terminalobject Β· optionalRequired for terminal captures. Must include terminalId.
3

Request β€” Code Example

⚠️

The charge must have been created with capture: false.

JSON β€” Card capture
{
"amount": 1299
}
JSON β€” Terminal capture
{
"amount": 1299,
"terminal": { "terminalId": "3a2049fb-6c9f-433d-9cef-701b6843f0cd", "clerkId": "001" }
}
4

Response

ℹ️

Returns the updated charge object. Verify status is CAPTURED.

Response fields (charge object)

FieldTypeDescription
idstring (UUID)Unique charge identifier. Store for all subsequent operations.
amountintegerAmount in cents (e.g. 1299 = $12.99).
amountCapturedintegerTotal captured amount in cents.
amountRefundedintegerTotal refunded amount in cents.
billingDetailobjectCustomer billing info (address, email, name, phone).
capturebooleanWhether the charge was captured immediately.
capturedbooleanWhether an uncaptured charge has since been captured.
invoiceNumberstringMerchant invoice reference (max 25 chars).
metadataobjectKey-value pairs for custom data.
originalTransactionTimestring (ISO 8601)UTC timestamp of original transaction. Only on post-charge operations.
paymentMethodobjectPayment method details (type, card/terminal/token data).
refundedbooleanWhether the charge has been fully refunded.
releaseDetailobjectRelease details if the charge was released.
resultobjectAuth result: authCode, batch, declineCode, isoResponseCode, issuerMessage.
shippingDetailobjectShipping recipient information.
statementDescriptorstringMerchant descriptor on customer statement (max 23 chars).
statusstringTransaction status: AUTHORIZED, CAPTURED, DECLINED, FAILED, RELEASED, SUCCEEDED, VOIDED.
transactionTimestring (ISO 8601)UTC timestamp when this object was created.
voidDetailobjectVoid details if voided.
errorobjectError object on failure. Contains code, type, details, message.
5

Response β€” Code Examples

JSON β€” 200 Captured
{
"id": "a1822999-099d-4fb1-a354-77be553a5b22",
"amount": 1299,
"amountCaptured": 1299,
"captured": true,
"status": "CAPTURED",
"result": { "authCode": "012345" }
}
JSON β€” 422 Invalid State
{
"error": { "code": "INVALID_STATE", "type": "INVALID_REQUEST_ERROR", "message": "The charge is already captured." }
}
6

Error / HTTP Status Codes

HTTP StatusMeaningRecommended Action
200OK β€” Previously created (same idempotency key)Check status field in response body
201Created β€” New resource createdStore the id for future operations
400Bad Request β€” Invalid payloadCheck error.details and error.invalidFields
402Payment Required β€” Issuer declinedCheck result.declineCode β€” do not retry automatically
404Not FoundVerify the ID in the request path
422Unprocessable β€” Invalid stateCheck error.message
500Internal Server ErrorRetry with backoff; contact PayFacto Support if persistent