Payment transaction is a combination of authorization and capture processed at a time. This transaction type is generally used when the goods or services can be immediately provided to the customer.
Request
To make a payment transaction, send a POST request to https://api.ecomcharge.com/beyag/transactions/payments with the following parameters:
object
amount
required
integer A transaction amount in minimal currency units, for example $32.45 must be sent as 3245.
currency
required
string A transaction currency in the ISO-4217 alpha-3 code format. For example, USD.
description
required
string(255) A short description of the order.
test
boolean Set to true for a test transaction. Otherwise, false, used by default.
expired_at
string Time that the order expires at. Set in the ISO-8601 format: YYYY-MM-DDThh:mm:ssTZD, where YYYY – year (for example 2019), MM – month (for example 02), DD – day (for example 09), hh – hours (for example 18), mm – minutes (for example 20), ss – seconds (for example 45), TZD – time zone (+hh:mm or –hh:mm). If payment is not made before this time, the payment gets the expired status. By default, infinite.
tracking_id
string An internal payment identifier (an order number or a customer number). The parameter can be used to find the payment in notifications. Can be multiple values separated with semicolons. For example, "cbe59142-90af-4aea-b5a5-5bf3f66cf3da;f7883cb9-0e26-43a7-beb7-4027cb55d1a6;4a6a89d5-6950-400f". If multiple values are sent in the request, the transaction search in the back office system can be performed by any of them.
ip
string The customer's IP address.
language
string A language of the checkout page shown to the customer to complete the payment.
If the parameter is set and transaction notification emails are enabled, eComCharge will dispatch those emails in the language locale. English (en) is set by default. Possible values of language parameter.
notification_url
string A URL to get webhook notifications. If the URL is not set, no notifications are sent out.
verification_url
string A URL where a transaction verification request is posted to. The verification request format matches a transaction response format.
return_url
required
string A URL to return the customer to when a transaction is completed.
iframe
boolean Set to true if you open payment options at your site in iFrame. An external payment method system will try to return iFrame matched layout.
conditionally required
object A section of the customer information. Check the description of the alternative payment method to see if any of the section parameters are required.
first_name
string (60) The customer's first name.
last_name
string (60) The customer's last name.
middle_name
string (60) The customer's middle name.
email
string The customer's email.
country
string The customer's billing country in the ISO 3166-1 Alpha-2 format.
state
string (40) The customer's billing state.
city
string (120) The customer's billing city.
zip
string (40) The customer's billing ZIP or postal code. If country=US, zip format must be NNNNN or NNNNN-NNNN.
address
string (510) The customer's billing address.
phone
string (200) The customer's phone number.
birth_date
string The customer's date of birth in the ISO 8601 format (YYYY-MM-DD).
gender
string Possible values: male or female.
device_id
string The customer's device ID.
taxpayer_id
string The customer's taxpayer ID.
id_number
string The customer's identification document number.
external_id
string (255) The customer's identifier in the merchant's system.
object A section of the payment method parameters.
The set of required parameters in this section depends on the payment method that you plan to use.
type
required
string A payment method type or payment method name supported by the payment method.
token
string A payment method token which has been obtained earlier from a transaction response.
object A section of additional transaction parameters.
The set of required parameters in this section depends on the payment method that you plan to use.
contract
array An array, consisting of elements:
recurring - eComCharge returns a payment method token to use for subsequent charges. The customer will not need to re-enter payment method details again.
receipt_text
array A text that will be added to an email sent to the customer. Submit as an array of strings, for example ["First line", "Second line"].
object A section of additional information about the customer.
string The customer's ID. Check the description of the alternative payment method to see what value you should submit here.
object A section of the customer's browser parameters.
user_agent
conditionally required
string User agent string for the browser. Equals the navigator.userAgent parameter of JavaScript. Refer to the description of the alternative payment method to check if the parameter is required.
If payment request accepted successfully response will contain a JSON message with set of fields. After finishing payment the same message will send as a notification to the URL from notification_url. Received JSON message (response) has the only key transaction with the object as follows:
Pay attention that there are no input elements in the response for submitting form (<input type="submit" name="submit" value="Pay">). You need to add this input by yourself according to design and language preferences of your site.