Step 5 - Update a Preauth Transaction
Update a Preauth Transaction
Now that you have created a preauthorized transaction, you may update the payment or tip amount if changes need to be made to the transaction before capture. Preauthorized transactions will expire after 72 hours if not captured with POST /capturePreauthTransaction
, or can be cancelled by calling DELETE /preauthTransaction
.
If necessary, time to expiration can be configured on a merchant by merchant basis.
This step will go over how to update the details of a preauthorized transaction.
You will need to retrieve the user to check for their linked bank account. Refer to the previous step to learn more.
Step 5A - Update the Preauth Transaction
HTTP request
Sandbox - PATCH https://staging-api.aeropay.com/preauthTransaction
Production - PATCH https://api.aeropay.com/preauthTransaction
Request parameters
Parameter | Required? | Type | Description |
---|---|---|---|
id | Yes | String | The id of the preauthorized transaction |
amount | No | String | The updated transaction amount |
attributes | Yes | Object | See Attributes Object |
Attributes Object
Parameter | Required? | Type | Description |
---|---|---|---|
key | Yes | String | See Key Object |
Key Object
Parameter | Required? | Type | Description |
---|---|---|---|
value | Yes | String | tip if entering a tip |
description | Yes | String | See example request |
Code Example - Request
curl --request PATCH \
--url https://staging-api.aeropay.com/preauthTransaction \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'authorizationToken: Bearer {{token}}' \
--data '
{
"id": "19215",
"amount": "12.00",
}'
Code Example - Response
{
"success": true,
"error": null,
"transaction": {
"id": "19215",
"transactionId": "None",
"merchantId": "582",
"merchantAccountId": "511",
"merchantLocationId": "541",
"userId": "12973",
"userAccountId": "16838",
"userName": "John Doe",
"userEmail": "[email protected]",
"amount": "1200",
"dollarAmount": "12.00",
"originalAmount": "1100",
"description": "Online Transaction",
"attributes": {
"tip": {
"selection": {
"tipAmount": "1.00",
"label": "$1.00",
"totalAmount": "11.00"
}
}
},
"createdDate": "1694105493",
"expiryDate": "1694364693",
"cancellationDate": null,
"creditPartnerId": null,
"status": "live"
}
}
Step 5B - Cancel the Preauth Transaction (optional)
A preauth transaction may also be optionally canceled.
HTTP request
Sandbox - DELETE https://staging-api.aeropay.com/preauthTransaction
Production - DELETE https://api.aeropay.com/preauthTransaction
Request parameters
Parameter | Required? | Type | Description |
---|---|---|---|
id | Yes | String | The id of the preauthorized transaction. |
Error Codes
HTTP Status | Error Code | Meaning | Resolution | Message |
---|---|---|---|---|
200 | AP009 | Not authorized to update transaction | Check id parameter is accurate | Unauthorized |
200 | AP300 | Unable to connect to user bank account | Confirm bank connection was not removed. Reconnect bank if persists | We're having issues connecting to your bank. Please reconnect or contact [email protected]. |
200 | AP302 | User has insufficient funds for transaction | Add funds to account | Available balance does not meet requirement - contact [email protected] for more information. |
200 | AP700 | Missing required parameter | Provide 'id' parameter | Missing Required Parameter 'id' |
Code Example - Request
curl --request DELETE \
--url 'https://staging-api.aeropay.com/preauthTransaction?id=1234' \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'authorizationToken: Bearer {{token}}'
Code Example - Response
{
"success": true,
"error": null
}
Updated 10 months ago