Make a sale transaction
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 salepaymentMethod
: Information about the payment methodpaymentDetails
Information about the payment itselfcustomerData
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.
ACH
Stored Method
Cloud
includeDetails=true
This example shows how to include additional details in the response by setting the includeDetails
parameter to true
. This works with any payment method.
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.
Basic success response
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.
includeDetails=true response
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.
Decline response
If the payment is declined, the responseText
reads Declined
, and resultText
contains the reason for the decline.
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