Skip to main content
Vindicia Knowledge Center

Create a Payment Method

Create a Payment Method

Creates a new paymentmethod object without association to a specific Account or Subscription or Transaction.

Generally the same behavior will be experienced when creating a paymentmethod as part of creating or updating a containing object (Account, Subscription, Transaction).

For PayPal and other customer-approval-required payment methods the initial definition of the payment method typically requires a redirect/approval sequence to get a persistant Billing Agreement Identifier (aka BAID) with which the payment method can be used subsequently in the same manner as Credit Cards.

PayPal Merchants For more details on using PayPal for One-Time and Recurring transactions, see the CashBox Programming Guide (Section 5.6 Using PayPal for Recurring Billing) or request the “Using CashBox with PayPal” white paper, available from Vindicia Client Services.

Route (URL) Parameters

None.

Query Parameters

None.

Accepts

JSON A full paymentmethod object with paymentmethod Type sub-object detail.

Returns

JSON A full paymentmethod object with paymentmethod Type sub-object detail.

  • cURL
  • Java
Example Request
curl -X POST \
-u acaff38d462f9430d5cbcbaf:a575771fc679b9de \
-d '{
    "object": "PaymentMethod",
    "id": "paym_1234",
    "type": "CreditCard",

    "credit_card": {
        "object": "CreditCard",
        "account": "341111111111111",
        "expiration_date": "201805"
        },

    "account_holder": "Charles X. Brown",
    "billing_address": {
        "object": "Address",
        "name": "Charlie Brown",
        "line1": "123 Main Street",
        "city": "San Francisco",
        "district": "CA",
        "postal_code": "94105",
        "country": "US",
        "phone": "415-555-3212"
        },

    "customer_specified_type": "Personal Amex",
    "primary": true,
    "policy": {
        "min_chargeback_probability": 100,
        "validate": 1
    }
}' "https://api.prodtest.vindicia.com/payment_methods"
The above command returns JSON structured like this:
{
    "object": "PaymentMethod",
    "id": "paym_1235",
    "vid": "97b0915f6e65614462fdee6ffbc8385f3308188f",
    "created": "2016-05-24T17:41:29-07:00",
    "type": "CreditCard",
    "credit_card": {
        "object": "CreditCard",
        "vid": "0f0c86caef22b95b80f430cd4f8fc2df52a03f97",
        "account": "422277XXXXXX9507",
        "bin": "422277",
        "last_digits": "9507",
        "account_length": 16,
        "expiration_date": "201805"
        },
    "account_holder": "Sally W. Brown",
    "billing_address": {
        "object": "Address",
        "vid": "2eec375cdf13cd4998346796995099146448a651",
        "name": "Sally Brown",
        "line1": "123 Main Street",
        "city": "San Francisco",
        "district": "CA",
        "postal_code": "94105",
        "country": "US",
        "phone": "415-555-3212"
        },
    "customer_specified_type": "VI",
    "primary": true,
    "active": true
}
import com.vindicia.client.CashBox;
CashBox.apiKey = "acaff38d462f9430d5cbcbaf:a575771fc679b9de";
Map<string,> params = new HashMap<string,>();
params.put("name",  "Charlie Brown");
params.put("email", "charlie.brown@peanuts.com");
params.put("id",    "paymm_1234");
PaymentMethod.create(params);
The above command returns JSON structured like this:
{
    "object": "PaymentMethod",
    "id": "paym_1235",
    "vid": "97b0915f6e65614462fdee6ffbc8385f3308188f",
    "created": "2016-05-24T17:41:29-07:00",
    "type": "CreditCard",
    "credit_card": {
        "object": "CreditCard",
        "vid": "0f0c86caef22b95b80f430cd4f8fc2df52a03f97",
        "account": "422277XXXXXX9507",
        "bin": "422277",
        "last_digits": "9507",
        "account_length": 16,
        "expiration_date": "201805"
        },
    "account_holder": "Sally W. Brown",
    "billing_address": {
        "object": "Address",
        "vid": "2eec375cdf13cd4998346796995099146448a651",
        "name": "Sally Brown",
        "line1": "123 Main Street",
        "city": "San Francisco",
        "district": "CA",
        "postal_code": "94105",
        "country": "US",
        "phone": "415-555-3212"
        },
    "customer_specified_type": "VI",
    "primary": true,
    "active": true
}

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top