---
title: Transaction
slug: transaction
docTags: 
createdAt: 2023-07-29T04:09:51.459Z
---

:::ApiMethodV2
```json
{
  "name": "Create New Transaction",
  "method": "POST",
  "url": "https://api.tsrtech.com.br",
  "description": "Permite a criação de uma transação/experiência via API",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "nA95E9K5lcIsCMQI1uFTf",
        "language": "curl",
        "code": "curl --location 'https://api.tsrtech.com.br' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"type\": \"string\",\n    \"token\": \"string\",\n    \"survey_id\": \"Number\",\n    \"client_name\": \"string\",\n    \"cpf\": \"string\",\n    \"email\": \"string\",\n    \"phone\": \"string\",\n    \"gender\": \"string\",\n    \"store\": \"string\",\n    \"amount\": \"string\",\n    \"external_id\": \"string\",\n    \"extras\": \"string\",\n    \"channel\": \"Number\"",
        "customLabel": "curl"
      }
    ],
    "selectedLanguageId": "nA95E9K5lcIsCMQI1uFTf"
  },
  "results": {
    "languages": [
      {
        "id": "TFgk-d629lorqw9lut_67",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"created\": true,\n    \"status\": 0,\n    \"transaction_id\": 9999,\n    \"client_id\": \"9999\"\n}"
      },
      {
        "id": "FpcHhzru9bfyVOwOTcdOa",
        "language": "406",
        "customLabel": "",
        "code": "{\n    \"created\": false,\n    \"status\": 2,\n    \"detail\": \"invalid survey_id\"\n}"
      }
    ],
    "selectedLanguageId": "TFgk-d629lorqw9lut_67"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "type",
        "kind": "required",
        "type": "string",
        "description": "transaction",
        "children": []
      },
      {
        "name": "token",
        "kind": "required",
        "type": "string",
        "description": "token de acesso",
        "children": []
      },
      {
        "name": "survey_id",
        "kind": "required",
        "type": "Number",
        "description": "id da pesquisa",
        "children": []
      },
      {
        "name": "client_name",
        "kind": "required",
        "type": "string",
        "description": "nome do respondente",
        "children": []
      },
      {
        "name": "cpf",
        "kind": "optional",
        "type": "string",
        "description": "cpf / cnpj",
        "children": []
      },
      {
        "name": "email",
        "kind": "optional",
        "type": "string",
        "description": "email do respondente",
        "children": []
      },
      {
        "name": "phone",
        "kind": "optional",
        "type": "string",
        "description": "telefone do respondente",
        "children": []
      },
      {
        "name": "gender",
        "kind": "optional",
        "type": "string",
        "description": "gênero do respondente",
        "children": []
      },
      {
        "name": "store",
        "kind": "optional",
        "type": "string",
        "description": "id da loja",
        "children": []
      },
      {
        "name": "amount",
        "kind": "optional",
        "type": "string",
        "description": "valor da experiência",
        "children": []
      },
      {
        "name": "external_id",
        "kind": "optional",
        "type": "string",
        "description": "identificador único externo",
        "children": []
      },
      {
        "name": "extras",
        "kind": "optional",
        "type": "string",
        "description": "parâmetros extras (formato JSON)",
        "children": []
      },
      {
        "name": "channel",
        "kind": "required",
        "type": "string",
        "description": "canal de envio da pesquisa (1 - WhatsApp, 2 - SMS, 3 - Email)",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "autoGeneratedAnchorSlug": "create-new-transaction",
  "legacyHash": "-W7wXiBfNzwVIR3tMx4PH"
}
```
:::



:::ApiMethodV2
```json
{
  "name": "Get All Transactions",
  "method": "GET",
  "url": "https://api.tsrtech.com.br",
  "description": "Exibe todas as transações/experiências enviadas para a TSR bem como o status de cada uma.",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "45oV8dGB6x40vIloYjp_m",
        "language": "curl",
        "code": "curl --location --request GET 'https://api.tsrtech.com.br' \\\n--header 'Accept: application/json' \\\n--data-raw \n'{\n    \"type\": \"transactions_all,\n    \"token\": \"string\"\n    \"survey_id\": number\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "45oV8dGB6x40vIloYjp_m"
  },
  "results": {
    "languages": [
      {
        "id": "fnLX6TqCmU4Cv6q1WRQDN",
        "language": "200",
        "customLabel": "",
        "code": "{\n        \"id\": \"2194\",\n        \"external_id\": \"9293\",\n        \"created_at\": \"2023-07-29 02:39:34\",\n        \"author\": \"40\",\n        \"survey\": \"72\",\n        \"client\": \"926\",\n        \"store\": \"loja 01\",\n        \"amount\": \"1\",\n        \"extras\": \"9293\",\n        \"channel\": \"3\",\n        \"cicle\": \"0\",\n        \"dispatch\": \"1\",\n        \"dispatch_at\": \"2023-07-29 02:40:02\",\n        \"response\": \"Canal não permitido\",\n        \"status\": \"2\"\n    }"
      },
      {
        "id": "-yhatjl0Y6CwgMPw04sFO",
        "language": "406",
        "customLabel": "",
        "code": "{\n      \"message\": \"no content\"\n    }"
      }
    ],
    "selectedLanguageId": "fnLX6TqCmU4Cv6q1WRQDN"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "token",
        "kind": "required",
        "type": "string",
        "description": "token de acesso"
      },
      {
        "name": "type",
        "kind": "required",
        "type": "string",
        "description": "transactions_all",
        "children": []
      },
      {
        "name": "survey_id",
        "kind": "required",
        "type": "Number",
        "description": "id da pesquisa",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "autoGeneratedAnchorSlug": "get-all-transactions",
  "legacyHash": "2u_qTd1N0JC6O9Dow2FrT"
}
```
:::

:::ApiMethodV2
```json
{
  "name": "Get specific transaction",
  "method": "GET",
  "url": "https://api.tsrtech.com.br",
  "description": "Exibe uma transação em específico, com detalhes de resposta caso houver.",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "PmxVdFZjgSnNnHIIDTle-",
        "language": "curl",
        "code": "curl --location --request GET 'https://api.tsrtech.com.br' \\\n--header 'Accept: application/json' \\\n--data-raw '{\n    \"type\": \"transaction\",\n    \"token\": \"string\",\n    \"transaction_id\": number\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "PmxVdFZjgSnNnHIIDTle-"
  },
  "results": {
    "languages": [
      {
        "id": "N2MTkpdDIZ0s6kOXJJPw0",
        "language": "200",
        "customLabel": "",
        "code": "    {\n        \"external_id\": \"\",\n        \"transaction_id\": \"XXXXXX\",\n        \"survey_id\": \"XX\",\n        \"response_status\": \"not answered\",\n        \"survey_title\": \"Pesquisa XXXXX\",\n        \"client_name\": \"XXXXX\",\n        \"cpf\": \"\",\n        \"email\": \"XX@XX.com\",\n        \"phone\": \"\",\n        \"gender\": \"\",\n        \"store\": \"\",\n        \"amount\": \"\",\n        \"cicle\": \"D+7\",\n        \"channel\": \"WhatsApp\",\n        \"last_status\": \"Falha\",\n        \"response_date\": null,\n        \"responses\": null\n    }"
      },
      {
        "id": "WcUrSeMkkv1bUe1wbCUB9",
        "language": "404",
        "customLabel": "",
        "code": "{\n      \"error\": \"transaction not found\"\n    }"
      }
    ],
    "selectedLanguageId": "WcUrSeMkkv1bUe1wbCUB9"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "token",
        "kind": "required",
        "type": "string",
        "description": "token de acesso"
      },
      {
        "name": "type",
        "kind": "required",
        "type": "string",
        "description": "transaction",
        "children": []
      },
      {
        "name": "indicator",
        "kind": "optional",
        "type": "string",
        "description": "metodologia caso utilize na pesquisa (nps / csat)",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "autoGeneratedAnchorSlug": "get-specific-transaction",
  "legacyHash": "H-Ase8wOYbowHhDdYQsG_"
}
```
:::

