Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

POST      /api/transacao

Endpoint responsável por cadastrar uma ordem de pagamento, retornando o Id da transação em caso de sucesso.

Headers    

Content-Type

application/json

Authorization

Bearer {token}

 

Request Body    application/json

Schema:

IdEstabelecimento

Int32

ID que identifica o estabelecimento solicitante da ordem de pagamento

Obrigatório

IdDispositivo

Int32

ID que identifica o dispositivo que solicitou a ordem de pagamento

Obrigatório

IdRedeCredenciadaMetodosPagamento

Int32

ID que identifica o tipo de venda (Venda Loja: 1)

Obrigatório

IdEstabelecimentoOperador

Int32

ID Que identifica o operador que solicitou a ordem de pagamento

Obrigatório

Valor

Decimal

Valor da ordem de pagamento

Obrigatório

 

JSON:
{
"IdEstabelecimento":3,
"idDispositivo":1,
"IdRedeCredenciadaMetodosPagamento":17, 
"IdEstabelecimentoOperador":1,
"Valor":30
}

Exemplos de Implementação:

C#

Code Block
var client = new RestClient("https://localhost:44380/api/Transacao");

var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImNhaW8uZm9udGVzIiwianRpIjoiZDVkMmQ4ZmVlMDgwNDk2MWE3ZjQ3NWY2MjRiMTkxYmQiLCJOZXRDb3JlVXNlcklkIjoiNjdjNjVhMDQtOTM0NC00MzE0LTYwYzgtMDhkN2RjMGNkMmI2IiwiUm9sZUxldmVsIjoiMCIsIklkRXN0YWJlbGVjaW1lbnRvIjoiMCIsIklkRXN0YWJlbGVjaW1lbnRvT3BlcmFkb3IiOiIwIiwiSWRDbGllbnRlQnJva2VyIjpbIjAiLCIwIl0sInJvbGUiOiJFc3RhYmVsZWNpbWVudG8iLCJuYmYiOjE1OTIyNTk1ODcsImV4cCI6MTU5MjI2MzE4NywiaWF0IjoxNTkyMjU5NTkyLCJpc3MiOiJTc29BdWRpZW5jZSIsImF1ZCI6IlNzb0F1ZGllbmNlIn0.ktfw3Hooj022BX0A_Vhyv7qq0led91t71oSrTBkA3OU");


request.AddParameter("application/json,text/plain", "{\"IdEstabelecimento\":3,\"idDispositivo\":1,\"IdRedeCredenciadaMetodosPagamento\":17, \"IdEstabelecimentoOperador\":1,\"Valor\":30}",  ParameterType.RequestBody);

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);

PHP

Code Block
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://localhost:44380/api/Transacao",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\"IdEstabelecimento\":3,\"idDispositivo\":1,\"IdRedeCredenciadaMetodosPagamento\":17, \"IdEstabelecimentoOperador\":1,\"Valor\":30}",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json",
    "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImNhaW8uZm9udGVzIiwianRpIjoiZDVkMmQ4ZmVlMDgwNDk2MWE3ZjQ3NWY2MjRiMTkxYmQiLCJOZXRDb3JlVXNlcklkIjoiNjdjNjVhMDQtOTM0NC00MzE0LTYwYzgtMDhkN2RjMGNkMmI2IiwiUm9sZUxldmVsIjoiMCIsIklkRXN0YWJlbGVjaW1lbnRvIjoiMCIsIklkRXN0YWJlbGVjaW1lbnRvT3BlcmFkb3IiOiIwIiwiSWRDbGllbnRlQnJva2VyIjpbIjAiLCIwIl0sInJvbGUiOiJFc3RhYmVsZWNpbWVudG8iLCJuYmYiOjE1OTIyNTk1ODcsImV4cCI6MTU5MjI2MzE4NywiaWF0IjoxNTkyMjU5NTkyLCJpc3MiOiJTc29BdWRpZW5jZSIsImF1ZCI6IlNzb0F1ZGllbmNlIn0.ktfw3Hooj022BX0A_Vhyv7qq0led91t71oSrTBkA3OU"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;