---
title: Devoluciones
slug: devoluciones
description: Learn how to process full and partial refunds or cancellations of purchases using the Mobbex API. This comprehensive document includes code examples in CURL, JavaScript, and PHP to guide you through the process. Discover which payment methods support refu
icon: 🔂
docTags: 
createdAt: 2021-03-05T21:23:02.000Z
---

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.unicobros.com.ar/p/operations/{ID}/refund",
  "name": "Anulación / Devolución Total",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "ID",
        "type": "string",
        "description": "ID de la Operación que se intenta devolver."
      }
    ],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "description": "Clave API de su aplicación."
      },
      {
        "kind": "required",
        "name": "x-access-token",
        "type": "string",
        "description": "Token de acceso a la entidad."
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "lmN7aUxnK_k0ejvqS1ctt",
        "code": "{\n    \"result\": true,\n    \"status_message\": \"Aprobado\"\n}",
        "language": "200"
      }
    ],
    "selectedLanguageId": "lmN7aUxnK_k0ejvqS1ctt"
  },
  "examples": {
    "languages": [
      {
        "id": "Lp8NsM8R7hai2uKtK4XAG",
        "code": "curl --request GET \\\n  --url https://api.unicobros.com.ar/p/operations/NfkvurRUX/refund \\\n  --header 'cache-control: no-cache' \\\n  --header 'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj' \\\n  --header 'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'",
        "language": "curl"
      },
      {
        "id": "utcI_Y1_wePSUEU0RDDVd",
        "code": "var xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\nxhr.addEventListener(\"readystatechange\", function () {\n    if (this.readyState === 4) {\n        console.log(this.responseText);\n    }\n});\nxhr.open(\"GET\", \"https://api.unicobros.com.ar/p/operations/NfkvurRUX/refund\");\nxhr.setRequestHeader(\"x-api-key\", \"zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj\");\nxhr.setRequestHeader(\"x-access-token\", \"d31f0721-2f85-44e7-bcc6-15e19d1a53cc\");\nxhr.setRequestHeader(\"cache-control\", \"no-cache\");\nxhr.send();",
        "language": "javascript"
      },
      {
        "id": "HL7GhjTQRxFn_3OJcVxK9",
        "code": "<?php\n$request = new HttpRequest();\n$request->setUrl('https://api.unicobros.com.ar/p/operations/NfkvurRUX/refund');\n$request->setMethod(HTTP_METH_GET);\n$request->setHeaders(array(\n  'cache-control' => 'no-cache',\n  'content-type' => 'application/json',\n  'x-access-token' => 'd31f0721-2f85-44e7-bcc6-15e19d1a53cc',\n  'x-api-key' => 'zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj'\n));\ntry {\n  $response = $request->send();\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}\n?>",
        "language": "php"
      }
    ],
    "selectedLanguageId": "Lp8NsM8R7hai2uKtK4XAG"
  },
  "description": "Mediante este llamado a nuestro API podrás procesar la devolución total o anulación de una compra en estado Pago. Es importante aclarar que no todos los medios de pago soportan anulación o devolución del monto abonado.",
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "autoGeneratedAnchorSlug": "anulacin-devolucin-total",
  "legacyHash": "jXqWqelDw_uqA9056l06i"
}
```
:::

:::hint{type="warning"}
Si la anulación/devolución total se realiza en el día el webhook devolverá 601 (Cancelado). En el caso de que se realice al otro día 602 (Devuelto).&#x20;
:::



:::ApiMethodV2
```json
{
  "tab": "request",
  "url": "https://api.unicobros.com.ar/p/operations/{ID}/refund",
  "name": "Devolución Total con Opciones o Parcial",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "ID",
        "type": "string",
        "description": "ID de la Operación que se intenta devolver."
      }
    ],
    "headerParameters": [
      {
        "kind": "required",
        "name": "x-api-key",
        "type": "string",
        "description": "Clave API de su aplicación."
      },
      {
        "kind": "required",
        "name": "x-access-token",
        "type": "string",
        "description": "Token de Acceso"
      }
    ],
    "bodyDataParameters": [
      {
        "kind": "optional",
        "name": "total",
        "type": "Number",
        "description": "Monto que se devolverá. Si no se envía se devolverá el total de la operación. Formato XXX.xx donde el PUNTO es el separador decimal."
      },
      {
        "name": "terminal",
        "kind": "optional",
        "type": "string",
        "description": "Sólo para Transacciones con POS ( Tarjeta Presente ). Permite hacer una devolución en un POS diferente al usado en la transacción original. Si no se envía se utilizará el POS original. Si se envía null o false y es el POS es requerido devolverá error \"POS:POS_ACTION_REQUIRED\". Si no se envía terminal o se envía una se devolverá como error \"POS:POS_ACTION_SENT_TO_POS\" notando que la acción fue enviada al POS para finalizarla.",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "pAjL39m5wcarmL_yP3cMW",
        "code": "{\n    \"result\": true,\n    \"status_message\": \"Aprobado\"\n}",
        "language": "200"
      }
    ],
    "selectedLanguageId": "pAjL39m5wcarmL_yP3cMW"
  },
  "examples": {
    "languages": [
      {
        "id": "Abqab8yW3VoWtMrInfAh_",
        "code": "var data = JSON.stringify({\n  \"total\": 100\n});\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function() {\n  if(this.readyState === 4) {\n    console.log(this.responseText);\n  }\n});\n\nxhr.open(\"POST\", \"https://api.unicobros.com.ar/p/operations/91MIUU1eM/refund\");\nxhr.setRequestHeader(\"x-api-key\", \"zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj\");\nxhr.setRequestHeader(\"x-access-token\", \"d31f0721-2f85-44e7-bcc6-15e19d1a53cc\");\nxhr.setRequestHeader(\"Content-Type\", \"application/json\");\n\nxhr.send(data);",
        "language": "javascript"
      },
      {
        "id": "2vpPMuJ6NXAX5XH3g-Bu1",
        "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://api.unicobros.com.ar/p/operations/91MIUU1eM/refund',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'POST',\n  CURLOPT_POSTFIELDS =>'{\n    \"total\": 100\n}',\n  CURLOPT_HTTPHEADER => array(\n    'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',\n    'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc',\n    'Content-Type: application/json'\n  ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n",
        "language": "php"
      }
    ],
    "selectedLanguageId": "2vpPMuJ6NXAX5XH3g-Bu1"
  },
  "description": "Mediante este llamado a nuestro API podrás procesar la devolución parcial de una compra en estado Pago. Es importante aclarar que no todos los medios de pago soportan anulación o devolución del monto abonado.",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "autoGeneratedAnchorSlug": "devolucin-total-con-opciones-o-parcial",
  "legacyHash": "W5oKw7BUKoJ55PzVmfkzF"
}
```
:::

:::hint{type="warning"}
Si la devolución parcial se trata de realizar en el mismo día, dará error. Únicamente se puede realizar al otro día y el webhook será codigo 200, ya que se sigue encontrando parcialmente aprobada.
:::

