--
Just like with billing, the card and cardholder data can be sent in the subscription creation request for the payment to be processed. The difference is that for billing, the customer's card is charged at the time of creation, whereas for subscriptions, the card is validated at the time of creation, but the charge is only made at the due date of the first installment. It's important to note that the validation done at the time of creation does not guarantee that the charge will be successful at the due date, as the card may have been canceled, expired, have insufficient funds, among other reasons.
To do this, when executing the subscription creation request, simply send the credit card data along with the cardholder data through the creditCard
and creditCardHolderInfo
objects. If the transaction is authorized, the subscription will be created, and Asaas will return HTTP 200
. Otherwise, the subscription will not be persisted, and HTTP 400
will be returned.
Once the subscription is created with a credit card, the charge will be made monthly (or another defined frequency) on the customer's card until it becomes invalid or you remove the subscription.
Attention
- If you choose to capture the customer's card data in your system interface, the use of SSL (HTTPS) is mandatory; otherwise, your account may be blocked for credit card transactions.
- To avoid timeouts and consequently duplicate charges, we recommend setting a minimum timeout of 60 seconds for this request.
Credit Card Tokenization
To use credit card tokenization in subscription creation, you should follow the same instructions as Create payment with credit card.