unit uFrm.Teste;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, REST.Types, FireDAC.Stan.Intf,
  FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
  FireDAC.Phys.Intf, FireDAC.DApt.Intf, Vcl.StdCtrls, FireDAC.Comp.DataSet,
  FireDAC.Comp.Client, REST.Response.Adapter, REST.Client, Data.Bind.Components,
  Data.Bind.ObjectScope, Vcl.Grids, Vcl.DBGrids;

type
  TForm1 = class(TForm)
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    RESTResponseDataSetAdapter1: TRESTResponseDataSetAdapter;
    FDMemTable1: TFDMemTable;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin

// showmessage(  RESTRequest1.Params.ParameterByName('ApiKey').Value + #10#13+
//  RESTRequest1.Params.ParameterByName('Origem').Value +#10#13+
//  RESTRequest1.Params.ParameterByName('body').Value);


  RESTRequest1.Params.ParameterByName('body').AddValue(
  '{"Cnpj": "00000000000010",'+
  ' "NumeroAutorizacao": 12266,'+
  ' "DataHoraAutorizacao": "2020-06-19",'+
  ' "NumeroCartao": "60100022100000116",'+
  ' "Itens": [ {"EAN": "7896004711539",'+
  '             "Preco": 10.0,'+
  '             "QuantidadeVenda": 1,'+
  '             "Receita": {"QuantidadeReceita": 1,'+
  '                          "DataReceita": "2020-06-19",'+
  '                          "Conselho": 0,'+
  '                          "NumeroRegistroConselho": 30828,'+
  '                          "SiglaEstado": "SP"'+
  '                         }'+
  '            }'+
  '          ]'+
  '}');

 showmessage( RESTRequest1.Params.ParameterByName('body').Value);

  RESTRequest1.Execute;

end;

end.
