Skip to main content

Register Subscription

Allows you to register information to generate a subscription along with the customer's information.

Method

POST

URL

https://b61cr11gvd.execute-api.us-east-1.amazonaws.com/v1/api/payment/suscription

Request Headers

NameTypeDescription
Authorization*stringBearer Token

Request Body

FieldStructureTypeRequiredDescription
hash*stringYesHash generated in /payment/create
plan_idstringYesPlan ID that will be assigned to the customer to activate the subscription.
start_datestringNoSubscription start date in DD/MM/YYYY format. If not provided, the invocation date will be assigned. This date corresponds to the first payment and marks the beginning of the subscription payment frequency. If payment is by credit card, this date will be taken as today's date.
customerstructYesStructure with the user information to whom the subscription will be sent
emailcustomerstringYesCustomer email. Must comply with the standard valid email format.
user_dicustomerstringYesCustomer ID number.
type_dicustomerstringYesCustomer ID type.
first_namecustomerstringYesCustomer first name on the ID (does not accept special characters or accents).
last_namecustomerstringYesCustomer last name on the ID (does not accept special characters or accents).
cellphonecustomerstringYesCustomer cell phone number. Must include the country code.
credit_card_datastructNoStructure to activate automatic card debit.
card_numbercredit_card_datastringYes (automatic debit active)Card number.
cvvcredit_card_dataintYes (automatic debit active)Card security code.
expiration_datecredit_card_datastringYes (automatic debit active)Card expiration date in MM/YY format.
retriescredit_card_dataintNoDefines the number of times a payment is retried if it fails (e.g., insufficient funds). Default value: 1. Allowed values: between 0 and 4. If greater than 1, retries are made every day, as long as the processor allows it.
franchisecredit_card_datastringYes (Automatic Debit Active)Defines the card's deductible.
id_typecredit_card_datastringYes (Automatic Debit Active)Type of ID of the person making the transaction.
idcredit_card_datastringYes (Automatic Debit Active)ID number of the person making the transaction.
holder_namecredit_card_datastringYes (Automatic Debit Active)Cardholder's first name, without last name.
holder_last_namecredit_card_datastringYes (Automatic Debit Active)Cardholder's last name.
emailcredit_card_datastringYes (Automatic Debit Active)Email address of the person making the transaction.
phonecredit_card_datastringYes (Automatic Debit Active)Phone number of the person making the transaction, without callsigns.
ipcredit_card_datastringYes (Automatic Debit Active)IP address of the end-user's device originating the transaction.
header_user_agentcredit_card_datastringYes (Automatic Debit Active)User_agent header of the user's browser.
line1credit_card_datastringYes (Automatic Debit Active)Line 1 associated with the user's billing address.
line2credit_card_datastringYes (automatic debit active)Line 2 associated with the user's billing address.
line3credit_card_datastringYes (auto debit active)Line 3 associated with the user's billing address.
countrycredit_card_datastringYes (auto debit active)User's country.
citycredit_card_datastringYes (auto debit active)User's city.
statecredit_card_datastringYes (auto debit active)User's state or department.
post_codecredit_card_datastringYes (auto debit active)User's postal code.
customer_idstringNoUnique identifier for a user with an existing subscription. When creating a new subscription, you can use the customer_id to avoid resubmitting user and card information. With the customer_id field in the request, the customer and credit_card_data structures are not required.

Request (example)

{
"hash": "",
"plan_id": "1da2c872-3047-4625-9507-22d7a1bd045e",
"start_date": "28/10/2024",
"customer": {
"first_name": "user-name",
"last_name": "last-name",
"user_di": "999999999",
"type_di": "CC",
"cellphone": "+57112321131331",
"email": "user@example.com"
}
}

Response Codes

  • 202: Accepted Payment
  • 406: Payment declined
  • 422: Unprocessable Entity - The body sent is not correct
  • 401: Unauthorized - Header Authorization not sent
  • 401: Unauthorized - Token malformation

Response (example)

{
"status": {
"code": 202,
"message": "success",
"kind": "unknown"
},
"data": {
"CODE": "0000",
"DESC": "OK",
"DATA": {
"id": "b45fd212-2c26-4068-9807-2c9c6b8ac204",
"start_date": "14/06/2023",
"status": "ACTIVE",
"plan": {
"id": "50e25c83-12ba-442f-adf8-6d410b376045"
},
"customer": {
"id": "b45fd212-2c26-4068-9807-2c9c6b8ac204"
}
}
}
}

For days that do not exist in months where a payment is due, for example the 31st, the deadline for making the subscription payment will be the last day of that month.