Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »



Name

Clients / Credit Cards / Create

Description

Create and securely store one or more Credit Cards for an existing Client in a PCI Compliant manner

Type

POST

URL

/v9/clients/:client_id/credit_cards

Credential Type

API


Long Description

Create and securely store one or more Credit Cards for an existing Client in a PCI Compliant manner. Note that this takes an array of credit cards even if only creating one.

To ensure that only valid cards are stored in your Secure Vault, a $1.00 authorization will be made and then immediately voided.

As of January 2024 we are deprecating usage of this endpoint and will be announcing an end of life date soon.

Use the methods Braintree provides such as their Drop-in UI or Hosted Fields to retrieve either a reusable token or a single-use nonce and pass to us in way that does not require sending other credit card information through our API.

Requires Braintree Gateway Integration

In order to store and interact with Client Credit Cards you must ensure your account is set up with the Braintree Gateway which allows storage and handling of credit cards in a PCI Compliant manner utilizing Braintree’s Secure Vault.

Braintree also has extensive documentation for testing credit cards in Sandbox which details how you can use different card numbers and amounts to simulate various scenarios. 

Parameters

Name

Description

Type

Presence

Location

Limitations

client_id

The ID of the specific Client

Integer

Required

URI


label

A label with which one can refer to this card.

String

Optional

Body

20 characters max.

name

Name of the card holder.

String

Required

Body


number

Full credit card number.

String

Required

Body

Numbers only

expiration_month

The 2-digit card expiration month

String

Required

Body


expiration_year

The 4-digit card expiration Year

String

Required

Body


verification_code

3 or 4 digit verification code

String

Optional

Body


address_id

ID of an Address belonging to the Client that is the billing address for this credit card

Integer

Required

Body


phone_number_id

ID of a Phone Number belonging to the Client

Integer

Required

Body


ip_address

Customer's IPv4 address

String

Optional

Body



Examples

Request

Response

POST /v9/clients/168019/credit_cards


Create a single credit card using a phone number and an address that was previously created for this Client.

{
  "credit_cards": [
    {
      "label": "Chase Sapphire Reserve",
      "name": "Ned Flanders",
      "number": "4111111111111111",
      "expiration_month": "12",
      "expiration_year": "2021",
      "verification_code": "789",
      "address_id": 645263,
      "phone_number_id": 294655,
      "ip_address": "37.235.140.72"
    }
  ]
}



{
  "credit_cards": [
    {
      "id": 22528,
      "expiration_month": "12",
      "last_digits": "1111",
      "phone_number": {
        "phone_number": {
          "id": 294655,
          "callable_id": 168019,
          "callable_type": "Client",
          "country_code": "1",
          "number": "5550123",
          "extension": null,
          "label": "home",
          "created_at": "2017-12-15T00:12:21Z",
          "updated_at": "2017-12-15T00:20:56Z",
          "legacy_id": null,
          "imported_filename": null,
          "imported_at": null,
          "deleted_at": null,
          "area_code": null,
          "raw_num": "5550123",
          "is_primary": false
        }
      },
      "primary": false,
      "card_company": "Visa",
      "expiration_year": "21",
      "name": "Ned Flanders",
      "label": "Chase Sapphire Reserve",
      "association": {
        "name": "Ned Flanders",
        "id": 168019,
        "url": "/clients/168019",
        "phone_numbers": [
          {
            "label": "cell",
            "extension": null,
            "number": "555-0573",
            "id": "294657",
            "country_code": "1",
            "primary": false
          },
          {
            "label": "work",
            "extension": "5",
            "number": "555-0987",
            "id": "294656",
            "country_code": "1",
            "primary": false
          },
          {
            "label": "home",
            "extension": null,
            "number": "5550123",
            "id": "294655",
            "country_code": "1",
            "primary": false
          }
        ],
        "email_addresses": []
      },
      "address": {
        "po_box": false,
        "label": "home",
        "country_code": "US",
        "extended_address": null,
        "longitude": null,
        "region": "OR",
        "primary": false,
        "latitude": null,
        "locality": "Springfield",
        "name": "Ned Flanders",
        "postal_code": "97475",
        "id": 645263,
        "street_address": "742 Evergreen Terrace"
      },
      "url": "/clients/168019/credit_cards/22528"
    }
  ]
}


Create a multiple credit cards using phone numbers and addresses that were previously created for this Client.

{
  "credit_cards": [
    {
      "label": "Chase Sapphire Reserve",
      "name": "Ned Flanders",
      "number": "4111111111111111",
      "expiration_month": "12",
      "expiration_year": "2021",
      "verification_code": "789",
      "address_id": 645263,
      "phone_number_id": 294655,
      "ip_address": "37.235.140.72"
    },
    {
      "label": "AmEx Centurion",
      "name": "Ned Flanders",
      "number": "378282246310005",
      "expiration_month": "12",
      "expiration_year": "2021",
      "verification_code": "7809",
      "address_id": 645263,
      "phone_number_id": 294655,
      "ip_address": "37.235.140.72"
    }
  ]
}



{
  "credit_cards": [
    {
      "id": 22530,
      "expiration_month": "12",
      "last_digits": "1111",
      "phone_number": {
        "phone_number": {
          "id": 294655,
          "callable_id": 168019,
          "callable_type": "Client",
          "country_code": "1",
          "number": "5550123",
          "extension": null,
          "label": "home",
          "created_at": "2017-12-15T00:12:21Z",
          "updated_at": "2017-12-15T00:20:56Z",
          "legacy_id": null,
          "imported_filename": null,
          "imported_at": null,
          "deleted_at": null,
          "area_code": null,
          "raw_num": "5550123",
          "is_primary": false
        }
      },
      "primary": false,
      "card_company": "Visa",
      "expiration_year": "21",
      "name": "Ned Flanders",
      "label": "Chase Sapphire Reserve",
      "association": {
        "name": "Ned Flanders",
        "id": 168019,
        "url": "/clients/168019",
        "phone_numbers": [
          {
            "label": "cell",
            "extension": null,
            "number": "555-0573",
            "id": "294657",
            "country_code": "1",
            "primary": true
          },
          {
            "label": "work",
            "extension": "5",
            "number": "555-0987",
            "id": "294656",
            "country_code": "1",
            "primary": false
          },
          {
            "label": "home",
            "extension": null,
            "number": "5550123",
            "id": "294655",
            "country_code": "1",
            "primary": false
          }
        ],
        "email_addresses": []
      },
      "address": {
        "po_box": false,
        "label": "home",
        "country_code": "US",
        "extended_address": null,
        "longitude": null,
        "region": "OR",
        "primary": false,
        "latitude": null,
        "locality": "Springfield",
        "name": "Ned Flanders",
        "postal_code": "97475",
        "id": 645263,
        "street_address": "742 Evergreen Terrace"
      },
      "url": "/clients/168019/credit_cards/22530"
    },
    {
      "id": 22531,
      "expiration_month": "12",
      "last_digits": "0005",
      "phone_number": {
        "phone_number": {
          "id": 294655,
          "callable_id": 168019,
          "callable_type": "Client",
          "country_code": "1",
          "number": "5550123",
          "extension": null,
          "label": "home",
          "created_at": "2017-12-15T00:12:21Z",
          "updated_at": "2017-12-15T00:20:56Z",
          "legacy_id": null,
          "imported_filename": null,
          "imported_at": null,
          "deleted_at": null,
          "area_code": null,
          "raw_num": "5550123",
          "is_primary": false
        }
      },
      "primary": false,
      "card_company": "AMEX",
      "expiration_year": "21",
      "name": "Ned Flanders",
      "label": "AmEx Centurion",
      "association": {
        "name": "Ned Flanders",
        "id": 168019,
        "url": "/clients/168019",
        "phone_numbers": [
          {
            "label": "cell",
            "extension": null,
            "number": "555-0573",
            "id": "294657",
            "country_code": "1",
            "primary": true
          },
          {
            "label": "work",
            "extension": "5",
            "number": "555-0987",
            "id": "294656",
            "country_code": "1",
            "primary": false
          },
          {
            "label": "home",
            "extension": null,
            "number": "5550123",
            "id": "294655",
            "country_code": "1",
            "primary": false
          }
        ],
        "email_addresses": []
      },
      "address": {
        "po_box": false,
        "label": "home",
        "country_code": "US",
        "extended_address": null,
        "longitude": null,
        "region": "OR",
        "primary": false,
        "latitude": null,
        "locality": "Springfield",
        "name": "Ned Flanders",
        "postal_code": "97475",
        "id": 645263,
        "street_address": "742 Evergreen Terrace"
      },
      "url": "/clients/168019/credit_cards/22531"
    }
  ]
}



  • No labels