Transactions
Notice about PCI-DSS
The POST /transactions
endpoint accepts raw card data for payment processing. Merchants using this endpoint must be PCI-DSS certified and maintain proper controls to securely handle and transmit cardholder information. If you are not PCI-DSS compliant, consider using SanctusPay Hosted Checkout Page instead.
Initiates a new transaction authorization (authorize
) or an authorization with immediate capture (authcap
). The operation type determines how the transaction will be processed.
The operation to perform. Use authorize
for authorization-only, or authcap
to authorize and immediately capture.
authcap
Possible values: A unique identifier (e.g., UUID) for this transaction in your system. Also used for idempotency validation. It can match the order_id
or be a separate unique value.
496de72d-d4a4-45eb-b426-3d04d2078a85
POST /transactions HTTP/1.1
Host: test.api.us.sanctuspay.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 502
{
"operation": "authcap",
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"order": {
"order_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"order_amount": 10000,
"order_currency": "USD",
"order_items": [],
"card_holder": {
"first_name": "text",
"middle_name": "text",
"last_name": "text",
"dob": "text",
"email": "[email protected]",
"phone": "text",
"address_1": "text",
"address_2": "text",
"postal_code": "text",
"city": "text",
"state": "text",
"country": "text"
}
},
"card": {
"pan": "text",
"code": "012",
"expiry": "122030",
"name": "John Doe"
}
}
Details of the newly created transaction.
{
"id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"type": "PAYMENT",
"status": "AUTHORIZED",
"order_amount": 10000,
"order_currency": "USD",
"amount_authorized": 10000,
"amount_captured": 1,
"amount_voided": 1,
"amount_refunded": 1,
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"updated_at": "2024-09-05T05:05:25Z"
}
Fetch the details of a specific transaction using its unique trx_id
.
The unique transaction ID to be retrieved.
trx_01J5XCMDXCFXCAQ1BV8HVG6644
GET /transactions/{trx_id} HTTP/1.1
Host: test.api.us.sanctuspay.com
Authorization: Bearer JWT
Accept: */*
The details of the requested transaction.
{
"id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"type": "PAYMENT",
"status": "AUTHORIZED",
"order_amount": 10000,
"order_currency": "USD",
"amount_authorized": 10000,
"amount_captured": 1,
"amount_voided": 1,
"amount_refunded": 1,
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"updated_at": "2024-09-05T05:05:25Z"
}
Perform a capture or void operation on a previously authorized transaction. Specify an amount to partially capture or void. Full captures/voids will use the entire authorized amount.
The unique ID of the transaction to capture or void.
trx_01J5XCMDXCFXCAQ1BV8HVG6644
A unique identifier (e.g., UUID) for referencing this operation in your system. Also used as an idempotency key for capture/void.
496de72d-d4a4-45eb-b426-3d04d2078a85
The operation to perform, either capture
or void
.
capture
Possible values: The amount to capture or void, in the smallest currency unit (e.g., cents for USD).
5000
POST /transactions/{trx_id} HTTP/1.1
Host: test.api.us.sanctuspay.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 90
{
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"operation": "capture",
"amount": 5000
}
The transaction details after the capture or void operation.
{
"id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"type": "PAYMENT",
"status": "AUTHORIZED",
"order_amount": 10000,
"order_currency": "USD",
"amount_authorized": 10000,
"amount_captured": 1,
"amount_voided": 1,
"amount_refunded": 1,
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"updated_at": "2024-09-05T05:05:25Z"
}
Last updated
Was this helpful?