For AI agents: a documentation index is available at the root level at /llms.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
A merchant can use pre-authorizations to hold an amount on a customer’s card to capture later. The merchant can run pre-authorizations only if we have enabled the function on their account. If we have not enabled pre-authorizations on the merchant’s account, we run pre-authorization attempts as sales with a status of ‘pending’.
If a merchant needs to capture more than they originally pre-authorized, they can adjust the pre-authorization amount before they capture it. For example:
A hotel pre-authorizes a one-night stay for a customer at $100.
The customer decides to have dinner in the hotel for $50. The hotel adjusts the $100 pre-authorization to $150.
At checkout, the hotel captures $150 from the customer’s account for the one-night stay and dinner.
Integration steps
Step 1. Create a payment. Step 2. (Optional) Adjust a payment. Step 3. Capture a payment.
To run a pre-authorization, set both autoCapture and processAsSale to false in the request body. If both parameters are set to true, the transaction runs as a sale instead of a pre-authorization.
To run a pre-authorization, send a POST request to our Payments endpoint.
Important: Save the paymentId to use when you capture the payment.
If your request is successful, we send a pre-authorization request to the customer’s bank or card company for the specific amount. The response contains the following fields:
Response
paymentIdstringRequired=10 characters
Unique identifier that our gateway assigned to the transaction.
processingTerminalIdstringRequired4-50 characters
Unique identifier of the terminal that initiated the transaction.
orderobjectRequired
Object that contains information about the payment.
cardobjectRequired
Object that contains the details of the payment card.
transactionResultobjectRequired
Object that contains information about the transaction response details.
operatorstringOptional0-50 characters
Operator who initiated the request.
customerobjectOptional
Object that contains the customer's contact details and address information.
refundslist of objectsOptional
Array of refundSummary objects.
Each object contains information about refunds linked to the transaction.
supportedOperationslist of enumsOptional
Array of operations that you can perform on the transaction.
- `capture` - Capture the payment.
- `refund` - Refund the payment.
- `fullyReverse` - Fully reverse the transaction.
- `partiallyReverse` - Partially reverse the payment.
- `incrementAuthorization` - Increase the amount of the authorization.
- `adjustTip` - Adjust the tip post-payment.
- `addSignature` - Add a signature to the payment.
- `setAsReady` - Set the transaction’s status to `ready`.
- `setAsPending` - Set the transaction’s status to `pending`.
customFieldslist of objectsOptional
Array of customField objects.
Example response
Response
1
{
2
"paymentId": "J9VULKIKFP",
3
"processingTerminalId": "1234001",
4
"order": {
5
"orderId": "1234567890W",
6
"amount": 4999,
7
"currency": "USD",
8
"dateTime": "2024-07-02T15:30:00Z",
9
"description": "Card Transaction (APPLE)"
10
},
11
"card": {
12
"type": "MasterCard",
13
"entryMethod": "keyed",
14
"cardNumber": "500165******0000",
15
"expiryDate": "0328",
16
"securityChecks": {
17
"avsResult": "U"
18
}
19
},
20
"transactionResult": {
21
"status": "ready",
22
"responseCode": "A",
23
"type": "sale",
24
"approvalCode": "OK3",
25
"authorizedAmount": 4999,
26
"currency": "USD",
27
"responseMessage": "APPROVAL",
28
"processorResponseCode": "00"
29
},
30
"operator": "Jane",
31
"supportedOperations": [
32
"capture",
33
"fullyReverse",
34
"partiallyReverse",
35
"incrementAuthorization",
36
"adjustTip",
37
"setAsPending"
38
]
39
}
Step 2. (Optional) Adjust a payment
Important: A merchant can capture more than they originally pre-authorized, however each card brand sets different limits to the additional amount that the merchant can capture. If a merchant needs to capture more than they originally pre-authorized, we recommend that they adjust the pre-authorization before they capture it.
To adjust a pre-authorized amount, send a POST request to our Payments endpoint.
To create the body of your request, use the following parameters:
Request
adjustmentslist of objectsRequired
Array of polymorphic objects which contain information about adjustments to a payment.
The value of the type parameter determines which variant you should use:
- `order` - Tip information.
- `status` - Status of the transaction.
- `customer` - Customer's contact information and shipping address.
- `signature` - Customer's signature.
operatorstringOptional0-50 characters
Operator who adjusted the payment.
Example request
POST
/v1/payments/:paymentId/adjust
1
curl -X POST https://api.payroc.com/v1/payments/M2MJOG6O2Y/adjust \
If your request is successful, we adjust the pre-authorization amount and return a response. The response contains the following fields:
Response
paymentIdstringRequired=10 characters
Unique identifier that our gateway assigned to the transaction.
processingTerminalIdstringRequired4-50 characters
Unique identifier of the terminal that initiated the transaction.
orderobjectRequired
Object that contains information about the payment.
cardobjectRequired
Object that contains the details of the payment card.
transactionResultobjectRequired
Object that contains information about the transaction response details.
operatorstringOptional0-50 characters
Operator who initiated the request.
customerobjectOptional
Object that contains the customer's contact details and address information.
refundslist of objectsOptional
Array of refundSummary objects.
Each object contains information about refunds linked to the transaction.
supportedOperationslist of enumsOptional
Array of operations that you can perform on the transaction.
- `capture` - Capture the payment.
- `refund` - Refund the payment.
- `fullyReverse` - Fully reverse the transaction.
- `partiallyReverse` - Partially reverse the payment.
- `incrementAuthorization` - Increase the amount of the authorization.
- `adjustTip` - Adjust the tip post-payment.
- `addSignature` - Add a signature to the payment.
- `setAsReady` - Set the transaction’s status to `ready`.
- `setAsPending` - Set the transaction’s status to `pending`.
customFieldslist of objectsOptional
Array of customField objects.
Example response
Response
1
{
2
"paymentId": "M2MJOG6O2Y",
3
"processingTerminalId": "1234001",
4
"order": {
5
"orderId": "OrderRef6543",
6
"amount": 4999,
7
"currency": "USD",
8
"dateTime": "2024-07-02T15:30:00Z",
9
"description": "Example payment"
10
},
11
"card": {
12
"type": "MasterCard",
13
"entryMethod": "keyed",
14
"cardNumber": "453985******7062",
15
"expiryDate": "1230",
16
"securityChecks": {
17
"cvvResult": "M",
18
"avsResult": "Y"
19
}
20
},
21
"transactionResult": {
22
"status": "ready",
23
"responseCode": "A",
24
"type": "sale",
25
"approvalCode": "OK6",
26
"authorizedAmount": 4999,
27
"currency": "USD",
28
"responseMessage": "OK6"
29
},
30
"customer": {
31
"firstName": "Sarah",
32
"lastName": "Hopper",
33
"billingAddress": {
34
"address1": "1 Example Ave.",
35
"address2": "Example Address Line 2",
36
"address3": "Example Address Line 3",
37
"city": "Chicago",
38
"state": "Illinois",
39
"country": "US",
40
"postalCode": "60056"
41
},
42
"shippingAddress": {
43
"recipientName": "Sarah Hopper",
44
"address": {
45
"address1": "1 Example Ave.",
46
"address2": "Example Address Line 2",
47
"address3": "Example Address Line 3",
48
"city": "Chicago",
49
"state": "Illinois",
50
"country": "US",
51
"postalCode": "60056"
52
}
53
}
54
},
55
"supportedOperations": [
56
"capture",
57
"fullyReverse",
58
"partiallyReverse",
59
"incrementAuthorization",
60
"adjustTip",
61
"setAsPending"
62
],
63
"customFields": [
64
{
65
"name": "yourCustomField",
66
"value": "abc123"
67
}
68
]
69
}
Step 3. Capture a payment
To capture the pre-authorization, send a POST request to our Payments endpoint.
If your request is successful, we capture the pre-authorization and return a response. The response contains the following fields:
Response
paymentIdstringRequired=10 characters
Unique identifier that our gateway assigned to the transaction.
processingTerminalIdstringRequired4-50 characters
Unique identifier of the terminal that initiated the transaction.
orderobjectRequired
Object that contains information about the payment.
cardobjectRequired
Object that contains the details of the payment card.
transactionResultobjectRequired
Object that contains information about the transaction response details.
operatorstringOptional0-50 characters
Operator who initiated the request.
customerobjectOptional
Object that contains the customer's contact details and address information.
refundslist of objectsOptional
Array of refundSummary objects.
Each object contains information about refunds linked to the transaction.
supportedOperationslist of enumsOptional
Array of operations that you can perform on the transaction.
- `capture` - Capture the payment.
- `refund` - Refund the payment.
- `fullyReverse` - Fully reverse the transaction.
- `partiallyReverse` - Partially reverse the payment.
- `incrementAuthorization` - Increase the amount of the authorization.
- `adjustTip` - Adjust the tip post-payment.
- `addSignature` - Add a signature to the payment.
- `setAsReady` - Set the transaction’s status to `ready`.
- `setAsPending` - Set the transaction’s status to `pending`.
customFieldslist of objectsOptional
Array of customField objects.
Example response
Response
1
{
2
"paymentId": "M2MJOG6O2Y",
3
"processingTerminalId": "1234001",
4
"order": {
5
"orderId": "OrderRef6543",
6
"amount": 4999,
7
"currency": "USD",
8
"dateTime": "2024-07-02T15:30:00Z",
9
"description": "Large Pepperoni Pizza"
10
},
11
"card": {
12
"type": "MasterCard",
13
"entryMethod": "keyed",
14
"cardNumber": "453985******7062",
15
"expiryDate": "1230",
16
"securityChecks": {
17
"cvvResult": "M",
18
"avsResult": "Y"
19
}
20
},
21
"transactionResult": {
22
"status": "ready",
23
"responseCode": "A",
24
"type": "sale",
25
"approvalCode": "OK3",
26
"authorizedAmount": 4999,
27
"currency": "USD",
28
"responseMessage": "OK3"
29
},
30
"operator": "Jane",
31
"customer": {
32
"firstName": "Sarah",
33
"lastName": "Hopper",
34
"billingAddress": {
35
"address1": "1 Example Ave.",
36
"address2": "Example Address Line 2",
37
"address3": "Example Address Line 3",
38
"city": "Chicago",
39
"state": "Illinois",
40
"country": "US",
41
"postalCode": "60056"
42
},
43
"shippingAddress": {
44
"recipientName": "Sarah Hopper",
45
"address": {
46
"address1": "1 Example Ave.",
47
"address2": "Example Address Line 2",
48
"address3": "Example Address Line 3",
49
"city": "Chicago",
50
"state": "Illinois",
51
"country": "US",
52
"postalCode": "60056"
53
}
54
}
55
},
56
"supportedOperations": [
57
"capture",
58
"fullyReverse",
59
"partiallyReverse",
60
"incrementAuthorization",
61
"adjustTip",
62
"setAsPending"
63
],
64
"customFields": [
65
{
66
"name": "yourCustomField",
67
"value": "abc123"
68
}
69
]
70
}
Test cases
Before you run test cases, read the Payments page in Test Your Integration.