Schedule and Schedule Edit

Brazil

Schedule Quick Start

This guide show the process of scheduling recurrent payments, using Carat Portal's REST web service interface.

What you'll need

  • Active account on Carat Portal's homologation environment (obtained with our support team)
  • A tool capable of performing HTTP calls, such as Postman, REST Client or cURL

Creating the transaction

HTTP method: POST

URL: https://<host>/e-sitef/api/v1/transactions

Headers:

  • Content-Type: application/json
  • merchant_id: {your merchant id}
  • merchant_key: {your merchant key}

Request:

To use this example, don't forget to define the variable {{url}} to the value of your environment host.

{
  "merchant_usn": "12055523043",
  "order_id": "12055523043",
  "authorizer_id": "2",
  "schedule": {
    "amount": "1",
    "do_payment_now": "false",
    "initial_date": "03/08/2025",
    "number_of_times": "3",
    "interval": "1",
    "soft_descriptor": "Assinatura",
    "show_times_invoice": "false"
  },
  "additional_data": {
    "payer": {
      "store_identification": "98253053045"
    }
  }
}
curl
--request POST "https://{{url}}/api/v1/transactions"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxxxxxxxxx"
--data-binary
{
   "merchant_usn":"12055523043",
   "order_id":"12055523043",
   "authorizer_id":"2",
   "schedule":{
      "amount":"1",
      "do_payment_now":"false",
      "initial_date":"03/08/2025",
      "number_of_times":"3",
      "interval":"1",
      "soft_descriptor":"Assinatura",
      "show_times_invoice":"false"
   },
   "additional_data":{
      "payer":{
         "store_identification":"98253053045"
      }
   }
}
--verbose

Response:

{
  "code": "0",
  "message": "OK. Transaction successful.",
  "schedule": {
    "status": "NOV",
    "sid": "<sid>",
    "amount": "1",
    "order_id": "12055523043",
    "merchant_usn": "12055523043"
  }
}

Activating the schedule

HTTP method: POST

URL: https://<host>/e-sitef/api/v1/schedules/<sid>

Replace the field in the URL above with the SID obtained in the transaction creation step.

Headers:

  • Content-Type: application/json
  • merchant_id: {your merchant id}
  • merchant_key: {your merchant key}

Request:

{
  "card": {
    "number": "5555555555555555",
    "expiry_date": "1222"
  }
}
curl
--request POST "https://{{url}}/e-sitef/api/v1/schedules/<sid>"
--header "merchant_id: xxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--header "Content-Type: application/json"
--data-binary
{
   "card":{
      "number":"5555555555555555",
      "expiry_date":"1222"
   }
}
--verbose

Response:

{
  "code": "0",
  "message": "OK. Transaction successful.",
  "schedule": {
    "status": "ATV",
    "sid": "<sid>",
    "schedule_usn": "170713000000040",
    "amount": "1",
    "initial_date": "03/08/2025",
    "next_date": "03/08/2025",
    "number_of_times": "3",
    "soft_descriptor": "Assinatura",
    "show_times_invoice": "false"
  }
}

Checking the schedule status

HTTP method: GET

URL: https://<host>/e-sitef/api/v1/schedules/<sid>

curl
--request GET "https://{{url}}/e-sitef/api/v1/schedules/<sid>"
--header "merchant_id: xxxxxxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--verbose

Response:

{
  "code": "0",
  "message": "OK. Transaction successful.",
  "schedule": {
    "status": "ATV",
    "sid": "<sid>",
    "schedule_usn": "170713000000050",
    "authorizerId": "2",
    "amount": "1",
    "initial_date": "03/08/2025",
    "next_date": "03/08/2025",
    "number_of_times": "3",
    "current_times": "0",
    "soft_descriptor": "Assinatura",
    "show_times_invoice": "false"
  }
}

Begin - Creating a Schedule Transaction

Brazil

To create a schedule transaction, the same service used to create payments must be called. Consuming this method is mandatory in the schedule flow.

  • Resource: /v1/transactions
  • HTTP Method: POST
  • Request format: JSON
  • Response format: JSON

Do Schedule - Activating a Schedule

Brazil

After creating a schedule without immediate payment and obtaining a SID, it's possible to proceed to the next step of the flow: calling the schedule activation service.

  • Resource: /v1/schedules/{sid}
  • HTTP Method: POST
  • Request format: JSON
  • Response format: JSON

Request parameters

ParameterDescriptionFormatMandatory
authorizer_idAuthorizer code. If not sent in transaction creation, becomes mandatory in activation.< 3 NCOND.
card.numberCustomer card number (PAN).< 19 NYES
card.expiry_dateCard expiry date (MMYY).= 4 NCOND.
card.holderCard holder name.< 30 ANCOND.
card.tokenHASH of stored card. Do not send with open card number.= 88 ANNO
wallet_transaction_idDigital wallet transaction ID.< 25 ANNO

Response parameters

ParameterDescriptionFormat
codeCarat Portal response code. Any non-0 means failure.< 4 N
messageCarat Portal response message.< 500 AN
schedule.statusSchedule status on Carat Portal.= 3 AN
schedule.sidSchedule transaction identifier.= 64 AN
schedule.schedule_usnUnique sequential number of the schedule.= 15 N
schedule.amountAmount in cents.< 12 N
schedule.initial_dateFirst execution date (DD/MM/YYYY).= 10 D
schedule.next_dateNext execution date (DD/MM/YYYY).= 10 D
schedule.number_of_timesTotal quantity of scheduled payments.< 3 N
schedule.soft_descriptorAdditional text in card invoice.< 30 AN
schedule.show_times_invoiceAdds current/total suffix when true.< 5 T/F

Execution - Schedule Processing

Brazil

Daily, Carat Portal processes scheduled payments and updates execution data. Schedules that reach the configured number of executions are moved to FIN (finished).

For each recurrent payment, Carat Portal sends a POST to the merchant status URL.

Status notification of recurrent payments

curl  -X POST \
  https://dominiocadastrado.com.br \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'cache-control: no-cache' \
  -d 'rede=Cielo&tipoFinanciamento=4&binCartao=455182&nsuesitef=191107123456780&tid=authorizerTransactionId12345678901234567&parcelas=2&nsu=merchantNsu&autorizadora=1&nit=nitWith64charsLike1234567890123456789012345678901234567890123457&pedido=orderId1234&tipoPagamento=C&finalCartao=2345&status=NEG'
ParameterDescriptionFormat
nitIdentifier of the transaction.= 64 A
pedidoOrder code.< 20 A
nsuMerchant unique sequential number.< 12 N
statusTransaction status.= 3 A
autorizadoraAuthorizer code on Carat Portal.< 10 A
tipoPagamentoC credit, D debit, B boleto.= 1 A
parcelasNumber of installments.< 2 N
redeAcquirer name.< 500 A
tidExternal acquirer transaction ID.= 40 A
binCartaoFirst 6 digits of card.= 6 N
finalCartaoLast 4 digits of card.= 4 N

Important: Carat Portal can return extra parameters without previous warning. Unknown fields should be ignored.

Schedule restrictions

  • Sending SiTef prefixes
  • Payments with authentication
  • Payments with fraud analysis
  • IATA transactions
  • Using cards with SiTef encryption
  • Sending the card security code on scheduled payments

Schedule Edit Quick Start

This guide shows the process of editing a schedule, using Carat Portal's REST web service interface.

What you'll need

  • SID from a schedule with status ATV or INA on Carat Portal
  • A tool capable of performing HTTP calls, such as Postman, REST Client or cURL
  • An application capable of receiving POST HTTPS calls

Creating a schedule edit

HTTP method: POST

URL: https://<host>/e-sitef/api/v1/schedules/edits

Request:

{
  "sid": "<sid>",
  "merchant_data": "14114532781"
}
curl
--request POST "https://{{url}}/e-sitef/api/v1/schedules/edits"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--data-binary
{
   "sid":"<sid>",
   "merchant_data":"14114532781"
}
--verbose

Receiving the authenticity POST:

@RestController
public class MyAuthenticityController {
    @PostMapping(value = "/myauthenticity", consumes = "application/x-www-form-urlencoded; charset=utf-8")
    public ResponseEntity<String> myAuthenticity(@RequestParam Map<String, String> request) {
        Log.info("seid = " + request.get("seid"));
        return new ResponseEntity<>("OK", HttpStatus.OK);
    }
}

Response:

{
  "code": "0",
  "message": "OK. Transaction successful."
}

Altering the schedule

HTTP method: PUT

URL: https://<host>/e-sitef/api/v1/schedules/edits/<seid>

{
  "status": "INA"
}
curl
--request PUT "https://{{url}}/e-sitef/api/v1/schedules/edits/<seid>"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--data-binary
{
   "status":"INA"
}
--verbose
{
  "code": "0",
  "message": "OK. Transaction successful.",
  "schedule": {
    "status": "INA",
    "amount": "1",
    "next_date": "03/08/2025",
    "number_of_times": "3",
    "current_times": "0",
    "soft_descriptor": "Assinatura",
    "show_times_invoice": "false"
  },
  "schedule_edit": {
    "status": "CON"
  }
}

Begin Edit - Creating a Schedule Edit

Brazil

Consuming this service is mandatory in the schedule editing flow. As a result, the merchant obtains a SEID for the next step.

  • Resource: /v1/schedules/edits
  • HTTP Method: POST
  • Request format: JSON
  • Response format: JSON

Request parameters

ParameterDescriptionFormatMandatory
sidIdentifier of the schedule to be edited.= 64 ANYES
merchant_dataMerchant data echoed in authenticity POST.< 20 ANNO

Authenticity POST parameters

ParameterDescriptionFormat
seidIdentifier used in edit confirmation step.= 64 AN
sidIdentifier of schedule to be altered.= 64 AN
merchant_dataMerchant correlation data.< 20 AN

Response parameters

ParameterDescriptionFormat
codeCarat Portal response code. 0 means success.< 4 N
messageCarat Portal response message.< 500 AN

Edit Schedule - Altering a Schedule

Brazil

After obtaining a SEID, the merchant can edit schedule attributes.

  • Resource: /v1/schedules/edits/{seid}
  • HTTP Method: PUT
  • Request format: JSON
  • Response format: JSON

Example - editing multiple attributes

curl
--request PUT "https://{{url}}/e-sitef/api/v1/schedules/edits/qwertyuiopasdfghjklzxcvbnm0123456789qwertyuiopasdfghjklzxcvbnm02"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--data-binary
{
   "status":"INA",
   "amount":"5555",
   "next_date":"15/07/2017",
   "installments":"2",
   "installment_type":"3",
   "soft_descriptor":"Assinatura",
   "show_times_invoice":"false",
   "card":{
      "expiry_date":"1222",
      "number":"5555555555555555"
   }
}
--verbose

Request parameters

ParameterDescriptionFormatMandatory
statusATV to activate inactive schedule, INA to inactivate schedule.= 3 ANNO
amountAmount in cents.< 12 NNO
next_dateNext execution date in DD/MM/YYYY (future date, day 1..28).= 10 DNO
installmentsNumber of installments per scheduled payment.< 2 NNO
installment_type3 with interest, 4 without interest / spot sale.< 2 NNO
soft_descriptorAdditional statement text.< 30 ANNO
show_times_invoiceAdds current/total suffix when true.< 5 T/FNO
card.numberCustomer card number (PAN).< 19 NNO
card.expiry_dateCard expiry date in MMYY; requires card number.= 4 NNO

Response parameters

ParameterDescriptionFormat
codeCarat Portal response code. 0 means success.< 4 N
messageCarat Portal response message.< 500 AN
schedule.statusSchedule status on Carat Portal.= 3 AN
schedule.amountScheduled payment amount.< 12 N
schedule.next_dateNext execution date.= 10 D
schedule.number_of_timesTotal scheduled payments.< 3 N
schedule.current_timesExecuted scheduled payments count.< 3 N
schedule.installmentsInstallment count.< 2 N
schedule.installment_typeFinancing type.< 2 N
schedule.soft_descriptorStatement descriptor.< 30 AN
schedule.show_times_invoiceCurrent/total suffix indicator.< 5 T/F
schedule_edit.statusNOV, EXP, CON, INV.= 3 AN

Did this page help you?