PayFacto API - v2.0 - GET /charges

PayFacto API - v2.0 - GET /charges

PayFacto API - v2.0 - GET /charges

Returns a paginated list of charges sorted from most recent to oldest.

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

GET  https://uat.ca.api.payfacto.cloud/payments/v1/charges
ℹ️

All parameters are query string parameters. No request body is required.

Query parameters

ParameterType / ConstraintDescription
terminalIdstring (UUID) · optionalRestrict to a specific terminal.
authCodestring max 6 · optionalFilter by authorization code.
idempotencyKeystring max 64 · optionalFilter by idempotency key. Overrides all other filters.
invoiceNumberstring max 25 · optionalFilter by invoice number.
lastFourstring 4 digits · optionalFilter by last 4 card digits.
startDatestring YYYY-MM-DD · optionalStart of date range in UTC. Default: 30 days before endDate.
endDatestring YYYY-MM-DD · optionalEnd of date range in UTC. Default: today.
offsetinteger · optionalPagination offset. Default: 0.
limitinteger · optionalMax results per page. Default: 10.
3

Request — Code Example

cURL
curl -X GET "https://uat.ca.api.payfacto.cloud/payments/v1/charges?startDate=2024-05-01&limit=10" \
-H "Authorization: Basic YOUR_BASE64_CREDENTIALS"
4

Response

ℹ️

Returns a charges object with itemsTotal and data array of charge objects.

Response fields

FieldTypeDescription
itemsTotalintegerTotal matching charges across all pages.
dataarrayCharge objects for the current page.
errorobjectPresent only on failure.
5

Response — Code Example

JSON — 200 Success
{
"itemsTotal": 1,
"data": [{
"id": "a1822999-099d-4fb1-a354-77be553a5b22",
"amount": 1299,
"status": "SUCCEEDED",
"transactionTime": "2024-05-15T14: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