Skip to content

Update the customer source

PUT https://api.leapa.co/v2/customers/{customer_id}/sources/{account_id}

This endpoint needs your API key

Send it as a bearer token in the Authorization header. A request without one is answered with 401. See Authentication for where to find your key and how to keep it secret.

Request

curl -X PUT "https://api.leapa.co/v2/customers/cus_3d8e51fa20/sources/acc_62f3a8d15b" \
  -H "Authorization: Bearer $LEAPA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "holder_address": {
      "city": "string",
      "state": "string",
      "type": "personal",
      "country": "AD",
      "zip": "string",
      "line1": "string",
      "line2": "string"
    },
    "holder_name": "Jeanne Ndayishimiye",
    "default": false
  }'

Response

OK

{
  "id": "obj_5f21c8a40b",
  "object": "string",
  "address": {
    "object": "string",
    "city": "string",
    "type": "personal",
    "status": "invalid",
    "state": "string",
    "zip": "string",
    "line1": "string",
    "line2": "string"
  },
  "brand": "mastercard",
  "status": "created",
  "currency": "BIF",
  "token": "string",
  "fingerprint": "string",
  "duplicateCard": false,
  "cvc_check": "pass",
  "exp_month": "string",
  "exp_year": "string",
  "last_four": "string",
  "customer_id": "cus_3d8e51fa20",
  "statement_descriptor": "string",
  "default": false,
  "holder_name": "Jeanne Ndayishimiye",
  "holder_type": "individual"
}

Path parameters

Values that go into the URL itself.

  • customer_idstringrequired
    Example:cus_3d8e51fa20
  • account_idstringrequired
    Example:acc_62f3a8d15b

Request body

application/json

Required. Send it as JSON.

  • holder_addressAddressRequestGeneric
  • holder_namestring

    The holder name. Constraints: Size(min=3, max=60)

    Must be:3 to 60 characters
  • defaultboolean

    Indicating whether this card is the default sources of payment

Response

application/json
  • idstring

    Account Id

  • objectstring

    Card Object Name

  • addressAddressResponse
  • brandstring

    Card Brand Name

    Allowed values:mastercardvisa
  • statusstring

    Status of the card account

    Allowed values:createdvalidatedverifiedverification_failederroreddeleted
  • currencystring

    The 3 letter representing the Currency.

    Allowed values:BIFUSDKESXAF
  • tokenstring

    Unique identifier of the bank data as returned by the CyberSource TMS API bank account number

  • fingerprintstring

    Unique identifier of the card number as returned by the CyberSource TMS API

  • duplicateCardboolean
  • cvc_checkstring

    Card Verification Code check result

    Allowed values:passfailunavailableunchecked
  • exp_monthstring

    Expiration Month

  • exp_yearstring

    Expiration Year

  • last_fourstring

    The last 4 digits of the card Number

  • customer_idstring

    Customer Unique Id

  • statement_descriptorstring

    Provides information about the charge that customers see on their statements. Maximum 22 characters.

  • defaultboolean

    This flag indicate if this is the default source or not.

  • holder_namestring

    Holder name. Name of the owner as written on the card.

  • holder_typestring

    Card Holder Type.

    Allowed values:individualcompany

Status codes

  • 200OK
  • 400Bad request
  • 401Unauthorized
  • 402Payment required
  • 403Forbidden
  • 404Not found
  • 428Precondition required
  • 500Server error

Request

curl -X PUT "https://api.leapa.co/v2/customers/cus_3d8e51fa20/sources/acc_62f3a8d15b" \
  -H "Authorization: Bearer $LEAPA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "holder_address": {
      "city": "string",
      "state": "string",
      "type": "personal",
      "country": "AD",
      "zip": "string",
      "line1": "string",
      "line2": "string"
    },
    "holder_name": "Jeanne Ndayishimiye",
    "default": false
  }'

Response

OK

{
  "id": "obj_5f21c8a40b",
  "object": "string",
  "address": {
    "object": "string",
    "city": "string",
    "type": "personal",
    "status": "invalid",
    "state": "string",
    "zip": "string",
    "line1": "string",
    "line2": "string"
  },
  "brand": "mastercard",
  "status": "created",
  "currency": "BIF",
  "token": "string",
  "fingerprint": "string",
  "duplicateCard": false,
  "cvc_check": "pass",
  "exp_month": "string",
  "exp_year": "string",
  "last_four": "string",
  "customer_id": "cus_3d8e51fa20",
  "statement_descriptor": "string",
  "default": false,
  "holder_name": "Jeanne Ndayishimiye",
  "holder_type": "individual"
}