Skip to content

Sale/Auth Transaction

Process a transaction through the gateway.

Request Method: POST

URL Endpoint: /api/transaction

TIP

If you do not have a default processor set, you must include the processor_id property in the request body or the transaction will fail.

Field Notes

Amount - This will be the final amount you want charged and will include all surcharges and related fees(if applicable).

Base Amount - If you are using base_amount it will be the base amount of the transaction. The surcharge and other related fees(if applicable) will be calculated and added unless those values are specifically passed in.

Basic

These are the core fields needed for most transactions.

NameTypeDefaultRequiredDescription
typestringRequired"sale", "authorize", "verification" or "credit"
amountintegerRequiredAmount to process in cents (should contain all applicable fees and taxes) (1299 = $12.99)
currencystring"USD"ISO 4217 currency (ex "USD")
processor_idstring""see descriptionProcessor to be used for the requested transaction. If not passed, will use the default processor for the payment method.
payment_methodobjectRequired - one payment methodObject containing payment method details, must contain only one of the following: card, ach, customer, terminal, token, apm, apple_pay_token

Details

Additional fields for order tracking and transaction metadata.

NameTypeDefaultRequiredDescription
order_idstringRequired for L3Supports up to 17 alphanumeric characters. If paid with invoice, invoice id will be populated. See docs here.
po_numberstringSupports up to 17 alphanumeric characters. If paid with invoice, invoice id will be populated. See docs here.
descriptionstring""Text field for miscellaneous notes (max 255 characters)
ip_addressstringServer IPIPv4 or IPv6 value of the end user. Do not include port
vendor_idstring""Vendor ID passed along to certain processors if supported (Special Field, only use if instructed by support)

Idempotency Key

Prevent duplicate transactions using idempotency keys.

NameTypeDefaultRequiredDescription
idempotency_keyuintUUID format. Used to identify duplicate transactions. If idempotency_time is not provided, the TTL will default to 5 minutes
idempotency_timeuint300Time in seconds. Default is 5 minutes

Payment Methods

All payment method fields are nested within the payment_method object. See the examples below for the JSON structure.

Card

The most common payment method. Process transactions using debit or credit card information.

NameTypeDefaultRequiredDescription
cardobjectObject containing details for processing a transaction against a card
card.entry_typestringMust be "keyed" or "swiped"
card.numberstringRequiredCard number (digits only)
card.expiration_datestringRequiredExpiration date (format MM/YY)
card.cvcstringrequired if the applicable rule is set on the gatewayCard Verification Code
card.track_1stringDecrypted track_1
card.track_2stringDecrypted track_2
card.encrypted_track_1stringEncrypted Track 1
card.encrypted_track_2stringEncrypted Track 2
card.ksnstringKSN used to encrypt the supplied encrypted tracks
card.cardholder_authenticationobjectif passed, it must contain valid valuesOptionally pass 3DS collected data
card.cardholder_authentication.ecistringECI indicator, ie 01,02,05,07..etc
card.cardholder_authentication.cavvstringCAVV
card.cardholder_authentication.xidstringXID
card.cardholder_authentication.cryptogramstringCryptogram
card.cardholder_authentication.versionstringVersion, 1 or 2
card.cardholder_authentication.ds_transaction_idstringDS Transaction ID
card.cardholder_authentication.acs_transaction_idstringACS Transaction ID
emvobjectObject containing details for processing EMV transactions
emv.tlv_datamap[string]stringmap containing the EMV tlv packets. These must be hex encoded strings
emv.device_serial_numberstringString containing the device serial number.

Basic Card Example

Card with 3DS Authentication Example

Customer

Process a transaction using a payment method stored in the Customer Vault.

NameTypeDefaultRequiredDescription
customerobjectObject containing details for processing against a vaulted customer record
customer.idstringRequiredUsed to associate a transaction with a customer already stored in the Customer Vault
customer.payment_method_idstringCustomer defaultID of customer's saved payment method to be charged
customer.payment_method_typestringCustomer defaultThe type of the payment method referenced in payment_method_id
customer.billing_address_idstringCustomer defaultID of customer's saved billing address to be used
customer.shipping_address_idstringCustomer defaultID of customer's saved shipping address to be used

Token

Process a transaction using a previously tokenized payment method. See Tokenizer for more information on tokenizing payment methods.

NameTypeDefaultRequiredDescription
tokenstringRequiredToken value for a previously tokenized payment

Apple Pay

Process transactions using Apple Pay. Two methods are supported: Wallet.js (temporary token) and native ApplePay.js/Payment Request API (pkpaymenttoken).

NameTypeDefaultRequiredDescription
apple_pay_tokenobjectObject containing details for processing Apple Pay transactions
apple_pay_token.temporary_tokenstringrequired if using Wallet.js, should not be present if using native ApplePay.js or Payment Request APIA one-time token when processing Apple Pay transactions using Wallet.js
apple_pay_token.key_idstringrequired if apple_pay_token is presentThe ID of the registered Apple Pay credential, not Apple's Merchant ID.
apple_pay_token.pkpaymenttokenobjectrequired if using ApplePay.js or Payment Request APIObject containing encrypted data of a credit card tokenized with Apple Pay, getting from Apple Pay client

Apple Pay (Apple Pay JS)

Apple Pay (Wallet.js)

Apple Pay Decrypted

ACH

Process transactions via Automated Clearing House (ACH) for bank account debits.

NameTypeDefaultRequiredDescription
achobjectObject containing details for processing a transaction via ACH
ach.routing_numberstringRequiredRouting number for account to be charged
ach.account_numberstringRequiredAccount number for account to be charged
ach.sec_codestringRequiredSEC code for ACH transaction type: "web", "ccd", "ppd", or "tel"
ach.account_typestringRequiredACH account type: "checking" or "savings"
ach.check_numberstringrequired if ach.sec_code = "tel"Check number
ach.funding_speedstring"standard""standard" or "sameday"Funding Speed, available on select ACH Providers.
ach.accountholder_authenticationobjectif required by processorObject containing details for accountholder authentication
ach.accountholder_authentication.dl_statestringrequired if ach.accountholder_authentication is presentDriver's License state
ach.accountholder_authentication.dl_numberstringrequired if ach.accountholder_authentication is presentDriver's License number

Terminal

Process transactions using a physical payment terminal device.

NameTypeDefaultRequiredDescription
terminalobjectObject containing details for processing a transaction against a Terminal
terminal.idstringRequiredID of the terminal to be used for the transaction
terminal.expiration_datestringOptionally pass an expiration date along with the transaction
terminal.cvcstringOptionally pass a CVV along with the transaction
terminal.print_receiptstringRequired"no" (no receipt), "customer" (customer copy only), "merchant" (merchant copy only), or "both" (both copies)
terminal.signature_requiredstringRequiredIf true, requests that the terminal capture a signature (if supported)

APM

Process transactions using alternative payment methods (Alternative Payment Methods) like Klarna, OXXO, Alipay, etc.

NameTypeDefaultRequiredDescription
apmobjectObject containing details for processing APM transactions
apm.typestringRequiredAPM type (see chart below)
apm.merchant_redirect_urlstringRequiredThis is the redirect url you wish to send the customer to after processing the payment
apm.localestringRequiredLocale to be used for the payment page, if supported by the APM (ex. "en-US")
apm.mobile_viewbooleanRequiredIf true, tells the APM to render a mobile version of the landing page (if supported by the APM)
apm.national_idstringConsumer's National ID (max 30 characters)
apm.consumer_refstringUnique reference identifiying the customer. May contain [a-z0-9-], max 20 characters

Supported APMs

TypeSupported Processing CountriesSupported Currencies
alipayCNEUR, USD, GBP
dragonpayPHPHP
wechatpayCNEUR, USD
oxxoMXUSD, MXN
klarnaAT, DK, FI, DE, NL, NO, SE, GBEUR, DKK, GBP, NOK, SEK
sepaDEEUR

APM Requirements

See specific APM requirements below for additional required fields per payment method type.

Amounts

Configure transaction pricing components including the total amount, base amount, taxes, shipping, discounts, tips, and payment adjustments (surcharges, convenience fees). Use amount for the final total including all fees, or base_amount to let the system calculate and add applicable fees automatically.

Amount Calculation API

For complex transactions with multiple fees, taxes, discounts, and line items, consider using the Amount Calculation API to automatically calculate all applicable amounts before submitting your transaction. This ensures accurate totals and handles processor-specific fee calculations, surcharges, and tax computations.

NameTypeDefaultRequiredDescription
amountintegerAmount to process in cents (should contain all applicable fees and taxes) (1299 = $12.99)
base_amountintegerAmount to process in cents (surcharge and related fees will be added to this amount during processing) (1299 = $12.99)
tax_amountinteger0Required for L3Tax Amount in cents
tax_exemptbooleanfalseRequired for L3Is the transaction tax exempt
shipping_amountinteger0Shipping Amount in cents (should be included in Amount)
discount_amountinteger0Discount Amount in cents (should be included in Amount)
tip_amountinteger0Tip Amount in cents (should be included in Amount)
payment_adjustmentobjectObject containing payment adjustment details. (ex. convenience fees, service fees, and surcharges)
payment_adjustment.typestring"""flat" or "percentage"
payment_adjustment.valueinteger0Amount of adjustment in cents for "flat" (ex. 199 = $1.99) or 3 decimal places for "percentage" (ex. 1000 = 1.000%)

Amount with Tax and Shipping Example

Amount with Payment Adjustment Example

Addresses

Provide billing and shipping address information for the transaction. Billing addresses are used for AVS (Address Verification System) checks and fraud prevention, while shipping addresses are required for Level 3 data transactions. Both addresses support standard address fields including name, company, street address, city, state, postal code, country, and contact information.

Billing

NameTypeDefaultRequiredDescription
billing_addressobjectnullObject containing billing address details
billing_address.first_namestringUp to 50 characters
billing_address.last_namestringUp to 50 characters
billing_address.companystringUp to 100 characters
billing_address.address_line_1stringUp to 100 characters
billing_address.address_line_2stringUp to 100 characters
billing_address.citystringUp to 50 characters
billing_address.statestringState abbreviation
billing_address.postal_codestringRequired for L3If card is present, defaults to Postal Code associated with card
billing_address.countrystring"US"
billing_address.emailstringEmail address (must be valid email format, "example@mail.com")
billing_address.phonestringDigits only
billing_address.faxstringDigits only

Shipping

NameTypeDefaultRequiredDescription
shipping_addressobjectnullObject containing shipping address details
shipping_address.first_namestringUp to 50 characters
shipping_address.last_namestringUp to 50 characters
shipping_address.companystringUp to 100 characters
shipping_address.address_line_1stringUp to 100 characters
shipping_address.address_line_2stringUp to 100 characters
shipping_address.citystringUp to 50 characters
shipping_address.statestringState abbreviation
shipping_address.postal_codestringRequired for L3
shipping_address.countrystring
shipping_address.emailstringEmail address (must be valid email format, "example@mail.com")
shipping_address.phonestringDigits only
shipping_address.faxstringDigits only

Address Requirements

  • Billing Address: Recommended for card transactions to enable AVS verification and reduce fraud risk. If a card payment method is used, the postal code will default to the card's associated postal code if not provided.
  • Shipping Address: Required for Level 3 data transactions. Both billing and shipping addresses must include postal codes for L3 transactions.

Transaction with Billing and Shipping Addresses Example

Line Items

Itemize products or services in a transaction. Line items provide detailed information about each item being purchased, including pricing, quantities, and product details. This is useful for detailed receipts, reporting, and transaction tracking.

NameTypeRequiredDescription
line_itemsarrayArray of line items
line_items[].namestringFriendly name up to 50 alpha characters
line_items[].descriptionstringProduct Description up to 50 alpha characters
line_items[].product_codestringProduct Code/SKU up to 50 alpha characters
line_items[].quantityfloat64Quantity ##.##
line_items[].unit_priceintUnit price in cents
line_items[].amountintTotal amount for this line item in cents
line_items[].tax_amountintTax amount for this line item in cents
line_items[].discount_amountintDiscount amount for this line item in cents

Custom Fields

Add custom data to transactions for additional tracking and reporting. Custom fields allow you to capture merchant-specific information during transaction processing. You must first create custom fields using the Custom Fields API before you can use them in transactions.

The custom_fields object contains key-value pairs where:

  • Keys are the custom_field_id (the ID of the custom field you created)
  • Values are arrays of strings (even for single values)

Group Name Requirement

If your custom fields have a non-default group_name, you must include the group_name field in your transaction request. Custom fields with the default group name do not require this field.

NameTypeDefaultRequiredDescription
group_namestring"default"Required if custom fields have non-default groupCustom fields group name. Only required when using custom fields that belong to a non-default group.
custom_fieldsobjectOnly required if fields are set to requiredObject where keys are custom_field_id and values are arrays of strings. For more information, see Custom fields with transaction.

Transaction with Custom Fields Example

Processor-Specific

Processor-specific configuration options (PaySafe Direct only).

NameTypeDefaultRequiredDescription
processor_specific.paysafe_direct.subscription_trial_solutionbool
processor_specific.paysafe_direct.subscription_start_datestringYYYY-MM-DD
processor_specific.paysafe_direct.subscription_trial_start_datestringYYYY-MM-DD
processor_specific.paysafe_direct.subscription_trial_end_datestringYYYY-MM-DD
processor_specific.paysafe_direct.subscription_secondary_billing_datestringYYYY-MM-DD
processor_specific.paysafe_direct.subscription_cancel_urlstringweburl
processor_specific.paysafe_direct.subscription_amountuintin cents
processor_specific.paysafe_direct.subscription_unit_costuintin cents
processor_specific.paysafe_direct.subscription_item_quantityuint
processor_specific.paysafe_direct.subscription_product_descstring

Customer Vault

Automatically create or update customer vault records during transaction processing.

NameTypeDefaultRequiredDescription
create_vault_recordbooleanfalseIf true, triggers the creation of a customer vault record after a successful transaction. Multiple transactions with the same details will create duplicative customer records.
create_vault_record_forstringIf true and transaction was run successfully, adds the payment method to the customer id set on this field

Email & Receipts

Send email receipts to customers after transaction processing.

NameTypeDefaultRequiredDescription
email_receiptbooleanfalseIf true, sends an email receipt (email_address must be provided)
email_addressstringrequired if email_receipt is trueEmail address (must be valid email format, "example@mail.com")

Descriptor

Customize the merchant descriptor shown on customer credit and debit card statements. The descriptor is the text that appears on a customer's bank or credit card statement to identify your business and the transaction. This information helps customers recognize charges from your business and reduces confusion, disputes, and chargebacks.

Why Use Custom Descriptors?

  • Reduce Chargebacks: Customers are less likely to dispute transactions they can easily recognize
  • Improve Customer Experience: Clear, recognizable business names build trust and reduce support inquiries
  • Brand Recognition: Use your business name or DBA that customers know to maintain brand consistency
  • Transaction Clarity: Helps customers identify specific purchases when reviewing their statements

Processor-Specific

Descriptor customization is processor-specific and may not be supported by all payment processors. Check with your processor to confirm descriptor support and any additional formatting requirements.

NameTypeDefaultRequiredDescription
descriptorobject
descriptor.namestringMaximum 38 characters
descriptor.addressstringMaximum 38 characters
descriptor.citystringMaximum 21 characters
descriptor.statestringMaximum 2 characters
descriptor.postal_codestringMaximum 5 characters

Transaction with Descriptor Example

Partial Payment

Allow partial transactions to be approved (only if supported by processor).

NameTypeDefaultRequiredDescription
allow_partial_paymentboolfalseAllow partial transactions to be approved (only if supported by processor)

Split Transaction

If your gateway account has our "Split Transaction" feature enabled, using the following example will trigger two independent transactions to run on the same card, using two different processors in the gateway. This is a useful feature when charging something like an application fee.

Important Response Field

split_transaction_response - This field in the response contains information about the secondary transaction that was processed. You can use the id from this field to reference the other transaction if you need to perform operations like refunds, voids, or lookups on the secondary transaction.

NameTypeDefaultRequiredDescription
split_transaction_amountintegerAmount to process in cents as the secondary transaction

L3 Data

Level 3 processing data for enhanced transaction detail reporting. The following fields are required for Level 3 processing.

NameTypeRequiredDescription
line_itemsarrayRequired for L3Array of line items
line_items[].namestringFriendly name up to 50 alpha characters
line_items[].descriptionstringProduct Description up to 50 alpha characters
line_items[].product_codestringProduct Code/SKU up to 50 alpha characters
line_items[].commodity_codestringCommodity Code up to 12 alpha characters
line_items[].quantityfloat64Quantity ##.##
line_items[].discount_amountintin cents
line_items[].freight_amountintin cents
line_items[].unit_priceintin cents
line_items[].tax_amountintin cents
line_items[].national_tax_amountintin cents
line_items[].amountintin cents
line_items[].national_tax_ratestring3 decimal rate. 10% = 10.000
line_items[].tax_ratestring3 decimal rate. 10% = 10.000
line_items[].unit_of_measurestring
summary_commodity_codestringRequired for L3Summary Commodity Code 4 AlphaNumeric characters
ship_from_postal_codestringRequired for L3Ship From Postal Code

CIT/MIT

Card-on-File indicators that specify whether a transaction is using stored payment credentials and who initiated the transaction. These variables are available for including CIT/MIT variables to the processors.

NameTypeDefaultRequiredDescription
card_on_file_indicatornull | stringnullOptional[CR] Optional value, C = General purpose storage, R = recurring payment
initiated_bystring"customer" or "merchant"RequiredWho is initiating the transaction, "customer" or "merchant". Indicates who initiated the transaction.
initial_transaction_idstringOptionalOptional if using our tokenization, otherwise this is transaction id used when storing the payment
stored_credential_indicatorstringOptionalOptional if using our tokenization, otherwise "used" or "stored". Indicates if a stored payment was used or not
billing_methodstring"straight"Optional"straight", "initial_recurring", or "recurring". Defaults to "straight", but if this is a recurring transaction, passing "recurring" will set recurring indicators on the transaction

HSA/FSA

Process Health Savings Account (HSA) and Flexible Spending Account (FSA) transactions.

NameTypeDefaultRequiredDescription
iias_statusstring""Required for HSA/FSA Valid values are: "verified" or "exempt"
additional_amounts.hsa.totalint0Required for HSA/FSA Total amount for HSA/FSA, passed as an unsigned integer
additional_amounts.hsa.rx_amountint0RX Amount for HSA/FSA, passed as an unsigned integer
additional_amounts.hsa.vision_amountint0Vision Amount for HSA/FSA, passed as an unsigned integer
additional_amounts.hsa.clinic_amountint0Clinic Amount for HSA/FSA, passed as an unsigned integer
additional_amounts.hsa.dental_amountint0Dental Amount for HSA/FSA, passed as an unsigned integer

APM Requirements

Additional requirements for specific Alternative Payment Methods.

SEPA

FieldRequired
payment_method.apm.consumer_id
payment_method.apm.iban
payment_method.apm.mandate_referencemerchant assigned value referencing the mandate
payment_method.apm.mandate_url
payment_method.apm.mandate_signature_dateYYYY-MM-DD

Alipay

FieldRequired
payment_method.apm.mobile_view

DragonPay

FieldRequired
billing_address.email
billing_address.phone

WeChatPay

FieldRequired
payment_method.apm.locale

OXXO

FieldDescriptionRequired
payment_method.apm.national_idConsumer's national id (max 30 characters). Not required for OXXO MXN.
payment_method.apm.consumer_refUnique customer reference provided by merchant. (max 20 alphanumeric characters)
payment_method.apm.due_date"YYYY-MM-DD" expiry date for payment voucher. Voucher expires at midnight local Mexico City Time. Only applies to OXXO MXN currency.
billing_address.emailEmail address (must be valid email format, "example@mail.com")
billing_address.address_1
billing_address.postal_code

Klarna

FieldDescriptionRequired
payment_method.apm.payment_method_category"direct_debit", "direct_bank_transfer", "pay_now", "pay_later", or "pay_over_time"
payment_method.apm.purchase_type"buy", "rent", "book", "subscribe", "download", "order", or "continue" (default = "continue")
payment_method.apm.hpp_titleTitle to be used for Hosted Payment Page
payment_method.apm.logo_urlLogo Url to be used on Hosted Payment Page
billing_address
shipping_address
line_items[].name
line_items[].quantity
line_items[].unit_of_measureunit of measure
line_items[].unit_priceunit price
line_items[].amounttotal amount
line_items[].product_codesku/reference
line_items[].local_taxtax amount per item
line_items[].discount_amountdiscount amount as an unsigned integer
tax_amount