Add Card

POST /bank-card

Add new client's bank card using its JWT.

application/json

Body Required

  • card_number string

    Bank card number

  • cardholder_name string

    Owner of the card

  • expires_at string(date)

    Card's expiration date

  • cvv string

    CVC/CVV

Responses

  • 200 application/json

    Successful adding of a new card.

    Hide response attributes Show response attributes object
    • success boolean

      Whether card was added

    • bank_card object

      Additional properties are allowed.

      Hide bank_card attributes Show bank_card attributes object
      • bank_card_id integer Required

        Id of the card in database

      • card_number string Required

        Bank card number

      • cardholder_name string Required

        Owner of the card

      • client_id integer Required

        Id of the client in database

      • cvv string Required

        CVC/CVV

      • expires_at string(date) Required

        Card's expiration date

  • 400 application/json

    Validation error of given input.

    Hide response attributes Show response attributes object
    • success boolean

      Whether query is successful

    • error array[object]

      Validation error of given input.

      Hide error attributes Show error attributes object
      • code string

        Error type

      • expected string

        What was expected

      • received string

        What's the error

      • path array[string]

        What caused an error

      • message string

        Error description

  • 401 application/json

    User is not unauthorized or permissions are missing.

    Hide response attributes Show response attributes object
    • success boolean

      Whether query is successful

    • error string

      Error message

  • 429 application/json

    Rate limit exceeded - 100 queries per 15 minutes.

    Hide response attributes Show response attributes object
    • success boolean

      Whether query is successful

    • error string

      Error message

POST /bank-card
curl \
 --request POST 'http://63.141.232.244:25540/v0/bank-card' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"card_number":"4242424242424242","cardholder_name":"SAKHABUTDINOV KAMIL","expires_at":"2025-01-01","cvv":"123"}'
Request examples
{
  "card_number": "4242424242424242",
  "cardholder_name": "SAKHABUTDINOV KAMIL",
  "expires_at": "2025-01-01",
  "cvv": "123"
}
Response examples (200)
{
  "success": true,
  "bank_card": {
    "cvv": "123",
    "client_id": 1,
    "expires_at": "2022-01-01",
    "card_number": "1234567890123456",
    "bank_card_id": 1,
    "cardholder_name": "SAKHABUTDINOV KAMIL"
  }
}
Response examples (400)
{
  "success": false,
  "error": [
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "undefined",
      "path": [
        "client_id"
      ],
      "message": "Required"
    }
  ]
}
Response examples (401)
{
  "success": false,
  "error": "Unauthorized"
}
Response examples (429)
{
  "success": false,
  "error": "Too many requests, please try again later"
}