Skip to main content
Vindicia Knowledge Center

Create a Transaction (Authorization)

Create a Transaction (Authorization)

Posting with a new Transaction creates a new one-time Transaction object.
* If “to_be_captured” is false, the request will trigger an authorization attempt (based on the provided payment method’s authorization process).
* If you post a new transaction with “to_be_captured” true it will authorize and immediately capture the transaction if successful.

Route (URL) Parameters

None.

Query Parameters

None.

Accepts

JSON A full Transaction object.

Returns

JSON A full Transaction object.

  • cURL
  • Java
Example Request
curl -X POST \
-u acaff38d462f9430d5cbcbaf:a575771fc679b9de \
-d '{
    "object": "Transaction",
    "id": "tx1234",
    "account": {
       "object": "Account",
       "id": "cust_1235"
    },
    "source_payment_method": {
       "object": "PaymentMethod",
       "id": "paym_1235"
    },
    "shipping_address": {
       "object": "Address",
       "name": "c/o Charlie Brown",
       "line1": "123 Main Street",
       "city": "San Francisco",
       "district": "CA",
       "postal_code": "94105",
       "country": "US"
    },
    "items": [
       {
          "object": "TransactionItem",
          "sku": "sku_1234",
          "name": "Widgets",
          "price": 37.95,
          "quantity": 1
       }
    ],
    "source_ip": "63.201.132.182",
    "policy": {
       "min_chargeback_probability": 99,
       "send_email_notification": 0
    },
    "to_be_captured": false
 }' "https://api.prodtest.vindicia.com/transactions"
          
The above command returns JSON structured like this:
{
    "object": "Transaction",
    "id": "tx1234",
    "vid": "5f5d1ba0ac7b0d492026c909211e8f90a6867068",
    "created": "2016-06-02T09:50:57-07:00",
    "amount": 37.95,
    "currency": "USD",
    "account": {`...`},
    "source_payment_method": {`...`},
    "status_log": {
        "object": "List",
        "data": [
            {
                "object": "TransactionStatus",
                "status": "Authorized",
                "created": "2016-06-02T09:50:57-07:00",
                "payment_method_type": "CreditCard",
                "credit_card_status": {
                    "object": "TransactionStatusCreditCard",
                    "auth_code": "T00"
                }
            }
        ],
        "total_count": 1
    },
    "payment_processor_transaction_id": "tx1234",
    "shipping_address": {`...`},
    "items": {
        "object": "List",
        "data": [
            {
                "object": "TransactionItem",
                "sku": "sku_1234",
                "index_number": 1,
                "item_type": "Purchase",
                "name": "Widgets",
                "price": 37.95,
                "quantity": 1,
                "tax_classification": null,
                "tax_type": "Exclusive Sales",
                "subtotal": 37.95,
                "total": 37.95
            },
            {
                "object": "TransactionItem",
                "sku": "Total Tax",
                "index_number": 2,
                "item_type": "Purchase",
                "name": "Total Tax",
                "price": 0,
                "quantity": 1,
                "tax_classification": "TaxExempt",
                "tax_type": "Exclusive Sales",
                "discount": 0,
                "subtotal": 0,
                "total": 0
            }
        ],
        "total_count": 2
    },
    "source_ip": "63.201.132.182",
    "sales_tax_address": {`...`},
    "score": -1,
    "score_codes": {
        "object": "List",
        "data": [],
        "total_count": 0
    }
}
           
import com.vindicia.client.CashBox;
CashBox.apiKey = "acaff38d462f9430d5cbcbafa575771fc679b9de";
Map<string,> params = new HashMap<string,>();
params.put("name",  "Charlie Brown");
params.put("email", "charlie.brown@peanuts.com");
params.put("id",    "pay_1234");
transaction.create(params);
          
The above command returns JSON structured like this:
{
    "object": "Transaction",
    "id": "tx1234",
    "vid": "5f5d1ba0ac7b0d492026c909211e8f90a6867068",
    "created": "2016-06-02T09:50:57-07:00",
    "amount": 37.95,
    "currency": "USD",
    "account": {`...`},
    "source_payment_method": {`...`},
    "status_log": {
        "object": "List",
        "data": [
            {
                "object": "TransactionStatus",
                "status": "Authorized",
                "created": "2016-06-02T09:50:57-07:00",
                "payment_method_type": "CreditCard",
                "credit_card_status": {
                    "object": "TransactionStatusCreditCard",
                    "auth_code": "T00"
                }
            }
        ],
        "total_count": 1
    },
    "payment_processor_transaction_id": "tx1234",
    "shipping_address": {`...`},
    "items": {
        "object": "List",
        "data": [
            {
                "object": "TransactionItem",
                "sku": "sku_1234",
                "index_number": 1,
                "item_type": "Purchase",
                "name": "Widgets",
                "price": 37.95,
                "quantity": 1,
                "tax_classification": null,
                "tax_type": "Exclusive Sales",
                "subtotal": 37.95,
                "total": 37.95
            },
            {
                "object": "TransactionItem",
                "sku": "Total Tax",
                "index_number": 2,
                "item_type": "Purchase",
                "name": "Total Tax",
                "price": 0,
                "quantity": 1,
                "tax_classification": "TaxExempt",
                "tax_type": "Exclusive Sales",
                "discount": 0,
                "subtotal": 0,
                "total": 0
            }
        ],
        "total_count": 2
    },
    "source_ip": "63.201.132.182",
    "sales_tax_address": {`...`},
    "score": -1,
    "score_codes": {
        "object": "List",
        "data": [],
        "total_count": 0
    }
}
          

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top