Skip to content

create a credit card transaction

posthttps://api.tranzila.com/v1/transaction/credit_card/create

This endpoint can also be used with an express terminal

Transaction Types (txn_type)


  • debit - deducts funds from a user's account to make a payment or transfer money to another account
  • credit - adds funds to a user's account, typically as a result of a refund or deposit
  • verify - Pairs with verify_mode attribute - 3DS supported
    • 2 - j2 - Checks Card
    • 5 - j5 - takes credit limit on the amount specified, The charge itself will be in txn_type - force
    • 6 - initialization transaction for standing order (sto), The charge itself will be with txn_type - sto so make sure to keep this transaction txn_type
  • sto - standing order - regular payment of the same amount that’s paid on a specified date need to be verifed first by txn_type - verify, pass the txn_type you recieved via verify transaction in reference_txn_id
  • cancel - canceling a debit or a credit transaction.
  • reversal - release credit limit - j5 Transaction(verify mode 5)

Prevent Duplicate Transctions - Dcdisable

The prevention solution is based on a unique value sent for a transaction under the parameter DCdisable. Below are the conditions for using the parameter:

dc disable image

  • You must log into the my.tranzila system and go to the "Additional Fields for Transaction" screen, located under the terminal settings menu, and define only field 20 as the field intended for identifying DCdisable - duplicate charge.

  • If it is detected that the unique value in DCdisable has already been used once, no additional charge will be made.

  • The check in our DB will be performed up to 24 hours back, at the parent terminal level.

  • If a transaction fails the first time, no check will be performed for it on DCdisable. We will display the following message if a duplicate transaction is detected: "This payment has already been made, please contact the business" or "This payment has already been paid. Please contact customer service."

  • The customer must pass the DCdisable parameter with a unique value for that transaction.

  • If you have parent and child terminals, you must define the parameter in both the parent and the child.

  • We recommend providing a long and complex unique value (the limit for the value is 254 characters).

visit this page for a code example

In what why the transaction was processed? (pan_entry_mode)


  • 50 - transaction through phone, the card was not present.
  • 51 - written card.
  • 52 - online transaction

installments (payment_plan)


  • 1 - Default, one regular payment
  • 6 - Credit installments - when there is an agreement of the customer with the credit card company you would get the whole sum, but the customer will pay in installments, usually with fees. Minimum 3 payments
  • 8 - regular installments.

goes with the installments_number, first_installment_amount and other_installments_amount attributes.

Code Examples


Required Fields Only

JSON
{
  "terminal_name": "myterminal",
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ]
}

Transaction Types (txn_type)


Debit (Default)

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "debit",
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ]
}

Credit

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "credit",
  "reference_txn_id": 12345,
  "authorization_number":"0587923",
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ]
}

Verify With verify_mode = 2

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "verify",
  "verfiy_mode": 2,
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ]
}

Verify With verify_mode = 5

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "verify",
  "verfiy_mode": 5,
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ]
}

reversal- release credit limit (j5 verfiy_mode=5)

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "reversal",
  "reference_txn_id": 6769,
  "authorization_number": "0000000",
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ]
}

Charge With verify_mode = 5

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "force",
  "reference_txn_id": 6769,
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ]
}

Verify With verify_mode = 6

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "verify",
  "verfiy_mode": 6,
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ]
}

Charge With verify_mode = 6

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "sto",
  "reference_txn_id": 6967,
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ]
}

cancel transaction example

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "cancel",
  "reference_txn_id": 123,
  "authorization_number": "0000000"
}

Dcdisable enabled example

JSON
{
  "terminal_name": "myterminal",
  "txn_type": "sto",
  "reference_txn_id": 6967,
  "expire_month": 7,
  "expire_year": 2025,
  "cvv": 111,
  "card_number": 4580458045804580,
  "items": [
    {
      "name": "Pen",
      "type": "I",
      "unit_price": 10.53,
      "units_number": 1,
    }
  ],
  "user_defined_fields": [
    {
      "name": "DCdisable",
      "value": "your_generated_unique_value"
    }
  ]
}

Request

Headers

X-tranzila-api-request-timestringrequired

Request time sent in Unix format (large integer counting milliseconds from Jan 1 st , 1970 00:00:00

X-tranzila-api-app-keystringrequired

Application public key supplied by Tranzila

X-tranzila-api-noncestringrequired

A 40 bytes NONCE – unique random string generated with any random bytes function

X-tranzila-api-access-tokenstringrequired

hash_hmac using ‘sha256’ on application key with secret + request-time + nonce. hash_hmac is available for all programming languages with samples found here: https://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in- different-languages/

Body

application/json
terminal_nameterminalNamerequired
txn_currency_codestring
Allowed values:ILSUSDEURGPBCADAUDSEKNOKCHFDKKJPY
Example:ILS
txn_typestring
Allowed values:debitcreditverifyforcecancelreversalsto
Example:debit
expire_monthintegerrequired
Allowed values:123456789101112
Example:12
expire_yearintegerrequired
Example:2025
cvvstring
Example:111
card_holder_idstring
Example:25641832
card_numberstringrequired
Example:4580458045804580
payment_planinteger
Allowed values:168
Example:1
installments_numberinteger
Example:1
first_installment_amountnumber
Example:500
other_installments_amountnumber
Example:100
reference_txn_idinteger
Example:6769
clientobject
itemsarray[items-arry]
user_defined_fieldsarray[object]
remarksstring
Example:any transaction level remark
response_languagestring
Allowed values:englishhebrew
Example:english
created_by_userstring
Example:Draco Malfoy
created_by_systemstring
Example:mycrm

Responses

The response can be 200 with an Application error code:

Error CodeDescription
20111Provided token check failure
20112Original transaction not found
21100Transaction index is not equal to original transaction index
21101Provided index was empty
22101Empty authorization number
22100Authorization number is not equal to the transaction value
22103Invalid DCdisable
23002Already Credited this transaction id
23002id 4 - sum is larger than the original debit transaction
23001Original transaction authorization number is invalid.
23001id 1 - Attempting to credit a transaction that has already been canceled
20112An origin transaction index is linked to an uncreditable origin transaction (e.g., rejected or non-existent index) or an attempt to credit a different card than the one originally charged.

Response body

response.json
JSON
1{
2  "error_code": 0,
3  "message": "success",
4  "transaction_result": {
5    "processor_response_code": "000",
6    "transaction_id": 12345,
7    "Responsecvv": "\"2\"",
8    "Responseid": "\"1\"",
9    "auth_number": 587923,
10    "card_type": 1,
11    "card_type_name": "Mastercard",
12    "currency_code": "USD",
13    "expiry_month": 12,
14    "expiry_year": 22,
15    "payment_plan": 1,
16    "token": "f1057849hg8495838",
17    "last_4": "1234",
18    "card_mask": "458021xxxxxx4245",
19    "card_locality": "foreign",
20    "amount": 10,
21    "txn_type": "debit",
22    "tranmode": "A"
23  },
24  "original_request": {}
25}
26
Was this page helpful?