Trigger a partial approval
Send a card sale the sandbox approves for less than you asked for, so your integration has to read the authorized amount instead of assuming it.
Signed in, you can run this blueprint against your own sandbox merchant one call at a time, with the values from each call threaded into the next. Sign in to run it.
2 steps, 1 API callPaymentsTransactions
Samples use {{API_KEY}} for your API key and {{BASE_URL}} for this instance's API address. Anything else in double braces is a value an earlier step gave you.
Reproduce it in the sandbox
1. Ask for a partial authorization
API call
POST /api/transactions
Partial approvals only happen when you say you accept them, so the request carries the control field below as well as the trigger amount. Control fields ride on a transaction custom field, and either spelling of the key works. If your sandbox merchant defines custom fields of its own, add this one as an enabled definition or use a merchant that defines none.
Values this step gives you
curl -X POST "{{BASE_URL}}/api/transactions" \
-H "api-key: {{API_KEY}}" \
-H "Content-Type: application/json" \
-d '{
"transactionType": "Sale",
"cardData": {
"cardNumber": "4111111111111111",
"nameOnCard": "Jane Doe",
"expirationMonth": 12,
"expirationYear": 2030,
"cvv": 123
},
"customFields": [
{ "name": "loopback.partialAuthIndicator", "value": "true" }
],
"invoiceData": {
"amounts": { "base": 2.78, "total": 2.78 }
}
}'using var http = new HttpClient { BaseAddress = new Uri("{{BASE_URL}}") };
http.DefaultRequestHeaders.Add("api-key", "{{API_KEY}}");
var response = await http.PostAsJsonAsync("/api/transactions", new
{
transactionType = "Sale",
cardData = new
{
cardNumber = "4111111111111111",
nameOnCard = "Jane Doe",
expirationMonth = 12,
expirationYear = 2030,
cvv = 123
},
customFields = new[]
{
new { name = "loopback.partialAuthIndicator", value = "true" }
},
invoiceData = new
{
amounts = new { @base = 2.78m, total = 2.78m }
}
});
var result = await response.Content.ReadFromJsonAsync<JsonElement>();
var authorized = result.GetProperty("authorizedAmount").GetDecimal();2. Read the outcome off the response
On your side
The sandbox answers with the result code "Partial" and the message "Partial Approval" in the response body. The platform files that result under the "PartialApproval" outcome. It authorizes 2.57 of the 2.78 you asked for, so the authorized amount on the response is the number to reconcile against. This is the case that overstates revenue without announcing it. The transaction approved, so the obvious checks pass, but only part of the amount is authorized. Collect the remainder another way, or release the balance.
Values this step gives you
What this step answers with
Abridged to the properties this step depends on. A real response carries more.
{
"id": "9f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
"merchantId": "3a7b1c9d-2e4f-4a6b-8c8d-9e0f1a2b3c4d",
"resultCode": "Partial",
"authorizedAmount": 2.57,
"responseData": {
"resultCode": "Partial",
"resultMessage": "Partial Approval",
"isPartialApproval": true
}
}