Credit Card Account Number Update

Update a Credit Card

Update a user’s credit card record with an accurate full account number.


Overview

This API allows partners to update an existing credit card record for a user by providing the full credit card account number (digits only).


Endpoint

🚧 Secure API URLs

When calling this endpoint be sure to use the secure url (https://secure-api.spinwheel.io and https://secure-sandbox-api.spinwheel.io)

PATCH https://secure-sandbox-api.spinwheel.io/v1/users/{userId}/creditCards/{creditCardId}


Path Parameters

ParameterTypeRequiredDescription
userIdstringYesSpinwheel userId used to identify a user (one of userId or extUserId is required).
creditCardIdstringYesSpinwheel credit card ID associated with the user.

Request Body

Body Parameters

ParameterTypeRequiredDescription
cardProfileobjectYesContainer for card profile fields.

cardProfile Object

FieldTypeRequiredDescription
accountNumberstringYesFull credit card account number (digits only).

Rules

  • accountNumber must contain digits only (0-9).
  • Provide the full account number (no spaces or dashes).

Headers

HeaderRequiredExample
AuthorizationYesAuthorization: Bearer <token>
AcceptRecommendedaccept: application/json
Content-TypeYescontent-type: application/json

Example (cURL)

curl --request PATCH \
     --url https://sandbox-api.spinwheel.io/v1/users/testUser123/creditCards/testCreditCard123 \
     --header 'Authorization: bearer123' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "cardProfile": {
    "accountNumber": "4111111111111111"
  }
}
'

 

Responses

This will be a full credit card response on a successful 200, inclusive of both the creditCardNumberMasked and the accountNumber

Example Successful Response

{
  "status": {
    "code": 200,
    "desc": "success"
  },
  "data": {
    "creditCardId": "7025c075-e92d-46fa-85e5-ac31ca667079",
    "userId": "3fef7131-71ae-4204-a8bd-3fc3ad6b4b82",
    "displayName": "TD Bank",
    "logoUrl": "https://cdn.spinwheel.io/images/logo/ebd6dab9-4558-40c4-8c21-65070a07df5a.png",
    "cardProfile": {
      "ecoaCode": "I",
      "creditCardNumberMasked": "411111******1111",//key attribute
      "accountNumber": "4111111111111111",//key attribute
      "accountOriginationDate": "2018-07-04T00:00:00.000Z",
      "status": "OPEN",
      "accountRating": "1",
      "creditLimit": 10000,
      "creditUtilization": 70,
      "liabilitySubtype": "CreditCard",
      "debtType": "UNSECURED",
      "closedDateWithFormat": {
        "value": "2016-07",
        "format": "YYYY-MM"
      },
      "availableCreditDerived": 3000,
      "accountOwnershipType": "INDIVIDUAL",
      "termsFrequency": "MONTHLY",
      "reviewedInMonths": 25,
      "reportedDateWithFormat": {
        "value": "2023-02-14",
        "format": "YYYY-MM-DD"
      },
      "lastActivityDateWithFormat": {
        "value": "2023-01-14",
        "format": "YYYY-MM-DD"
      },
      "accountType": "REVOLVING",
      "consumerDisputeStatus": "NOT_DISPUTED",
      "derogatoryDataStatus": "NOT_DEROGATORY",
      "collectionStatus": "NOT_IN_COLLECTION",
      "chargeOffStatus": "NOT_CHARGED_OFF",
      "accountTypeCode": "R",
      "limitType": "REGULAR",
      "highestAdverseRating": "H",
      "highestAdverseRatingDateWithFormat": {
        "value": "2022-11",
        "format": "YYYY-MM"
      },
      "mostRecentAdverseRating": "1",
      "mostRecentAdverseRatingDateWithFormat": {
        "value": "2022-12",
        "format": "YYYY-MM"
      },
      "secondMostRecentAdverseRating": "H",
      "secondMostRecentAdverseRatingDateWithFormat": {
        "value": "2022-11",
        "format": "YYYY-MM"
      },
      "adverseRatingCount": 4,
      "paymentHistory": {
        "lastAssessedStatementDate": "2023-01-14",
        "details": [
          {
            "date": "2023-01-14",
            "description": "The account is current",
            "code": "0"
          },
          {
            "date": "2022-12-14",
            "description": "The account has been late for 1 billing cycle",
            "code": "1"
          },
          {
            "date": "2022-11-14",
            "description": "The account is in foreclosure",
            "code": "H"
          },
          {
            "date": "2022-10-14",
            "description": "The account is in collections",
            "code": "G"
          },
          {
            "date": "2022-09-14",
            "description": "The account was voluntarily surrendered",
            "code": "J"
          },
          {
            "date": "2022-08-14",
            "description": "No data available for this period",
            "code": "D"
          }
        ]
      }
    },
    "balanceDetails": {
      "outstandingBalance": 7000,
      "updatedOn": 1597753517524
    },
    "statementSummary": {
      "statementBalance": 3194,
      "minimumPaymentAmount": 101,
      "dueDate": "2021-09-08T00:00:00.000Z",
      "lastPaymentAmount": 400,
      "lastPaymentDateWithFormat": {
        "value": "2021-08-21",
        "format": "YYYY-MM-DD"
      },
      "statementDateWithFormat": {
        "value": "2021-08-08",
        "format": "YYYY-MM-DD"
      },
      "overduePeriod": "NOT_OVERDUE",
      "amountPastDue": 700,
      "refreshedFields": {
        "lastPaymentDate": {
          "value": "2021-08-21",
          "format": "YYYY-MM-DD",
          "updatedOn": 1643917894780
        },
        "dueDay": {
          "value": "08",
          "format": "DD",
          "updatedOn": 1643917894780
        },
        "lastPaymentAmount": {
          "value": 400,
          "updatedOn": 1643917894780
        }
      }
    },
    "aprs": [
      {
        "rate": 31.24,
        "type": "PURCHASE",
        "applicableBalance": 6712,
        "expirationDate": "2021-10-31",
        "updatedOn": 1597753517524
      },
      {
        "rate": 31.24,
        "type": "CASH_ADVANCE",
        "applicableBalance": 88,
        "expirationDate": "2021-10-31",
        "updatedOn": 1597753517524
      }
    ],
    "creditor": {
      "originalName": "TD BANK",
      "industryType": "SalesFinancing",
      "industryCode": "FF",
      "phoneNumber": "8663968254",
      "bureauSubscriberCode": "401BB00573",
      "address": {
        "addressLine1": "C/O P.O. BOX 965036",
        "city": "ORLANDO",
        "state": "FL",
        "zip": "32896",
        "zipExtension": "5036"
      }
    },
    "capabilities": {
      "data": {
        "realtimeBalance": {
          "availability": "SUPPORTED"
        },
        "statementSummary": {
          "availability": "SUPPORTED"
        }
      },
      "payments": {
        "billPayment": {
          "availability": "SUPPORTED"
        }
      }
    },
    "createdOn": 1597317116353,
    "updatedOn": 1597753517524
  }
}
{
  "status": {
    "code": 400,
    "desc": "Bad request"
  }
}
{
  "status": {
    "code": 401,
    "desc": "Invalid private key"
  }
}
{
  "status": {
    "code": 404,
    "desc": "Resource not found"
  }
}
{
  "status": {
    "code": 500,
    "desc": "Internal server error"
  }
}

Example Error Responses

{
    "status": {
        "code": 404,
        "desc": "CREDIT_CARD_NOT_FOUND",
        "messages": [
            {
                "desc": "Credit card [creditCardId=9871cd54-d525-411e-aebf-63f847e494cc] not found."
            }
        ]
    }
}
{
    "status": {
        "code": 400,
        "desc": "Bad Request",
        "messages": [
            {
                "desc": "cardProfile.accountNumber should not be empty",
                "type": "ERROR"
            }
        ]
    }
}
{
    "status": {
        "code": 400,
        "desc": "Bad Request",
        "messages": [
            {
                "desc": "cardProfile.accountNumber must be a number string with at least 6 digits",
                "type": "ERROR"
            }
        ]
    }
}
{
    "status": {
        "code": 500,
        "desc": "REQUEST_FAILED",
        "messages": [
            {
                "desc": "Unable to update credit card [creditCardId=9871cd54-d525-411e-aebf-63f847e494cd] belonging to user [userId=c256e1f4-bea4-45af-a478-f9bdec1a6300]. Please contact Spinwheel support."
            }
        ]
    }
}