Make a sale transaction

Learn how to authorize and capture a sales transaction in one step using the API
Applies to:Developers

This guide explains how to make a sale (a money in payment transaction) with the Payabli API. This method authorizes and captures a payment in one step, so when a transaction is submitted, it’s immediately captured for settlement.

If aren’t using a stored payment method provided by an embedded component to run transactions, you must secure cardholder, bank account data, and customer IP address because your PCI scope is expanded.

To make a sale transaction, send a POST request to /api/MoneyIn/getpaid. This endpoint is used to process payments for all payment methods, including credit cards, ACH, stored methods, cash, check, and cloud payments.

The request requires several parameters, which can depend on the payment method used. The following are required for all payment methods:

  • entryPoint The ID of the paypoint making the sale
  • paymentMethod: Information about the payment method
  • paymentDetails Information about the payment itself
  • customerData Information about the customer

Although not required, we strongly recommend passing the ipaddress parameter. This is used for risk analysis and fraud prevention.

For a full list of available parameters, see the API reference for this endpoint.

Examples

Each of these examples runs a transaction for $100, with no service fee, for entrypoint f743aed24a and customer ID is 4440.The only difference in each example is the payment method used.

The Card payment method is used for credit and debit card payments.

POST
/api/MoneyIn/getpaid
1from payabli import PaymentDetail, PayMethodCredit, PayorDataRequest, payabli
2
3client = payabli(
4 api_key="YOUR_API_KEY",
5)
6client.money_in.getpaid(
7 customer_data=PayorDataRequest(
8 customer_id=4440,
9 ),
10 entry_point="f743aed24a",
11 ipaddress="255.255.255.255",
12 payment_details=PaymentDetail(
13 service_fee=0.0,
14 total_amount=100.0,
15 ),
16 payment_method=PayMethodCredit(
17 cardcvv="999",
18 cardexp="02/27",
19 card_holder="John Cassian",
20 cardnumber="4111111111111111",
21 cardzip="12345",
22 initiator="payor",
23 ),
24)

The ACH payment method is used for ACH payments made with a bank account.

POST
/api/MoneyIn/getpaid
1from payabli import PaymentDetail, PayMethodAch, PayorDataRequest, payabli
2
3client = payabli(
4 api_key="YOUR_API_KEY",
5)
6client.money_in.getpaid(
7 customer_data=PayorDataRequest(
8 customer_id=4440,
9 ),
10 entry_point="f743aed24a",
11 ipaddress="255.255.255.255",
12 payment_details=PaymentDetail(
13 service_fee=0.0,
14 total_amount=100.0,
15 ),
16 payment_method=PayMethodAch(
17 ach_account="123123123",
18 ach_account_type="Checking",
19 ach_code="WEB",
20 ach_holder="John Cassian",
21 ach_holder_type="personal",
22 ach_routing="123123123",
23 ),
24)

The Stored Method payment method is used for payments made with stored methods, either tokenized credit card or tokenized ACH account.

POST
/api/MoneyIn/getpaid
1from payabli import (
2 PaymentDetail,
3 PayMethodStoredMethod,
4 PayorDataRequest,
5 payabli,
6)
7
8client = payabli(
9 api_key="YOUR_API_KEY",
10)
11client.money_in.getpaid(
12 customer_data=PayorDataRequest(
13 customer_id=4440,
14 ),
15 entry_point="f743aed24a",
16 ipaddress="255.255.255.255",
17 payment_details=PaymentDetail(
18 service_fee=0.0,
19 total_amount=100.0,
20 ),
21 payment_method=PayMethodStoredMethod(
22 initiator="payor",
23 method="card",
24 stored_method_id="1ec55af9-7b5a-4ff0-81ed-c12d2f95e135-4440",
25 stored_method_usage_type="unscheduled",
26 ),
27)

The Cloud payment method is used for payments made with Cloud devices (payment terminals).

POST
/api/MoneyIn/getpaid
1from payabli import PaymentDetail, PayMethodCloud, PayorDataRequest, payabli
2
3client = payabli(
4 api_key="YOUR_API_KEY",
5)
6client.money_in.getpaid(
7 customer_data=PayorDataRequest(
8 customer_id=4440,
9 ),
10 entry_point="f743aed24a",
11 ipaddress="255.255.255.255",
12 payment_details=PaymentDetail(
13 service_fee=0.0,
14 total_amount=100.0,
15 ),
16 payment_method=PayMethodCloud(
17 device="6c361c7d-674c-44cc-b790-382b75d1xxx",
18 save_if_success=True,
19 ),
20)

This example shows how to include additional details in the response by setting the includeDetails parameter to true. This works with any payment method.

1 curl -X POST https://api-sandbox.payabli.com/api/MoneyIn/getpaid?includeDetails=true \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "paymentDetails": {
6 "totalAmount": 100,
7 "serviceFee": 0
8 },
9 "paymentMethod": {
10 "initiator": "payor",
11 "method": "card",
12 "storedMethodId": "1ec55af9-7b5a-4ff0-81ed-c12d2f95e135-4440",
13 "storedMethodUsageType": "unscheduled"
14 },
15 "customerData": {
16 "customerId": 4440
17 },
18 "entryPoint": "f743aed24a",
19 "ipaddress": "255.255.255.255"
20}'

Responses

The response from a successful transaction includes a isSuccess boolean, a responseData object, and a responseText string. The responseData object contains additional information about the transaction, including the referenceId, which is the transaction ID.

A successful request returns a 200 response with a JSON body. The transaction ID is returned as referenceId, this is used as the transId in other endpoints.

Response
1{
2 "responseText": "Success",
3 "isSuccess": true,
4 "responseData": {
5 "referenceId": "575-c490247af7ed403d86ba583507be61b0",
6 "resultCode": 1,
7 "resultText": "Approved",
8 "avsResponseText": "Exact match, Street address and 5-digit ZIP code both match",
9 "cvvResponseText": "Not processed. Indicates that the expiration date was not provided with the request, or that the card does not have a valid CVV2 code. If the expiration date was not included with the request, resubmit the request with the expiration date.",
10 "customerId": 41892,
11 "authCode": "VTLMC1",
12 "methodReferenceId": null
13 },
14 "pageIdentifier": null
15}

If includeDetails is set to true, the response includes additional details about the transaction, which are returned in the transactionDetails object within responseData. This includes information about the customer, payment method, fees, and transaction events.

IncludeDetails example
1 {
2 "responseText": "Success",
3 "isSuccess": true,
4 "pageIdentifier": null,
5 "responseData": {
6 "transactionDetails": {
7 "parentOrgName": "Mountain View Properties",
8 "paypointDbaname": "Riverside Apartments",
9 "paypointLegalname": "Riverside Apartments LLC",
10 "paypointEntryname": "entry399",
11 "paymentTransId": "399-27260fccd280436790115892634be7c4",
12 "connectorName": "gp",
13 "externalProcessorInformation": "",
14 "gatewayTransId": "TRN_i4wWjg6iNO6HMyo1MqtRC7krpmduvR",
15 "orderId": "",
16 "method": "card",
17 "batchNumber": "399_combined_20251002_ec32a12d-baee-41e2-94dd-b0b2c6d932c4",
18 "batchAmount": 42573.28,
19 "payorId": 4119,
20 "paymentData": {
21 "maskedAccount": "5XXXXXXXXXXX4415",
22 "accountType": "mastercard",
23 "accountExp": "12/25",
24 "holderName": "Sarah Johnson",
25 "storedId": null,
26 "initiator": null,
27 "storedMethodUsageType": null,
28 "sequence": null,
29 "orderDescription": "Monthly rent payment - Unit 204",
30 "accountId": null,
31 "signatureData": null,
32 "binData": {
33 "binMatchedLength": "9",
34 "binCardBrand": "MASTERCARD",
35 "binCardType": "CREDIT",
36 "binCardCategory": "MIXED PRODUCT",
37 "binCardIssuer": "ALLIED IRISH BANKS, PLC",
38 "binCardIssuerCountry": "IRELAND",
39 "binCardIssuerCountryCodeA2": "IE",
40 "binCardIssuerCountryNumber": "372",
41 "binCardIsRegulated": "",
42 "binCardUseCategory": "",
43 "binCardIssuerCountryCodeA3": ""
44 },
45 "paymentDetails": {
46 "totalAmount": 1850.00,
47 "serviceFee": 55.50,
48 "checkNumber": null,
49 "checkImage": null,
50 "checkUniqueId": "",
51 "currency": "USD",
52 "orderDescription": null,
53 "orderId": null,
54 "orderIdAlternative": null,
55 "paymentDescription": null,
56 "groupNumber": null,
57 "source": null,
58 "payabliTransId": null,
59 "unbundled": null,
60 "categories": [],
61 "splitFunding": []
62 }
63 },
64 "transStatus": 1,
65 "paypointId": 399,
66 "totalAmount": 1850.00,
67 "netAmount": 1794.50,
68 "feeAmount": 55.50,
69 "settlementStatus": 0,
70 "operation": "Sale",
71 "responseData": {
72 "response": null,
73 "responsetext": "CAPTURED",
74 "authcode": "VTLMC1",
75 "transactionid": "TRN_i4wWjg6iNO6HMyo1MqtRC7krpmduvR",
76 "avsresponse": "N",
77 "avsresponse_text": "No Match, No address or ZIP match",
78 "cvvresponse": "M",
79 "cvvresponse_text": "CVV2/CVC2 match",
80 "orderid": null,
81 "type": null,
82 "response_code": "100",
83 "response_code_text": "Operation successful.",
84 "customer_vault_id": null,
85 "emv_auth_response_data": null
86 },
87 "source": "api",
88 "scheduleReference": 0,
89 "orgId": 39,
90 "refundId": 0,
91 "returnedId": 0,
92 "chargebackId": 0,
93 "retrievalId": 0,
94 "transAdditionalData": null,
95 "invoiceData": {
96 "invoiceNumber": null,
97 "invoiceDate": null,
98 "invoiceDueDate": null,
99 "invoiceEndDate": null,
100 "invoiceStatus": null,
101 "invoiceType": null,
102 "frequency": null,
103 "paymentTerms": null,
104 "termsConditions": null,
105 "notes": null,
106 "tax": null,
107 "discount": null,
108 "invoiceAmount": null,
109 "freightAmount": null,
110 "dutyAmount": null,
111 "purchaseOrder": null,
112 "firstName": null,
113 "lastName": null,
114 "company": null,
115 "shippingAddress1": null,
116 "shippingAddress2": null,
117 "shippingCity": null,
118 "shippingState": null,
119 "shippingZip": null,
120 "shippingCountry": null,
121 "shippingEmail": null,
122 "shippingPhone": null,
123 "shippingFromZip": null,
124 "summaryCommodityCode": null,
125 "items": null,
126 "attachments": null,
127 "additionalData": null
128 },
129 "entrypageId": 0,
130 "externalPaypointID": "39990",
131 "isValidatedACH": false,
132 "transactionTime": "2025-10-02T20:51:03.261",
133 "customer": {
134 "identifiers": null,
135 "firstName": "Sarah",
136 "lastName": "Johnson",
137 "companyName": "Johnson Enterprises",
138 "billingAddress1": "425 Riverside Drive",
139 "billingAddress2": "Unit 204",
140 "billingCity": "Portland",
141 "billingState": "OR",
142 "billingZip": "97201",
143 "billingCountry": "US",
144 "billingPhone": "15035551234",
145 "billingEmail": "sarah.johnson@example.com",
146 "customerNumber": "CUST-1234",
147 "shippingAddress1": "425 Riverside Drive",
148 "shippingAddress2": "Unit 204",
149 "shippingCity": "Portland",
150 "shippingState": "OR",
151 "shippingZip": "97201",
152 "shippingCountry": "US",
153 "customerId": 4119,
154 "customerStatus": 1,
155 "additionalData": {
156 "clientId": "",
157 "customParent": "",
158 "customerId": "",
159 "customParent222": "",
160 "customerId222": "",
161 "customParent1111": "",
162 "customParent111": "",
163 "another": "",
164 "xyz": "",
165 "test12": "",
166 "customerID": ""
167 }
168 },
169 "splitFundingInstructions": null,
170 "cfeeTransactions": [
171 {
172 "cFeeTransId": "399-27260fccd280436790115892634be7c4",
173 "transStatus": 1,
174 "feeAmount": 55.50,
175 "settlementStatus": 0,
176 "operation": "Sale",
177 "responseData": {
178 "response": null,
179 "responsetext": null,
180 "authcode": null,
181 "transactionid": null,
182 "avsresponse": null,
183 "avsresponse_text": null,
184 "cvvresponse": null,
185 "cvvresponse_text": null,
186 "orderid": null,
187 "type": null,
188 "response_code": null,
189 "response_code_text": null,
190 "customer_vault_id": null,
191 "emv_auth_response_data": null,
192 "additional_response_text": null,
193 "processor_batch_id": null
194 },
195 "refundId": 0,
196 "transactionTime": "2025-10-02T20:51:03.261",
197 "gatewayTransId": null,
198 "transactionEvents": [
199 {
200 "transEvent": "Approved",
201 "eventData": null,
202 "eventTime": "2025-10-02T20:51:03.3289869"
203 }
204 ]
205 }
206 ],
207 "transactionEvents": [
208 {
209 "transEvent": "Created",
210 "eventData": "0HNG14G6KL5LG:00000001",
211 "eventTime": "2025-10-02T20:50:59.848292"
212 },
213 {
214 "transEvent": "Approved",
215 "eventData": "0HNG14G6KL5LG:00000001",
216 "eventTime": "2025-10-02T20:51:03.32107"
217 }
218 ],
219 "pendingFeeAmount": 166.50,
220 "riskFlagged": false,
221 "riskFlaggedOn": "2025-10-02T20:50:59.8361551",
222 "riskStatus": "PASSED",
223 "riskReason": "",
224 "riskAction": "",
225 "riskActionCode": 0,
226 "deviceId": "",
227 "achSecCode": "",
228 "achHolderType": "",
229 "ipAddress": "47.195.66.238",
230 "isSameDayACH": false,
231 "walletType": null
232 },
233 "authCode": "VTLMC1",
234 "referenceId": "399-27260fccd280436790115892634be7c4",
235 "resultCode": 1,
236 "resultText": "Approved",
237 "avsResponseText": "No Match, No address or ZIP match",
238 "cvvResponseText": "CVV2/CVC2 match",
239 "customerId": 4119,
240 "methodReferenceId": null
241 }
242 }

If the payment is declined, the responseText reads Declined, and resultText contains the reason for the decline.

Decline example
1 {
2 "isSuccess": false,
3 "responseData": {
4 "AuthCode": "null",
5 "avsResponseText": "No address or ZIP match only",
6 "CustomerId": 4440,
7 "cvvResponseText": "CVV2/CVC2 no match",
8 "ReferenceId": "45-erre-324",
9 "ResultCode": 1,
10 "ResultText": "200: Transaction was declined by processor.. DECLINE"
11 },
12 "responseText": "Declined"
13 }
You can use the DeclinedPayment notification to get alerts for declined transactions, including both declined credit cards and declined ACH transactions. See Notifications and Webhooks Overview for more.

Next steps

You can view transactions in the UI in your PayHub or PartnerHub account, or you can get lists of transactions via the API for paypoints or organizations