Skip to main content

Make a Payment

A payment charges a stored payment account through your gateway and applies the money to the customer's balance. You need four values: customerId, paymentMethodId, paymentAccountId, and amount.

There is no one-time-charge endpoint. To charge a new card, store it first (Paya or TRX), then pay with its paymentAccountId.

1. Pick the payment method​

curl "https://api.psarev.io/billing/api/v1/payment-methods?CustomerId=123" \
-H "Authorization: Bearer $TOKEN"
[
{ "paymentMethodId": 2, "description": "Credit Card", "isCc": true, "isAch": false, "feeAmount": 3.0, "feeType": "Percentage", "feeDesc": "Convenience fee" },
{ "paymentMethodId": 3, "description": "ACH", "isCc": false, "isAch": true, "feeAmount": 0.0, "feeType": "Flat_Rate", "feeDesc": "" }
]

Pass CustomerId so the list only includes methods the customer's processors support. Use feeAmount and feeType to show any convenience fee. Rev.io adds the fee as a separate charge when the payment posts. The Rev.io web app hides the fee when the stored card is a debit card (card.isDebit).

Methods with neither flag set, such as Check or Cash, record an offline payment and need no payment account.

Reference: Get Payment Methods

2. Pick the payment account​

curl "https://api.psarev.io/billing/api/v1/payment-accounts/123" \
-H "Authorization: Bearer $TOKEN"

Choose an id whose method matches the payment method: CreditCard for an isCc method, ACH for an isAch method.

Reference: Get Payment Accounts

3. Optional: find what to pay​

4. Create the payment​

curl -X POST https://api.psarev.io/billing/api/v1/payments \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerId": 123,
"paymentMethodId": 2,
"paymentAccountId": 4570,
"amount": 150.00,
"referenceNumber": "ORDER-10042",
"receivedDate": "2026-10-05T14:30:00Z",
"invoiceId": 98765
}'
{ "paymentId": 55123 }

The card is charged during this call. If the gateway declines, the response is 500 with the gateway's message in detail and nothing is recorded. Validation problems come back as 400 with field-keyed errors.

Choosing how the payment is applied​

SendResult
invoiceIdApplied to that one invoice.
invoiceApplications: [{ "invoiceId", "amount" }]Split across several invoices.
transactionApplications: [{ "transactionId", "amount" }]Split across specific charges.
None of the aboveRev.io applies it to the customer's open balance.

Send only one of invoiceId, invoiceApplications, or transactionApplications. Each amount must be greater than zero.

Rules​

  • paymentAccountId is required for card and ACH methods, must belong to the customer, and must match the method type.
  • invoiceId must belong to the customer.
  • referenceNumber should be unique per attempt (your order or receipt number). Rev.io rejects a second payment with the same customer, date, amount, and reference. After a successful gateway charge, Rev.io stores the gateway transaction ID as the payment's reference number.
  • receivedDate is ISO 8601. The Rev.io web app always sends it.

Reference: Create Payment

5. Check the result​

curl "https://api.psarev.io/billing/api/v1/payments/55123" \
-H "Authorization: Bearer $TOKEN"

The response includes authCode, amount, referenceNumber, and the canRefund and canVoid flags you can use to enable those actions in your UI.

Reference: Get Payment

Refund or void​

  • Void a card payment that has not settled yet: POST /billing/api/v1/payments/{id}/void. Void Payment
  • Refund a settled payment: POST /billing/api/v1/payments/{id}/refund with { "amount": 0 } for a full refund or a smaller amount for a partial one. Refund Payment

Next step​

Set the card or bank account to pay automatically with Autopay.