Direct API payments

Submit eCheck and card not present payments by sending a POST request to the /txns endpoint of the Payrix API.

The Payrix API supports card and eCheck payments using a new or stored payment method. The same request can also tokenize a new payment method for future use.

This page provides details about using the /txns endpoint to submit card and eCheck payments. See the Payrix API reference for a complete definition of the /txns resource.

You must be PCI certified to submit card transactions directly via the API. Your application will need to handle protected customer and payment method data.

Note: Canadian Merchants will have different field parameter valid values than US, and currency type will auto default to CAD. All other parameter fields remain the same. See more details within each expand below.

Card Payments

To submit a card payment using the API, send a POST request to the /txns endpoint with the payment details in the body of the request. The examples below show request bodies for the following use cases:

  • New Card - Submit a transaction by sending the payment card details.

  • Saved Card - Submit a transaction using a previously stored payment token.

  • New Card + Tokenization - Submit a transaction by sending payment card details and create a new payment token.

Visit the Payrix API reference for additional details.

The examples below show the fields required by the API. Depending on your portfolio’s AVS and Risk settings, additional information (e.g. cardholder’s address) may be necessary for payment approval. Payrix recommends submitting all of the optional fields to increase the chances that the transaction will be approved. See the Payrix API reference for details about the optional fields.

New Card Payment

The example below shows a sample request body for card payment using a new payment method:

{ "merchant": "t1_mer_59efbf4e69b27a4760b885d", "type": "1", "origin": "2", "payment": { "number": "4242424242424242", "cvv": "123", "expiration": "1020" }, "total": "10000" }

Stored Card Payment

The example below shows a sample request body for card payment using a stored token as the payment method:

{ "merchant": "t1_mer_59efbf4e69b27a4760b885d", "type": "1", "origin": "2", "token": "b73443457d0202be0489fed2b5687f81", "total": "10000" }

New Card Payment with Tokenization

The example below shows a sample request body for card payment using a new card as the payment method. The request will create and save a token for the payment method:

{ "merchant": "t1_mer_59efbf4e69b27a4760b885d", "type": "1", "origin": "2", "token": { "payment": { "number": "4242424242424242", "cvv": "123", "expiration": "1020" }, "customer": {} }, "total": "10000" }

eCheck Payments

To submit an eCheck payment using the API, send a POST request to the /txns endpoint with the payment details in the body of the request. equest bodies for the following use cases:

  • New eCheck - Submit a transaction by sending the account details.

  • Saved eCheck - Submit a transaction using previously saved account details.

  • New Card + Tokenization - Submit a transaction by sending new account details and create a new payment token.

The Payrix API reference includes additional details about optional fields and accepted values.

The eCheck payment documentation includes additional details about Payrix’s eCheck support.

New eCheck Payment

The example below shows a sample request body for submitting an eCheck payment using a new account:

Saved eCheck Payment

The example below shows a sample request body for submitting an eCheck payment using a saved account:

New eCheck Payment with Tokenization

The example below shows a sample request body for submitting an eCheck payment using a new account and creating a new token:

Â