Create card in vault
POST/cards
The purpose of this endpoint is to save card data in a card vault.
Request​
Header Parameters
Include the 'caller-origin' property as a string in the header of REST requests only if the application is an e-commerce platform, otherwise, don't include it.
- application/json
Body
required
card
object
required
Possible values: >= 13 characters
and <= 16 characters
, Value must match regular expression ^\d+$
Card number. Must contain only digits.
Possible values: >= 3 characters
and <= 4 characters
, Value must match regular expression ^\d+$
Card security code. Must contain only digits.
Possible values: Value must match regular expression ^\d{9}$|^\d{11}$|^[A-Z0-9]{9}$
Cardholder document. Can be CPF, CNPJ, or other valid document.
Possible values: non-empty
, Value must match regular expression ^[\p{L} ]+$
Cardholder name.
Possible values: >= 1
and <= 12
Card expiration month. Must be between 1 and 12.
Card expiration year. Accepted ranges are between the current year and the current year + 19.
Card brand.
customer
object
required
Related customer (buyer).
Possible values: non-empty
, Value must match regular expression ^[\p{L} ]+$
Customer's name.
Possible values: Value must match regular expression ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Customer's e-mail.
Possible values: [CPF
, CNPJ
, PASSPORT
]
Possible values: Value must match regular expression ^\d{9}$|^\d{11}$|^[A-Z0-9]{9}$
Customer's CPF, CNPJ or PASSAPORT. Must match.
phone
object
Customer phone number.
Possible values: <= 3 characters
, Value must match regular expression ^[0-9]+$
Possible values: <= 3 characters
, Value must match regular expression ^[0-9]+$
Possible values: Value must match regular expression ^[0-9]+$
Possible values: [RESIDENTIAL
, COMMERCIAL
, TEMPORARY
, MOBILE
]
Enum [RESIDENTIAL(Telefone Residencial.), COMMERCIAL(Telefone Comercial.), TEMPORARY(Telefone Temporário.), MOBILE(Celular)]
Possible values: [CREDIT
]
Responses​
- 200
- 400
- 401
- 415
- 500
OK
- application/json
- Schema
- Example (from schema)
Schema
{
"id": "7903ef10-81c3-458d-ad39-9ea9e736e59z",
"cardNumber": "511111******1111",
"cardholderName": "Bruce Wayne",
"cardholderDocument": "01234567891",
"expirationMonth": 1,
"expirationYear": 2030,
"brand": "Visa"
}
Bad Request
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
{
"message": "string",
"success": true,
"errors": [
{
"message": "must be a well-formed UUID string",
"field": "merchantChargeId"
}
]
}
Unauthorized
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
errors
object[]
{
"message": "string",
"success": true,
"errors": [
{
"message": "must be a well-formed UUID string",
"field": "merchantChargeId"
}
]
}
{
"message": "Authorization token not found.",
"success": false,
"errors": {
"message": "Authorization token not found",
"field": "Authorization Token"
}
}
Unsupported Media Type
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
errors
object[]
{
"message": "string",
"success": true,
"errors": [
{
"message": "must be a well-formed UUID string",
"field": "merchantChargeId"
}
]
}
{
"message": "Request object is invalid or incorrectly formatted",
"success": false,
"errors": null
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
errors
object[]
{
"message": "string",
"success": true,
"errors": [
{
"message": "must be a well-formed UUID string",
"field": "merchantChargeId"
}
]
}
{
"message": "Internal Server Error",
"success": false,
"errors": null
}