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

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

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

Releases the remaining uncaptured amount from a pre-authorized charge. Use to cancel a hold after a partial capture, or to release a pre-authorization that will not be captured.

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}/releases

Path parameter

ParameterTypeDescription
chargeIdstring (UUID) Β· requiredID of the uncaptured or partially captured charge to release.

Request body fields

FieldConstraintDescription
reasonstring Β· requiredRelease reason. See Reason Values below.
terminalobject Β· optionalRequired for terminal releases. Must include terminalId.

reason values

reasonDescription
REQUESTED_BY_CUSTOMERCustomer requested
REQUESTED_BY_MERCHANTMerchant initiated
EXPIRED_UNCAPTURED_CHARGEPre-auth expired
PARTIAL_APPROVALPartial amount approved
ERROR_CORRECTIONError correction
TIMEOUTOperation timed out
3

Request β€” Code Example

JSON β€” Card release
{
"reason": "REQUESTED_BY_CUSTOMER"
}
JSON β€” Terminal release
{
"reason": "REQUESTED_BY_CUSTOMER",
"terminal": { "terminalId": "3a2049fb-6c9f-433d-9cef-701b6843f0cd" }
}
4

Response

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 Example

JSON β€” 200 Released
{
"id": "a1822999-099d-4fb1-a354-77be553a5b22",
"amount": 1299,
"status": "RELEASED",
"releaseDetail": { "reason": "REQUESTED_BY_CUSTOMER" },
"transactionTime": "2024-05-15T16:30:01Z"
}
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