NAV
bash javascript

Getting Started with our API

Base urls

The base URLs for the TuCuota API are - https://www.tucuota.com/ for live - https://sandbox.tucuota.com/ for sandbox

The API is only available over HTTPS. Attempting to access the API over an unsecured HTTP connection will return a tls_required error.

Authentication

For creating api keys please go to the developers section of our dashboard. You can add api tokens for accesing and consuming the TuCuota API.

Click on Crear nuevo token de acceso. This will give you a token: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjcxYThhNWMxYjY5ODc1MmRiZDc1NzZhM2Y5MDI3YWY1MDhiY2FlY2E5ZDZjZTczMDgwZWZiY2U4ODUzZjc1NzMzYWY2YjEyM2VmM2JhYmE0In0.eyJhdWQiOiIxIiwianRpIjoiNzFhOG…

After creating an access token in the dashboard, you must provide it in an Authorization request header (using the bearer authentication scheme) when making API requests.

Authorization: Bearer {YOUR_SECRET_ACCESS_TOKEN}

Versions

Every request must specify a TuCuota-Version header, with a released API version.

Api-Version: v1

Webhooks

To start receiving webhooks, you’ll need to add webhook endpoints from your Dashboard here.

Example webhook:
{
  "id": "EVPYeJeyeJ7r",
  "created_at": "2019-05-23T20:18:28-0300",
  "data": {
    "object": {
      "id": "PY6b3Rr6nRMo",
      "paid": false,
      "amount": 1600,
      "status": "pending_submission",
      "gateway": "GWEmGgbZgy2R",
      "currency": "ARS",
      "customer": {
        "id": "CSOjzw1Aw94E",
        "name": "Máximo Irizarry",
        "email": "mirrizarry@paez.com",
        "livemode": true,
        "metadata": [],
        "created_at": "2018-05-01T11:45:14-0300",
        "updated_at": "2018-05-01T11:45:14-0300",
        "external_id": "xPre4FXy",
        "mobile_number": "+5493812596655",
        "identification_type": "",
        "identification_number": ""
      },
      "livemode": true,
      "metadata": [],
      "retryable": false,
      "created_at": "2019-05-15T11:45:16-0300",
      "updated_at": "2019-05-23T20:18:26-0300",
      "charge_date": "2019-05-15",
      "description": "Pago extra",
      "subscription": null,
      "payment_method": {
        "id": "PM4b8W5wVDG6",
        "bank": "Bbva Banco Francés S.A.",
        "brand": "cbu",
        "livemode": true,
        "created_at": "2018-05-01T11:45:14-0300",
        "updated_at": "2018-05-01T11:45:14-0300",
        "last_four_digits": "9437"
      },
      "updated_status": "2019-05-23",
      "response_message": "",
      "effective_charged_date": null,
      "estimated_accreditation_date": null
    }
  },
  "livemode": true,
  "resource": "payment",
  "resource_id": "PY6b3Rr6nRMo",
  "type": "payment.retrying"
}

When an event occurs in your account, we’ll send it to every enabled webhook endpoint as a POST request.

Webhooks types

Testing the webhooks in local environments

You can easy create test webhooks using https://webhook.site/ With that you will be able to see what we are sending to our API consumers.

Also, to start integrating the webhooks, your code will need to be accessible from the internet so TuCuota can reach it with HTTP requests. If you’re working locally, the easiest way to do this is with ngrok .

Testing card/cbu numbers

In sandbox mode the following test cards and CBUs can be used to create payments that produce specific responses useful for testing different scenarios.

Brand Number Result
cbu 2859363672283668188432 approved
cbu 2852656051819605126406 rejected
cbu 2858814288841490615567 failed
cbu 0110022831266917230013 will_retry
mastercard 5447651834106668 approved
mastercard 5457948807868523 rejected
mastercard 5292525121482410 failed
visa 4024007127322104 approved
visa 4556854712355908 rejected
visa 4485388690536078 failed

Payments statuses

Status Meaning
pending_submission The payment has been issued, but still not submitted to the finnancial entity
cancelled The payment has been manually cancelled
submitted The payment is succesfully submitted and being processing in the finnancial entity
failed Couldn't be submitted to the finnancial entity. There is an error in the request
will_retry The attempt failed, but the finnancial entity will make a new attempt
approved Submitted OK and approved
rejected Submitted OK but couldn't make the collection

Subscriptions statuses

Status Meaning
active The subscription is active and generating payments
paused The subscription have been manually paused and won't generate payments until is resumed.
cancelled The subscription have been manually cancelled.
finished The subscription is completed: all the payments were collected succesfully. Only for subscriptions with a numbers of payments specified (count field)

Brands

APIs for managing brands

List available brands

Returns a list of the available brands for processing payments.

Example request:

curl -X GET -G "https://www.tucuota.com/api/brands" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/brands");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/brands

Update available brands

Updates the available brands for processing payments. It requires to have the appropiate gateway for each brand.

Example request:

curl -X POST "https://www.tucuota.com/api/brands" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "brands"="["visa-credito", "cbu", "nativa", "mastercard"]" 
const url = new URL("https://www.tucuota.com/api/brands");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "brands": "["visa-credito", "cbu", "nativa", "mastercard"]",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/brands

Body Parameters

Parameter Type Status Description
brands array required The payment method or brand (cbu, visa-credito, visa-debito, mastercard, argencard, diners-club, mastercard-debit, nativa, maestro, lider, cmr-falabella, cencosud, cordobesa, jcb, naranja).

Checkout Sessions

APIs for managing checkout sessions. A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through our hosted Checkout page. We recommend creating a new Session each time your customer attempts to pay or subscribe. Once payment or subscription is successful, the Checkout Session will contain a reference to the resource created. You can create a Checkout Session on your server and pass its ID or redirect to the url, to let your customer to begin the Checkout. After completed your customer will be redirected to the success_url provided when creating the Session.

Create a session

Creates a new session object

Example request:

curl -X POST "https://www.tucuota.com/api/sessions" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "kind"="payment" \
    -d "success_url"="http://example.com/checkout/callback/22912" \
    -d "amount"="1200" \
    -d "description"="Cuota Enero" \
    -d "customer_id"="31.555.214" \
    -d "customer_name"="Juan D'Elía" \
    -d "customer_email"="yournewclient@gmail.com" \
    -d "external_id_required"="1" \
    -d "external_id_display_name"="DNI sin puntos" \
    -d "editable_amount"="false" \
    -d "installments"="3" \
    -d "max_installments"="0" \
    -d "interval_unit"="monthly" \
    -d "interval"="1" \
    -d "day_of_month"="1" \
    -d "day_of_week"="1" \
    -d "count"="3" \
    -d "editable_count"="false" \
    -d "metadata"="{"additional": "Data"}" 
const url = new URL("https://www.tucuota.com/api/sessions");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "kind": "payment",
    "success_url": "http://example.com/checkout/callback/22912",
    "amount": "1200",
    "description": "Cuota Enero",
    "customer_id": "31.555.214",
    "customer_name": "Juan D'Elía",
    "customer_email": "yournewclient@gmail.com",
    "external_id_required": "1",
    "external_id_display_name": "DNI sin puntos",
    "editable_amount": "",
    "installments": "3",
    "max_installments": "0",
    "interval_unit": "monthly",
    "interval": "1",
    "day_of_month": "1",
    "day_of_week": "1",
    "count": "3",
    "editable_count": "",
    "metadata": "{"additional": "Data"}",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/sessions

Body Parameters

Parameter Type Status Description
kind string required One of payment or subscription.
success_url string required The uri on which your customer will be redirected after completing the checkout.
amount float required The amount of the payment or subscription.
description string required The title of the payment or subscription.
customer_id string optional External reference of your customer. You can fill it or ask the customer to fill this field in the checkout process. If not provided by you or your customer we will use the email.
customer_name string optional Name of your customer. You can fill it or ask the customer to fill this field in the checkout process.
customer_email string optional Email of your customer. You can fill it or ask the customer to fill this field in the checkout process.
external_id_required boolean optional Require the customer to fill the id.
external_id_display_name string optional Name of the field in the form.
editable_amount boolean optional Allow the customer to set the amount, useful for donations.
installments integer optional Only for payments, quantity of payments on which the amount will be splitted.
max_installments integer optional Only for payments, allow the customer to choose how many installments can split the payment.
interval_unit string required Only for subscriptions, the unit of time between customer charge dates. One of weekly, monthly or yearly.
interval integer required Only for subscriptions, the number of interval_units between customer charge dates. Must be greater than to 1. If interval_unit is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.
day_of_month integer optional Only for subscriptions, the day of month, from 1 to 28. If not provided will use the todays date. Defaults to 1.
day_of_week integer optional Only for subscriptions, the day of week number, from 0 (Sunday) to 6 (Saturday). If not provided will use the todays date.
count integer optional Only for subscriptions, the total number of payments that should be taken by this subscription. If not specified the subscription will continue until you cancel it.
editable_count boolean optional Only for subscriptions, allow the customer to set the duration of the subscriptions, useful for donations.
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Get session details

Example request:

curl -X GET -G "https://www.tucuota.com/api/sessions/{session}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/sessions/{session}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/sessions/{session}

Customers

APIs for managing customers

Create a customer

Creates a new customer object

Example request:

curl -X POST "https://www.tucuota.com/api/customers" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "external_id"="yourcustomername@mail.com" \
    -d "name"="Juan Méndez" \
    -d "email"="yourcustomername@mail.com" \
    -d "identification_type"="DNI" \
    -d "identification_number"="31.022.123" \
    -d "mobile_number"="+54 351 425 5666" \
    -d "metadata"="{"additional": "Data"}" 
const url = new URL("https://www.tucuota.com/api/customers");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "external_id": "yourcustomername@mail.com",
    "name": "Juan Méndez",
    "email": "yourcustomername@mail.com",
    "identification_type": "DNI",
    "identification_number": "31.022.123",
    "mobile_number": "+54 351 425 5666",
    "metadata": "{"additional": "Data"}",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/customers

Body Parameters

Parameter Type Status Description
external_id string optional External reference of your customer. If empty will autogenerate a random value.
name string required Name of the customer
email string required Email
identification_type string optional Kind of identification
identification_number string optional Kind of identification.
mobile_number string optional Complete mobile phone number
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Validate batch

Validate a batch of customers

Example request:

curl -X POST "https://www.tucuota.com/api/customers/validate" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "array"="accusantium" 
const url = new URL("https://www.tucuota.com/api/customers/validate");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "array": "accusantium",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/customers/validate

Body Parameters

Parameter Type Status Description
array required optional Array of customers to validate.

List customers

Returns a list of all your customers.

Example request:

curl -X GET -G "https://www.tucuota.com/api/customers" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/customers");

    let params = {
            "orderBy": "6",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/customers

Query Parameters

Parameter Status Description
orderBy optional By default newest customers will be first on the list. Allowed values (name approved_payments_count approved_payments_sum rejected_payments_count rejected_payments_sum active_subscriptions_count active_subscriptions_sum cancelled_subscriptions_count finished_subscriptions_count paused_subscriptions_count)

Get a single customer

Example request:

curl -X GET -G "https://www.tucuota.com/api/customers/{customer}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/customers/{customer}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/customers/{customer}

Update a customer

Updates the information of a customer

Example request:

curl -X PUT "https://www.tucuota.com/api/customers/{customer}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "external_id"="31.555.214" \
    -d "name"="Juan Méndez" \
    -d "email"="yourcustomername@mail.com" \
    -d "identification_type"="DNI" \
    -d "identification_number"="31.022.123" \
    -d "mobile_number"="+54 351 425 5666" \
    -d "metadata"="[additional: 'Data']" 
const url = new URL("https://www.tucuota.com/api/customers/{customer}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "external_id": "31.555.214",
    "name": "Juan Méndez",
    "email": "yourcustomername@mail.com",
    "identification_type": "DNI",
    "identification_number": "31.022.123",
    "mobile_number": "+54 351 425 5666",
    "metadata": "[additional: 'Data']",
})

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

PUT api/customers/{customer}

Body Parameters

Parameter Type Status Description
external_id string optional External reference of your customer.
name string optional Name of the customer
email string optional Email
identification_type string optional Kind of identification
identification_number string optional Kind of identification.
mobile_number string optional Complete mobile phone number
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Archive a customer

Archive the customer and cancel subscriptions and payments in process.

Example request:

curl -X POST "https://www.tucuota.com/api/customers/{customer}/actions/archive" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/customers/{customer}/actions/archive");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/customers/{customer}/actions/archive

Restore a customer

Immediately restore the customer

Example request:

curl -X POST "https://www.tucuota.com/api/customers/{customer}/actions/restore" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/customers/{customer}/actions/restore");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/customers/{customer}/actions/restore

Events

APIs for managing events

List events

Returns a cursor-paginated list of your events.

Example request:

curl -X GET -G "https://www.tucuota.com/api/events" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/events");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/events

Gateways

APIs for managing gateways

Create a gateway

Creates a new gateway object

Example request:

curl -X POST "https://www.tucuota.com/api/gateways" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "gatewaykind"="cbuGalicia" \
    -d "number"="14556" \
    -d "username"="username" \
    -d "password"="password12" \
    -d "retrying"="false" \
    -d "code_length"="8" 
const url = new URL("https://www.tucuota.com/api/gateways");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "gatewaykind": "cbuGalicia",
    "number": "14556",
    "username": "username",
    "password": "password12",
    "retrying": "",
    "code_length": "8",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/gateways

Body Parameters

Parameter Type Status Description
gatewaykind string required The kind of gateway (visa, visaD, firstData, naranja, cbuGalicia, banistmo).
number integer required The number of the agreement in the entity.
username string required The username of the gateway.
password string required The password of the gateway.
retrying boolean optional If the gateway will retry the payment if rejected (only for cbuGalicia and visaD).
code_length integer optional If the gateway has a length of ids specified (only for cbuGalicia and Naranja).

List gateways

Returns a list of all your gateways.

Example request:

curl -X GET -G "https://www.tucuota.com/api/gateways" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/gateways");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/gateways

Get a single gateway

Example request:

curl -X GET -G "https://www.tucuota.com/api/gateways/{gateway}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/gateways/{gateway}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/gateways/{gateway}

Update a gateway

Updates the information of a gateway

Example request:

curl -X PUT "https://www.tucuota.com/api/gateways/{gateway}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "username"="NewUsername" \
    -d "password"="ChangedPassword" \
    -d "retrying"="1" \
    -d "code_length"="6" 
const url = new URL("https://www.tucuota.com/api/gateways/{gateway}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "username": "NewUsername",
    "password": "ChangedPassword",
    "retrying": "1",
    "code_length": "6",
})

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

PUT api/gateways/{gateway}

Body Parameters

Parameter Type Status Description
username string required The username of the gateway.
password string required The password of the gateway.
retrying boolean optional If the gateway will retry the payment if rejected.
code_length integer optional If the gateway has a length of ids specified. Only Galicia and Naranja.

Disable a gateway

Immediately disables the gateway, no money can be paid out to a disabled gateway.

This will return a disable_failed error if the gateway has already been disabled.

Example request:

curl -X POST "https://www.tucuota.com/api/gateways/{gateway}/actions/disable" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/gateways/{gateway}/actions/disable");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/gateways/{gateway}/actions/disable

Links

APIs for managing links. A Link is a public page on which your customers can subscribe or pay to your organization. When someone click the link, it creates a Checkout Session so that you customer can complete a checkout flow with the inlinkation provided in the Link.

Create a link

Creates a new link object

Example request:

curl -X POST "https://www.tucuota.com/api/links" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "kind"="payment" \
    -d "success_url"="http://example.com/checkout/callback/22912" \
    -d "amount"="1200" \
    -d "description"="Cuota Enero" \
    -d "title"="Colaborá con nuestra fundación" \
    -d "body"="En la fundación Nuevos Caminos trabajamos cada día por un futuro mejor de los chicos con leucemia. Tu colaboración nos permitirá llegar a más niños y con una mejor prestación." \
    -d "external_id_required"="1" \
    -d "external_id_display_name"="DNI sin puntos" \
    -d "editable_amount"="false" \
    -d "installments"="3" \
    -d "max_installments"="0" \
    -d "interval_unit"="monthly" \
    -d "interval"="1" \
    -d "count"="3" \
    -d "editable_count"="false" \
    -d "metadata"="{"additional": "Data"}" 
const url = new URL("https://www.tucuota.com/api/links");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "kind": "payment",
    "success_url": "http://example.com/checkout/callback/22912",
    "amount": "1200",
    "description": "Cuota Enero",
    "title": "Colaborá con nuestra fundación",
    "body": "En la fundación Nuevos Caminos trabajamos cada día por un futuro mejor de los chicos con leucemia. Tu colaboración nos permitirá llegar a más niños y con una mejor prestación.",
    "external_id_required": "1",
    "external_id_display_name": "DNI sin puntos",
    "editable_amount": "",
    "installments": "3",
    "max_installments": "0",
    "interval_unit": "monthly",
    "interval": "1",
    "count": "3",
    "editable_count": "",
    "metadata": "{"additional": "Data"}",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/links

Body Parameters

Parameter Type Status Description
kind string required One of payment or subscription.
success_url string optional The uri on which your customer will be redirected after completing the checkout.
amount float required The amount of the payment or subscription.
description string required The title of the payment or subscription.
title string required The title of the public link.
body string optional Optional text for including in the link.
external_id_required boolean optional Require the customer to fill the id.
external_id_display_name string optional Name of the field in the link.
editable_amount boolean optional Allow the customer to set the amount, useful for donations.
installments integer optional Only for payments, quantity of payments on which the amount will be splitted.
max_installments integer optional Only for payments, allow the customer to choose how many installments can split the payment.
interval_unit string required Only for subscriptions, the unit of time between customer charge dates. One of weekly, monthly or yearly.
interval integer required Only for subscriptions, the number of interval_units between customer charge dates. Must be greater than to 1. If interval_unit is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.
count integer optional Only for subscriptions, the total number of payments that should be taken by this subscription. If not specified the subscription will continue until you cancel it.
editable_count boolean optional Only for subscriptions, allow the customer to set the duration of the subscriptions, useful for donations.
metadata array optional Reference, additional inlinkation (max 3 keys, 100 chars each).

List links

Returns a paginated list of your links.

Example request:

curl -X GET -G "https://www.tucuota.com/api/links" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/links");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/links

Get a single link

Retrieves the details of a link.

Example request:

curl -X GET -G "https://www.tucuota.com/api/links/{link}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/links/{link}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/links/{link}

Update a link

Updates the inlinkation of a link

Example request:

curl -X PUT "https://www.tucuota.com/api/links/{link}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "kind"="payment" \
    -d "success_url"="http://example.com/checkout/callback/22912" \
    -d "amount"="1200" \
    -d "description"="Cuota Enero" \
    -d "title"="Colaborá con nuestra fundación" \
    -d "body"="En la fundación Nuevos Caminos trabajamos cada día por un futuro mejor de los chicos con leucemia. Tu colaboración nos permitirá llegar a más niños y con una mejor prestación." \
    -d "external_id_boolean"="true" \
    -d "external_id_display_name"="DNI sin puntos" \
    -d "editable_amount"="false" \
    -d "installments"="3" \
    -d "max_installments"="0" \
    -d "interval_unit"="monthly" \
    -d "interval"="1" \
    -d "count"="3" \
    -d "editable_count"="false" \
    -d "metadata"="{"additional": "Data"}" 
const url = new URL("https://www.tucuota.com/api/links/{link}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "kind": "payment",
    "success_url": "http://example.com/checkout/callback/22912",
    "amount": "1200",
    "description": "Cuota Enero",
    "title": "Colaborá con nuestra fundación",
    "body": "En la fundación Nuevos Caminos trabajamos cada día por un futuro mejor de los chicos con leucemia. Tu colaboración nos permitirá llegar a más niños y con una mejor prestación.",
    "external_id_boolean": "true",
    "external_id_display_name": "DNI sin puntos",
    "editable_amount": "",
    "installments": "3",
    "max_installments": "0",
    "interval_unit": "monthly",
    "interval": "1",
    "count": "3",
    "editable_count": "",
    "metadata": "{"additional": "Data"}",
})

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

PUT api/links/{link}

Body Parameters

Parameter Type Status Description
kind string optional One of payment or subscription.
success_url string optional The uri on which your customer will be redirected after completing the checkout.
amount float optional The amount of the payment or subscription.
description string optional The title of the payment or subscription.
title string optional The title of the public link.
body string optional Optional text for including in the link.
external_id_boolean Require optional the customer to fill the id.
external_id_display_name string optional Name of the field in the link.
editable_amount boolean optional Allow the customer to set the amount, useful for donations.
installments integer optional Only for payments, quantity of payments on which the amount will be splitted.
max_installments integer optional Only for payments, allow the customer to choose how many installments can split the payment.
interval_unit string optional Only for subscriptions, the unit of time between customer charge dates. One of weekly, monthly or yearly.
interval integer optional Only for subscriptions, the number of interval_units between customer charge dates. Must be greater than to 1. If interval_unit is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.
count integer optional Only for subscriptions, the total number of payments that should be taken by this subscription. If not specified the subscription will continue until you cancel it.
editable_count boolean optional Only for subscriptions, allow the customer to set the duration of the subscriptions, useful for donations.
metadata array optional Reference, additional inlinkation (max 3 keys, 100 chars each).

PaymentMethods

APIs for managing payment methods

List payment methods

Returns a paginated list of your payment methods.

Example request:

curl -X GET -G "https://www.tucuota.com/api/paymentmethods" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/paymentmethods");

    let params = {
            "page": "13",
            "customer_id": "fugiat",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/paymentmethods

Query Parameters

Parameter Status Description
page optional The number of the page Default: 1
customer_id optional Show only paymentmethods from a given customer

Get a single payment method

Retrieves the details of a single existing payment method.

Example request:

curl -X GET -G "https://www.tucuota.com/api/paymentmethods/{paymentmethod}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/paymentmethods/{paymentmethod}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/paymentmethods/{paymentmethod}

Payments

APIs for managing payments

Create a payment

Creates a new payment object

Example request:

curl -X POST "https://www.tucuota.com/api/payments" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "amount"="1250.99" \
    -d "description"="Cuota Enero" \
    -d "customer_id"="31.555.214" \
    -d "customer_name"="Juan D'Elía" \
    -d "customer_email"="yournewclient@gmail.com" \
    -d "payment_method_brand"="mastercard" \
    -d "payment_method_number"="5031 7557 3453 0604" \
    -d "payment_method_expiration_year"="2022" \
    -d "payment_method_expiration_month"="6" \
    -d "payment_method_id"="PMj1238888123" \
    -d "charge_date"="2019-01-31" \
    -d "metadata"="{"additional": "Data"}" 
const url = new URL("https://www.tucuota.com/api/payments");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "amount": "1250.99",
    "description": "Cuota Enero",
    "customer_id": "31.555.214",
    "customer_name": "Juan D'Elía",
    "customer_email": "yournewclient@gmail.com",
    "payment_method_brand": "mastercard",
    "payment_method_number": "5031 7557 3453 0604",
    "payment_method_expiration_year": "2022",
    "payment_method_expiration_month": "6",
    "payment_method_id": "PMj1238888123",
    "charge_date": "2019-01-31",
    "metadata": "{"additional": "Data"}",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/payments

Body Parameters

Parameter Type Status Description
amount float required The amount of the payment.
description string required The title of the payment.
customer_id string required External reference of your customer. If there is no client with this id, we will create a new one.
customer_name string optional Name of your customer. This field is required if there is no client with this id.
customer_email string optional Email of your customer. This field is required if there is no client with this id.
payment_method_brand string optional The payment method or brand (cbu, visa-credito, visa-debito, mastercard, argencard, diners-club, mastercard-debit, nativa, maestro, lider, cmr-falabella, cencosud, cordobesa, jcb, naranja). This field is required if payment_method_id is not given.
payment_method_number string optional The number of the card or cbu. This field is required if payment_method_id is not given.
payment_method_expiration_year integer optional The card year of expiration. This field is only required in Panamá and when payment_method_id is not given.
payment_method_expiration_month integer optional The card month of expiration. This field is only required in Panamá and when payment_method_id is not given.
payment_method_id string optional The token of the card or cbu. This field is required if payment_method_brand and payment_method_number is not given.
charge_date date optional A future date on which the payment should be collected. If not specified, the payment will be collected as soon as possible.
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Create batch

Creates a batch of payments

Example request:

curl -X POST "https://www.tucuota.com/api/payments/batch" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "array"="nisi" 
const url = new URL("https://www.tucuota.com/api/payments/batch");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "array": "nisi",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/payments/batch

Body Parameters

Parameter Type Status Description
array required optional Array of payments to create.

Validate batch

Validate a batch of payments

Example request:

curl -X POST "https://www.tucuota.com/api/payments/validate" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "array"="quos" 
const url = new URL("https://www.tucuota.com/api/payments/validate");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "array": "quos",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/payments/validate

Body Parameters

Parameter Type Status Description
array required optional Array of payments to validate.

List payments

Returns a paginated list of your payments.

Example request:

curl -X GET -G "https://www.tucuota.com/api/payments" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/payments");

    let params = {
            "page": "5",
            "customer_id": "cumque",
            "status": "in",
            "statuses": "exercitationem",
            "month": "dolore",
            "search": "nostrum",
            "subscription_id": "dolor",
            "gateway": "est",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/payments

Query Parameters

Parameter Status Description
page optional The number of the page (Default: 1)
customer_id optional Show only payments from a given customer
status optional Show only payments that match a specific status
statuses optional Show only payments within an array of statuses
month optional Show only payments of a specific month (Format YYYY-MM)
search optional Show only payments that match a specific query
subscription_id optional Show only payments from a given subscription
gateway optional Show only payments from a given gateway

Get a single payment

Retrieves the details of a single existing payment.

Example request:

curl -X GET -G "https://www.tucuota.com/api/payments/{payment}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/payments/{payment}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/payments/{payment}

Update a payment

Updates the information of a payment

Example request:

curl -X PUT "https://www.tucuota.com/api/payments/{payment}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "amount"="2500.5" \
    -d "charge_date"="2019-01-31" \
    -d "description"="Cuota Febrero" \
    -d "metadata"="['additional' => 'Data']" 
const url = new URL("https://www.tucuota.com/api/payments/{payment}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "amount": "2500.5",
    "charge_date": "2019-01-31",
    "description": "Cuota Febrero",
    "metadata": "['additional' => 'Data']",
})

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

PUT api/payments/{payment}

Body Parameters

Parameter Type Status Description
amount float optional The new amount of the payment. Only will work if the current status is 'pending_submission'.
charge_date date optional A future date on which the payment should be collected. Must be future than today.
description string optional The title of the payment.
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Cancel a payment

Cancels the payment if it has not already been submitted to the bank. Any metadata supplied to this endpoint will be stored on the payment cancellation event it causes.

Example request:

curl -X POST "https://www.tucuota.com/api/payments/{payment}/actions/cancel" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "metadata"="['notes' => 'Cancelled, paid in cash']" 
const url = new URL("https://www.tucuota.com/api/payments/{payment}/actions/cancel");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "metadata": "['notes' => 'Cancelled, paid in cash']",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/payments/{payment}/actions/cancel

Body Parameters

Parameter Type Status Description
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Retry a payment

Retries a failed or cancelled payment. You will receive a resubmission_requested webhook, but after that retrying the payment follows the same process as its initial creation, so you will receive a submitted webhook, followed by a confirmed or failed event. Any metadata supplied to this endpoint will be stored.

Example request:

curl -X POST "https://www.tucuota.com/api/payments/{payment}/actions/retry" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "metadata"="['notes' => 'Retrying again']" 
const url = new URL("https://www.tucuota.com/api/payments/{payment}/actions/retry");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "metadata": "['notes' => 'Retrying again']",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/payments/{payment}/actions/retry

Body Parameters

Parameter Type Status Description
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Subscriptions

APIs for managing subscriptions

Create a subscription

Creates a new subscription object

Example request:

curl -X POST "https://www.tucuota.com/api/subscriptions" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "amount"="1200.5" \
    -d "description"="Taller verano" \
    -d "count"="3" \
    -d "customer_id"="31222222" \
    -d "customer_name"="Alberto D'Elía" \
    -d "customer_email"="juangimenez@gmail.com" \
    -d "payment_method_brand"="mastercard" \
    -d "payment_method_number"="5031 7557 3453 0604" \
    -d "payment_method_expiration_year"="2022" \
    -d "payment_method_expiration_month"="6" \
    -d "payment_method_id"="PMj1238888123" \
    -d "start_date"="2019-01-31" \
    -d "interval_unit"="dolores" \
    -d "interval"="9" \
    -d "day_of_month"="1" \
    -d "day_of_week"="1" \
    -d "metadata"="["additional" => "Data"]" 
const url = new URL("https://www.tucuota.com/api/subscriptions");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "amount": "1200.5",
    "description": "Taller verano",
    "count": "3",
    "customer_id": "31222222",
    "customer_name": "Alberto D'Elía",
    "customer_email": "juangimenez@gmail.com",
    "payment_method_brand": "mastercard",
    "payment_method_number": "5031 7557 3453 0604",
    "payment_method_expiration_year": "2022",
    "payment_method_expiration_month": "6",
    "payment_method_id": "PMj1238888123",
    "start_date": "2019-01-31",
    "interval_unit": "dolores",
    "interval": "9",
    "day_of_month": "1",
    "day_of_week": "1",
    "metadata": "["additional" => "Data"]",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/subscriptions

Body Parameters

Parameter Type Status Description
amount float required The amount of each payment of the subscription.
description string required The title of each payment of the subscription.
count integer optional The total number of payments that should be taken by this subscription. If not specified the subscription will continue until you cancel it.
customer_id string required External reference of your customer. If there is no client with this id, we will create a new one.
customer_name string optional Name of your customer. This field is required if there is no client with this id.
customer_email string optional Email of your customer. This field is required only if is a new customer id.
payment_method_brand string optional The payment method or brand for each payment of the subscription (cbu, visa-credito, visa-debito, mastercard, argencard, diners-club, mastercard-debit, nativa, maestro, lider, cmr-falabella, cencosud, cordobesa, jcb, naranja). This field is required if payment_method_id is not given.
payment_method_number string optional The number of the card or cbu for each payment of the subscription. This field is required if payment_method_id is not given.
payment_method_expiration_year integer optional The card year of expiration. This field is only required in Panamá and when payment_method_id is not given.
payment_method_expiration_month integer optional The card month of expiration. This field is only required in Panamá and when payment_method_id is not given.
payment_method_id string optional The token of the card or cbu for each payment of the subscription. This field is required if payment_method_brand and payment_method_number is not given.
start_date date optional A future date on which the first payment of the subscription should be collected. If not specified, the first payment will be collected as soon as possible.
interval_unit string required The unit of time between customer charge dates. One of weekly, monthly or yearly. Example monthly
interval integer required Number of interval_units between customer charge dates. Must be greater than to 1. If interval_unit is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1. Example 1
day_of_month integer optional Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.
day_of_week integer optional Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Create batch

Creates a batch of subscriptions

Example request:

curl -X POST "https://www.tucuota.com/api/subscriptions/batch" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "array"="totam" 
const url = new URL("https://www.tucuota.com/api/subscriptions/batch");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "array": "totam",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/subscriptions/batch

Body Parameters

Parameter Type Status Description
array required optional Array of subscriptions to create.

Validate batch

Validate a batch of subscriptions

Example request:

curl -X POST "https://www.tucuota.com/api/subscriptions/validate" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "array"="culpa" 
const url = new URL("https://www.tucuota.com/api/subscriptions/validate");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "array": "culpa",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/subscriptions/validate

Body Parameters

Parameter Type Status Description
array required optional Array of subscriptions to validate.

List subscriptions

Returns a paginated list of your subscriptions.

Example request:

curl -X GET -G "https://www.tucuota.com/api/subscriptions" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/subscriptions");

    let params = {
            "page": "16",
            "all": "nobis",
            "statuses": "ut",
            "search": "et",
            "customer_id": "expedita",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/subscriptions

Query Parameters

Parameter Status Description
page optional The number of the page Default: 1
all optional Include cancelled subscriptions. Example /api/subscriptions?all=1
statuses optional Include only subscriptions in statuses. Example /api/subscriptions?statuses[]=paused
search optional Show only payments that match a specific query
customer_id optional Show only subscriptions from a given customer

Get a single subscription

Retrieves the details of a single existing subscription.

Example request:

curl -X GET -G "https://www.tucuota.com/api/subscriptions/{subscription}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/subscriptions/{subscription}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/subscriptions/{subscription}

Update a subscription

Updates the information of a subscription

Example request:

curl -X PUT "https://www.tucuota.com/api/subscriptions/{subscription}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "amount"="1200.5" \
    -d "description"="Taller verano" \
    -d "count"="3" \
    -d "payment_method_brand"="mastercard" \
    -d "payment_method_number"="5031 7557 3453 0604" \
    -d "payment_method_id"="PMj1238888123" \
    -d "start_date"="2019-01-31" \
    -d "interval_unit"="sit" \
    -d "interval"="10" \
    -d "day_of_month"="1" \
    -d "day_of_week"="1" \
    -d "metadata"="["additional" => "Data"]" 
const url = new URL("https://www.tucuota.com/api/subscriptions/{subscription}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "amount": "1200.5",
    "description": "Taller verano",
    "count": "3",
    "payment_method_brand": "mastercard",
    "payment_method_number": "5031 7557 3453 0604",
    "payment_method_id": "PMj1238888123",
    "start_date": "2019-01-31",
    "interval_unit": "sit",
    "interval": "10",
    "day_of_month": "1",
    "day_of_week": "1",
    "metadata": "["additional" => "Data"]",
})

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

PUT api/subscriptions/{subscription}

Body Parameters

Parameter Type Status Description
amount float required The amount of each payment of the subscription.
description string required The title of each payment of the subscription.
count integer optional The total number of payments that should be taken by this subscription. If not specified the subscription will continue until you cancel it.
payment_method_brand string optional The payment method or brand for each payment of the subscription (cbu, visa-credito, visa-debito, mastercard, argencard, diners-club, mastercard-debit, nativa, maestro, lider, cmr-falabella, cencosud, cordobesa, jcb, naranja). This field is required if payment_method_id is not given.
payment_method_number string optional The number of the card or cbu for each payment of the subscription. This field is required if payment_method_id is not given.
payment_method_id string optional The token of the card or cbu for each payment of the subscription. This field is required if payment_method_brand and payment_method_number is not given.
start_date date optional A future date on which the first payment of the subscription should be collected. If not specified, the first payment will be collected as soon as possible.
interval_unit string required The unit of time between customer charge dates. One of weekly, monthly or yearly. Example monthly
interval integer required Number of interval_units between customer charge dates. Must be greater than to 1. If interval_unit is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1. Example 1
day_of_month integer optional Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.
day_of_week integer optional Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Cancel a subscription

Cancels an active subscription and its payments in process. Any metadata supplied to this endpoint will be stored.

Example request:

curl -X POST "https://www.tucuota.com/api/subscriptions/{subscription}/actions/cancel" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "metadata"="['notes' => 'Cancelled, not a client anymore']" 
const url = new URL("https://www.tucuota.com/api/subscriptions/{subscription}/actions/cancel");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "metadata": "['notes' => 'Cancelled, not a client anymore']",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/subscriptions/{subscription}/actions/cancel

Body Parameters

Parameter Type Status Description
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Pause a subscription

Pauses an active subscription. A paused subscription won't generate new payments but can be resumed later. Any metadata supplied to this endpoint will be stored.

Example request:

curl -X POST "https://www.tucuota.com/api/subscriptions/{subscription}/actions/pause" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "metadata"="['notes' => 'Paused for six months']" 
const url = new URL("https://www.tucuota.com/api/subscriptions/{subscription}/actions/pause");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "metadata": "['notes' => 'Paused for six months']",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/subscriptions/{subscription}/actions/pause

Body Parameters

Parameter Type Status Description
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Resume a subscription

Resumes a paused subscription. This will turn the subscription active again and will generate payments if necessary. Any metadata supplied to this endpoint will be stored.

Example request:

curl -X POST "https://www.tucuota.com/api/subscriptions/{subscription}/actions/resume" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "metadata"="['notes' => 'Came back again']" 
const url = new URL("https://www.tucuota.com/api/subscriptions/{subscription}/actions/resume");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "metadata": "['notes' => 'Came back again']",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/subscriptions/{subscription}/actions/resume

Body Parameters

Parameter Type Status Description
metadata array optional Reference, additional information (max 3 keys, 100 chars each).

Webhooks

APIs for managing webhook endpoints

Create a webhook

Creates a new webhook

Example request:

curl -X POST "https://www.tucuota.com/api/webhooks" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "enabled_events"="['*']" \
    -d "url"="https://yoursite.com/tucuota_webhook" 
const url = new URL("https://www.tucuota.com/api/webhooks");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "enabled_events": "['*']",
    "url": "https://yoursite.com/tucuota_webhook",
})

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

POST api/webhooks

Body Parameters

Parameter Type Status Description
enabled_events array optional The list of events to enable for this endpoint (defaults to ['*'])
url required optional The URL of the wendpoint

List webhooks

Returns a list of all your webhooks.

Example request:

curl -X GET -G "https://www.tucuota.com/api/webhooks" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/webhooks");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/webhooks

Get a single webhook

Example request:

curl -X GET -G "https://www.tucuota.com/api/webhooks/{webhook}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/webhooks/{webhook}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response:

null

HTTP Request

GET api/webhooks/{webhook}

Update a webhook

Updates the information of a webhook

Example request:

curl -X PUT "https://www.tucuota.com/api/webhooks/{webhook}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json" \
    -d "enabled_events"="['*']" \
    -d "url"="https://yoursite.com/tucuota_webhook" 
const url = new URL("https://www.tucuota.com/api/webhooks/{webhook}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = JSON.stringify({
    "enabled_events": "['*']",
    "url": "https://yoursite.com/tucuota_webhook",
})

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

PUT api/webhooks/{webhook}

Body Parameters

Parameter Type Status Description
enabled_events array optional The list of events to enable for this endpoint.
url required optional The URL of the wendpoint

Delete a webhook

Delete a webhook endpoint

Example request:

curl -X DELETE "https://www.tucuota.com/api/webhooks/{webhook}" \
    -H "Authorization: Bearer {{ API_KEY }}" \
    -H "Content-Type: application/json"
const url = new URL("https://www.tucuota.com/api/webhooks/{webhook}");

let headers = {
    "Authorization": "Bearer {{ API_KEY }}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

DELETE api/webhooks/{webhook}