Schedule recurrence

Schedule an authorization for recurring payment

EnvironmentMethodEndpoint
Sandboxhttps://apisandbox.braspag.com.br/v2/sales/
Productionhttps://api.braspag.com.br/v2/sales/

Unlike recurring authorization, this example does not authorize immediately but schedules a future authorization.

To schedule the first transaction in the series of recurrences:

  • Send Payment.RecurrentPayment.AuthorizeNow = "false";
  • Add the parameter Payment.RecurrentPayment.StartDate and provide the date for authorization.

ℹ️

When setting up a recurrence with a StartDate earlier than the current date, the system will perform retroactive daily charges, one for each pending payment up to the current date. This process continues until the next charge date is in the future.

Request

{  
   "MerchantOrderId":"2017091101",
   "Customer":{  
      "Name":"Nome do Comprador",
      "Identity":"12345678909",
      "IdentityType":"CPF",
      "Address":{  
         "Street":"Alameda Xingu",
         "Number":"512",
         "Complement":"27 andar",
         "ZipCode":"12345987",
         "City":"São Paulo",
         "State":"SP",
         "Country":"BRA",
         "District":"Alphaville"
      }
   },
   "Payment":{
      "Provider":"Simulado",
      "Type":"CreditCard",
      "Amount":10000,
      "Installments":1,
      "CreditCard":{
         "CardNumber":"4551870000000181",
         "Holder":"Nome do Portador",
         "ExpirationDate":"12/2021",
         "SecurityCode":"123",
         "Brand":"Visa"
      },
      "RecurrentPayment":{
         "AuthorizeNow":false,
         "StartDate":"2017-12-31",
         "EndDate":"2019-12-31",
         "Interval":"Monthly"
      }
   }
}
PropertyDescriptionTypeSizeRequired?
Payment.ProviderName of the payment method provider.Text15Yes
Payment.TypePayment method type.Text100Yes
Payment.AmountOrder amount in cents.Number15Yes
Payment.InstallmentsNumber of installments.Number2Yes
Payment.RecurrentPayment.StartDateRecurrence start date.Text10No
Payment.RecurrentPayment.EndDateRecurrence end date.Text10No
Payment.RecurrentPayment.IntervalRecurrence Interval.
Monthly (Default) / Bimonthly / Quarterly / SemiAnnual / Annual.
Text10No
Payment.RecurrentPayment.AuthorizeNow"true" - authorizes right at request. / "false" - for future scheduling.Boolean***Yes
CreditCard.CardNumberCustomer’s card number.Text19Yes
CreditCard.HolderName of cardholder printed on the card.Text25Yes
CreditCard.ExpirationDateExpiration date printed on the card, in the MM/YYYY format.Text7Yes
CreditCard.SecurityCodeSecurity code printed on the back of the card.Text4Yes
CreditCard.BrandCard brand.Text10Yes

Response

{
  [...]
  "Payment":{
    "ServiceTaxAmount": 0,
    "Installments":1,
    "Interest":"ByMerchant",
    "Capture":true,
    "Authenticate":false,
    "Recurrent":false,
    "CreditCard":{
      "CardNumber": "455187******0181",
      "Holder": "Cardholder Name",
      "ExpirationDate":"12/2021",
      "SaveCard":"false",
      "Brand": "Undefined"
    },
    "Type":"CreditCard",
    "Amount":10000,
    "Currency":"BRL",
    "Country":"BRA",
    "Provider":"Simulado",
    Status 20
    "RecurrentPayment": {
      "RecurrentPaymentId": "32703035-7dfb-4369-ac53-34c7ff7b84e8",
      "ReasonCode": 0,
      "ReasonMessage": "Successful",
      "NextRecurrency": "2017-12-31",
      "StartDate": "2017-12-31",
      "EndDate":"2019-12-31",
      "Interval": "Monthly",
      [...]
      "AuthorizeNow": false
    }
  }
}
PropertyDescriptionTypeSizeFormat
RecurrentPaymentIdField identifier of the next recurrence.GUID36xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
NextRecurrencyDate of next recurrence.Text705/2019 (MM/YYYY)
StartDateStart date of recurrence.Text705/2019 (MM/YYYY)
EndDateEnd date of recurrence.Text705/2019 (MM/YYYY)
IntervalInterval between recurrences.Text10Monthly / Bimonthly / Quarterly / SemiAnnual / Annual
AuthorizeNowWhether the first recurrence will already be authorized or not.Boolean***"true" / "false"