Creating a new subscription
POST/recurrency/subscriptions
Endpoint responsible for creating a new subscription
Request​
- application/json
Body
required
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)]
credit
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.
Responses​
- 200
- 400
- 401
- 500
OK
- application/json
- Schema
- Example (from schema)
Schema
{
"id": "096d7bf9-45ee-4891-83ad-eda57b808ee3",
"merchantSubscriptionId": "7903ef09-83c3-458d-ad39-9ea9e736e59b",
"planId": "7d4a4d9f-d3f4-4fad-b290-663c38be6200",
"issuerTransactionId": "1290381029312983",
"nextBillingDate": "2021-07-17T00:00:00-03:00",
"failedAttempts": 2,
"charges": [
"f9199878-79b2-4367-9832-a7392718c14a"
]
}
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"
}
}
Internal Server Error
- 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"
}
]
}