Credit Cards .: Delete

API Reference / v15

Delete a Credit Card

This endpoint deletes a user’s credit card.

Request Endpoint

DELETE /v15/credit_cards/:id

Authorization Required – User Token in Header

Authorization: token user="123456-75489120749..."

cURL Example

curl -X DELETE -H Accept:application/json -H Content-Type:application/json -H 'Authorization:token user="123456-75489120749..."' https://sandbox.thelevelup.com/v15/credit_cards/1546645

Example Response

HTTP/1.1 200 OK

{
  "credit_card": {
    "bin": "401288",
    "description": "Visa ending in 1881",
    "expiration_month": 12,
    "expiration_year": 2020,
    "id": 1546645,
    "last_4": "1881",
    "state": "disabled",
    "type": "Visa",
    "promoted": true,
  }
}

Response Parameters

Key Type Description
bin String The first six digits of the card number.
description String A human-readable description of the credit card.
expiration_month Integer The month in which the card expires.
expiration_year Integer The year in which the card expires.
id Integer The credit card’s ID.
last_4 String The last four characters of the card number.
promoted Boolean Whether the card is the user’s promoted payment instrument.
state String The card’s state. Possible values: “active” — the card is available to be charged, “disabled” — the card may not be charged.
type String The type of card, e.g. Visa, Mastercard

Errors

A credit card with the given ID was not found for the logged in user

HTTP/1.1 404 Not Found

[
  {
    "error": {
      "object": "credit_card",
      "property": "id",
      "code": "not_found",
      "message": "Credit card not found."
    }
  }
]