# Activate Schedule import ResponseCodes from './codigos-de-resposta.md'; import ApiDoc from '../../../../../src/components/api-doc/ApiDoc'; 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. For schedules **with** immediate payment, use the [payment effectuation service instead](pagamento-rest-dopayment.md). ## Call details - **Resource:** `/v1/schedules/{sid}` - **HTTP Method:** `POST` - **Request format:** `JSON` - **Response format:** `JSON` - **Header parameters:** [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Format", "h-3": "Mandatory", "0-0": "`merchant_id`", "0-1": "Merchant code on Carat Portal. The production and certification codes will be different.", "0-2": "\\< 15 AN", "0-3": "YES", "1-0": "`merchant_key`", "1-1": "Merchant authentication key on Carat Portal. The production and certification keys will be different.", "1-2": "\\< 80 AN", "1-3": "YES", "2-0": "`Content-Type`", "2-1": "It must be sent with the value `application/json`.", "2-2": "= 15 AN", "2-3": "YES" }, "cols": 4, "rows": 3, "align": [ null, null, null, null ] } [/block] ## Examples Below is an example of the schedule activation service call using the **cURL** tool. **Request:** To use this example, don't forget to define the variable `{{url}}` with the value
**** ```bash curl --request POST "https://{{url}}/e-sitef/api/v1/schedules/qwertyuiopasdfghjklzxcvbnm0123456789qwertyuiopasdfghjklzxcvbnm01" --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":"qwertyuiopasdfghjklzxcvbnm0123456789qwertyuiopasdfghjklzxcvbnm01", "schedule_usn":"170713000000040", "amount":"900", "initial_date":"03/08/2017", "next_date":"03/08/2017", "number_of_times":"3", "soft_descriptor":"Assinatura", "show_times_invoice":"false" } } ``` ## Request parameters The table below describes the request parameters of the schedule activation service: [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Format", "h-3": "Mandatory", "0-0": "`authorizer_id`", "0-1": "Code of the authorizer on Carat Portal. [Learn more.](autorizadoras.md)
If this field wasn’t sent during the transaction creation phase, it will become mandatory when consuming the schedule activation service.", "0-2": "\\< 3 N", "0-3": "COND.", "1-0": "**card** Card data.", "1-1": "", "1-2": "", "1-3": "", "2-0": "`number`", "2-1": "Customer's card number (PAN).", "2-2": "\\< 19 N", "2-3": "YES", "3-0": "`expiry_date`", "3-1": "Card expiry date in `MMYY` format. Its requirement depends on the selected acquirer. In most cases, this field is mandatory.", "3-2": "= 4 N", "3-3": "COND.", "4-0": "`holder`", "4-1": "Card holder name. Only mandatory for payments with e-Rede, GetNet WS and VR (SmartNet).", "4-2": "\\< 30 AN", "4-3": "COND.", "5-0": "`token`", "5-1": "HASH of a card stored on Carat Portal. It's not allowed to send an ‘open' card number (`number` field) and a stored card (`token` field) on the same request.", "5-2": "= 88 AN", "5-3": "NO", "6-0": "`wallet_transaction_id`", "6-1": "Digital wallet transaction ID. Currently, this functionality is only available to the Visa Checkout authorizer.
It isn't allowed to send an ‘open' card number (`number` field), a stored card (`token` field) and a `wallet_transaction_id` on the same request.", "6-2": "\\< 25 AN", "6-3": "NO" }, "cols": 4, "rows": 7, "align": [ null, null, null, null ] } [/block] ## Response parameters If successful, the response code will be `201`. Any other code must be interpreted as an error. The below describes the response parameters of the schedule activation service: [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "h-2": "Format", "0-0": "`code`", "0-1": "Carat Portal response code. Any code different from `0`(zero) means failure. [Learn more.](codigos-da-api.md#response-codes)", "0-2": "\\< 4 N", "1-0": "`message`", "1-1": "Carat Portal response message.", "1-2": "\\< 500 AN", "2-0": "**schedule**", "2-1": "", "2-2": "", "3-0": "`status`", "3-1": "Status of the schedule on Carat Portal. [Learn more.](codigos-da-api.md#schedule-status)", "3-2": "= 3 AN", "4-0": "`sid`", "4-1": "Schedule transaction identifier on Carat Portal.", "4-2": "= 64 AN", "5-0": "`schedule_usn`", "5-1": "Unique sequential number of the schedule on Carat Portal.", "5-2": "= 15 N", "6-0": "`authorizer_id`", "6-1": "Code of the authorizer to be used on the scheduled payments.", "6-2": "= 4 N", "7-0": "`amount`", "7-1": "Amount of the scheduled payments specified by the merchant (in cents) on the creation of the transaction.", "7-2": "\\< 12 N", "8-0": "`order_id`", "8-1": "Order code sent by the merchant on the creation of the transaction.", "8-2": "\\< 40 AN", "9-0": "`merchant_usn`", "9-1": "Unique sequential number sent by the merchant on the creation of the transaction.", "9-2": "\\< 12 N", "10-0": "`initial_date`", "10-1": "Execution date of the first scheduled payment in `DD/MM/YYYY` format.", "10-2": "= 10 D", "11-0": "`next_date`", "11-1": "Execution date of the next scheduled payment in `DD/MM/YYYY` format.", "11-2": "= 10 D", "12-0": "`number_of_times`", "12-1": "Total quantity of scheduled payments.", "12-2": "\\< 3 N", "13-0": "`installments`", "13-1": "Number of installments to be used on the scheduled payments.", "13-2": "\\< 2 N", "14-0": "`installment_type`", "14-1": "Financing type to be used on the scheduled payments.", "14-2": "\\< 2 N", "15-0": "`soft_descriptor`", "15-1": "Additional text that will be presented alongside the name of the establishment in the credit card invoice. [Learn more](./soft-descriptor.md)", "15-2": "\\< 30 AN", "16-0": "`show_times_invoice`", "16-1": "For finite time schedules, send this field with value `true` if you want to add at the end of the `soft_descriptor` field the current times/number of times (e.g. Subscription 3/12).", "16-2": "\\< 5 T/F" }, "cols": 3, "rows": 17, "align": [ null, null, null ] } [/block]