X-Payments:Payment initialisation request
Request specification
Field | Required | Type | Description |
target | Y | string, 128 | Must equal payment |
action | Y | string, 128 | Must equal init |
confId | Y | integer | Payment module configuration ID |
refId | Y | string, 128 | Order ID in the online store |
returnUrl | Y | URL, 255 | URL of the page to redirect the customer after payment |
callbackUrl | Y | URL, 255 | URL to which X-Payments sends background requests with service information |
language | N | code of ISO 639-1 (Alpha-2) | Language code. If not specified - en |
cart | Y | container | A container with addresses description |
cart/billingAddress | Y | container | A container with the billing address description |
cart/billingAddress/firstname | Y | string, 255 | |
cart/billingAddress/lastname | N | string, 255 | |
cart/billingAddress/company | N | string, 255 | |
cart/billingAddress/address | Y | string, 255 | |
cart/billingAddress/city | Y | string, 255 | |
cart/billingAddress/state | Y | string, 255 | |
cart/billingAddress/country | Y | string, 2 | ISO 3166-1 alpha-2 Country code https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 |
cart/billingAddress/zipcode | Y | string, 32 | |
cart/billingAddress/email | Y | emai, 255l | |
cart/billingAddress/phone | Y | string, 255 | |
cart/billingAddress/fax | N | string, 255 | |
cart/shippingAddress | Y | container | A container with the shipping address description |
cart/shippingAddress/firstname | Y | string, 255 | |
cart/shippingAddress/lastname | N | string, 255 | |
cart/shippingAddress/company | N | string, 255 | |
cart/shippingAddress/address | Y | string, 255 | |
cart/shippingAddress/city | Y | string, 255 | |
cart/shippingAddress/state | Y | string, 255 | |
cart/shippingAddress/country | Y | string, 2 | ISO 3166-1 alpha-2 Country code https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 |
cart/shippingAddress/zipcode | Y | string, 32 | |
cart/shippingAddress/email | Y | email, 255 | |
cart/shippingAddress/phone | Y | string, 255 | |
cart/shippingAddress/fax | N | string, 255 | |
cart/items | Y | container | A container with product description |
cart/items/sku | Y | string, 64 | SKU (product code) |
cart/items/name | Y | string, 255 | Product name |
cart/items/price | Y | currency | Product item price |
cart/items/quantity | N | integer | Ordered number of products. If not specified - 1 |
cart/login | Y | string, 255 | Unique customer ID in the online store (login, username, userid, etc.) |
cart/currency | N | string, 3 | Payment currency code (ISO 4217 Alpha-3). If not specified, default payment configuration currency is used |
cart/shippingCost | - | currency | Shipping cost. By default - 0 |
cart/taxCost | - | currency | Tax amount. By default - 0 |
cart/discount | - | currency | Discount amount. By default - 0 |
cart/totalCost | Y | currency | Total payment amount. Must equal to a sum of cart/items/price * cart/items/quantity + cart/shippingCost + cart/taxCost - cart/discount |
cart/description | - | string, 65536 | |
cart/merchantEmail | Y | email, 255 | |
cart/forceTransactionType | - | one of values: A or S or empty A - authorize S - sale |
A flag of forced Sale or Authorize operation. Overrides the setting from the payment configuration. If the value is empty or the field is omitted, the operation is performed according to the payment configuration settings. |
api_version | Y | string | Must equal one of the following: 1.2, 1.3, 1.4, 1.5 etc. |
template (supported by API 1.3 and later) |
N | string | The name of a template in X-Payments requested by the store. Forces the use of the specified template for the payment. If the string passed in this field does not match any template available in X-Payments, it will be ignored. |
saveCard (supported by API 1.3 and later) |
N | string | Customer's choice at checkout ("Y" if customer would like to save the card) |
cart/kountCustomerUniq (supported by API 1.6 and later) |
N | string, 32 | This field is a unique customer identifier in the Kount system, which is send as a UNIQ field. |
List of template names in X-Payments 2.1.x (API v1.3):
- default: A template for the separate page. Used if the payment form is displayed on a separate page of your checkout process (not iframe).
- fast: Iframe for X-Cart 4 Fast Lane Checkout. Used for X-Cart 4 with the Fast Lane Checkout module. The payment form is displayed at the last step of the checkout process.
- lite: Iframe for X-Cart 4 One Page Checkout. Used for X-Cart 4 with the One Page Checkout module. The payment form is displayed in the payment section at checkout.
- magento_iframe: Iframe for Magento. Use this template for Magento and iframe.
- mobile: Template for mobile devices. Used with the X-Cart Mobile module.
- xc5: Iframe for X-Cart 5. Used for X-Cart 5 and iframe.
Request example
<confId>8</confId> <refId>1120</refId> <cart> <login>customer</login> <billingAddress> <firstname>John</firstname> <lastname>Smith</lastname> <address>10 Main street</address> <city>Fillmore</city> <state>UT</state> <country>US</country> <zipcode>84631</zipcode> <company>IQ testing</company> <email>bit-bucket@x-cart.com</email> <phone>927348572</phone> <fax></fax> </billingAddress> <shippingAddress> <firstname>John</firstname> <lastname>Smith</lastname> <address>10 Main street</address> <city>Fillmore</city> <state>UT</state> <country>US</country> <zipcode>84631</zipcode> <company>IQ testing</company> <email>bit-bucket@x-cart.com</email> <phone>927348572</phone> <fax></fax> </shippingAddress> <items type="cell"> <sku>SKU17513</sku> <name>Three Stone Princess Cut Diamond Ring</name> <price>399.99</price> <quantity>1</quantity> </items> <currency>USD</currency> <shippingCost>15</shippingCost> <taxCost>0</taxCost> <discount>0</discount> <totalCost>414.99</totalCost> <description>Order(s) #1120</description> <merchantEmail>bit-bucket@x-cart.com</merchantEmail> <forceTransactionType></forceTransactionType> </cart> <returnUrl>https://example.com/xcart/payment/cc_xpc.php</returnUrl> <callbackUrl>https://example.com/xcart/payment/cc_xpc.php</callbackUrl> <language>ru</language> <target>payment</target> <action>init</action>
Response specification
Field | Type | Description |
token | string,32 | Temporary payment token, expires immediately after the customer has submitted the cardholder data form |
txnId | string,32 | A unique payment ID. Is used for all further requests to this payment through the API. |
Response example
<data> <token>41b2ef3b34698d4f6ed73151ae7307d2</token> <txnId>e7f398cee98ec062abac0d2c937da181</txnId> <error></error> <error_message></error_message> </data>