Billing Credentials API v2

REST API for a User's billing credentials. A billing credential is the user's billing address and credit card information. However, only the last 4 digits of the credit card is revealed. OAuth must be setup before making these API calls. See the OAuth 2.0 page for more details.

This REST API supports JSON format.

Request format


Ruby example using OAuth2 and HTTParty retrieving all billing credentials.

  # Retrieve access token from session.  You may have saved it in the DB.
  access_token = session[:access_token]

  api_url = "" + access_token.to_s
  billing_credentails = HTTParty.get(api_url, :options => { :headers => { 'Content-Type' => 'application/json' } }).to_json

Ruby on rails example using HTTParty creating a new billing credential.

  access_token = session[:access_token]

  api_url = "" + access_token.to_s

  billing_credential =,
    :options => {
      :headers => { 'Content-Type' => 'application/json' } },
    :body => {
      :billing_credential => {
        "billing_city"=>"New York",
        "billing_street1"=>"123 fake street",
        "card_number" =>"411111111111111",

REST Actions

Action Description Method URL Parameters
Index Get all billing addresses of the user GET
  • access_token
Show Get a single billing address of the user GET
  • access_token
  • billing_credential_id
Create Create a new billing credential POST
  • access_token
  • billing address object
Delete Delete a billing address DELETE
  • access_token
  • billing_credential_id

Request parameters

Parameter Type Description


URL Param Access token provided through the OAuth service.


URL Param The id of the billing credential.
billing_credentials[card_first_name] Data Param First name of the card holder.
billing_credentials[card_last_name] Data Param Last name of the card holder.
billing_credentials[card_number] Data Param Credit card number.
billing_credentials[card_security_code] Data Param Security code of the credit card.
billing_credentials[billing_first_name] Data Param First name of the billing address registered individual.
billing_credentials[billing_last_name] Data Param Last name of the billing address registered individual.
billing_credentials[billing_phone] Data Param Billing address phone number.
billing_credentials[billing_street1] Data Param Billing street address line 1.
billing_credentials[billing_street2] Data Param Billing street address line 2.
billing_credentials[billing_city] Data Param Billing address city.
billing_credentials[billing_state] Data Param Billing address state.
billing_credentials[billing_postal_code] Data Param Billing address zip code.
billing_credentials[billing_country] Data Param Billing address country.
billing_credentials[billing_email] Data Param Email of the billing address user, if different from current email's user.
billing_credentials[card_exp_month] Data Param Credit card expiration month.
billing_credentials[card_exp_year] Data Param Credit card expiration year.

Example response

All the shipping addresses of the current user.

    "billing_city":"New York",
    "billing_street1":"123 fake street",